Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggestion: import的时候,改为相对引用 #13

Open
yuanzhoulvpi2017 opened this issue Dec 19, 2024 · 3 comments
Open

suggestion: import的时候,改为相对引用 #13

yuanzhoulvpi2017 opened this issue Dec 19, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@yuanzhoulvpi2017
Copy link

从推特过来的,你们这个项目,觉得非常棒🎉,期待更多的代码更新。
给个建议:megatron-lm最让我讨厌的一点,就是导入的时候,是绝对引用。
你们这个包,还在发展中,我看在import的时候,是绝对引用,希望改为相对引用。这样方便更多的开发者在这个上面进行二次开发。

当然这个也是不痛不痒的一个点。

@3outeille 3outeille added the enhancement New feature or request label Dec 19, 2024
@Sleepyhead01
Copy link

Looks like a good first issue. Could you clarify if there are any specific guidelines for switching from absolute to relative imports? Else, I can explore and open a PR with the changes. Tx

@yuanzhoulvpi2017
Copy link
Author

may be get some idea from transformers code

# copy code from https://github.com/huggingface/transformers/blob/a5bb52847139bf6ad7489ac62a5fb6d0fa3d2ec6/src/transformers/models/paligemma/modeling_paligemma.py#L24
from ...cache_utils import Cache, HybridCache, StaticCache
from ...generation import GenerationMixin
from ...modeling_utils import PreTrainedModel
from ...utils import (
    ModelOutput,
    add_start_docstrings,
    add_start_docstrings_to_model_forward,
    is_flash_attn_2_available,
    logging,
    replace_return_docstrings,
)
from .configuration_paligemma import PaliGemmaConfig


if is_flash_attn_2_available():
    from flash_attn.bert_padding import index_first_axis, pad_input, unpad_input  # noqa

from ..auto import AutoModel, AutoModelForCausalLM

@Sleepyhead01
Copy link

Hi, I’ve submitted a PR after replacing absolute imports with relative imports across the codebase. Looking forward to your feedback! Tx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants