-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
[Bugfix] Use lazy string reference for DeepseekV3Config in config registry #28958
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
base: main
Are you sure you want to change the base?
Changes from all commits
4a12840
d16f226
1d531f1
51ce742
dc40137
5062047
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,7 @@ | |
| RepositoryNotFoundError, | ||
| RevisionNotFoundError, | ||
| ) | ||
| from transformers import DeepseekV3Config, GenerationConfig, PretrainedConfig | ||
| from transformers import GenerationConfig, PretrainedConfig | ||
| from transformers.models.auto.image_processing_auto import get_image_processor_config | ||
| from transformers.models.auto.modeling_auto import ( | ||
| MODEL_FOR_CAUSAL_LM_MAPPING_NAMES, | ||
|
|
@@ -80,7 +80,7 @@ def __getitem__(self, key): | |
| afmoe="AfmoeConfig", | ||
| chatglm="ChatGLMConfig", | ||
| deepseek_vl_v2="DeepseekVLV2Config", | ||
| deepseek_v32=DeepseekV3Config, | ||
| deepseek_v32="DeepseekV3Config", | ||
| flex_olmo="FlexOlmoConfig", | ||
|
Comment on lines
81
to
84
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The registry now stores Useful? React with 👍 / 👎.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Solved in the reply to gemini-code-assist[bot] |
||
| kimi_linear="KimiLinearConfig", | ||
| kimi_vl="KimiVLConfig", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change to use a string reference for lazy loading is a good idea, but it will cause a runtime
AttributeErroras implemented.The
LazyConfigDictexpects to find the config class within thevllm.transformers_utils.configsmodule when a string is provided. However,DeepseekV3Configis imported fromtransformersand is not exposed in that module after your change to remove the direct import in this file.To fix this, you need to make
DeepseekV3Configavailable invllm.transformers_utils.configs. You can achieve this by addingfrom transformers import DeepseekV3Configtovllm/transformers_utils/configs/__init__.pyand including"DeepseekV3Config"in its__all__list. This will preserve the lazy loading behavior, asvllm.transformers_utils.configsis only imported when a config is first accessed from the registry.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me. I have added
from transformers import DeepseekV3Configinvllm/transformers_utils/configs/__init__.pyand added comments to explain such case.