Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mcore_bridge/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from .constant import ModelType
from .gpt_model import GPTModel
from .mm_gpt_model import MultimodalGPTModel
from .register import get_mcore_model, get_mcore_model_type, get_model_meta
from .register import MODEL_MAPPING, get_mcore_model, get_mcore_model_type, get_model_meta
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Exposing the raw MODEL_MAPPING dictionary in the public API allows external code to modify the registry directly, which can bypass the validation logic in register_model and lead to inconsistencies with the internal model_type_mapping cache in register.py. If the intention is to allow external registration of models, it is recommended to export the register_model function instead. If the intention is to allow inspection of the registered models, consider providing a read-only view or a getter function to maintain better encapsulation.

Suggested change
from .register import MODEL_MAPPING, get_mcore_model, get_mcore_model_type, get_model_meta
from .register import get_mcore_model, get_mcore_model_type, get_model_meta, register_model

Loading