Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR attempts to make the model loading process more systematic and self-contained. Currently when addinga new model, we have to explicitly import the model entry class in
model_runnter.load_model
function. This introduces two drawbacks:model_runner.py
cannot focus on the changes of "model runner".model_runner.py
is easy to be missed and may result in conflicts.sglang.srt
does not follow the standard Python package structure (i.e., leveraging__init__.py
to construct module hierarchy), so it's not straightforward to use a model registry with decorator. In this PR, I tried to dynamically scan all model files undermodels
, and load their entry classes. The major drawback of this approach is that every model file has to haveEntryClass
alias to be scanned. IMHO it should be relatively easy for developers to follow.Please share your thoughts.