Skip to content

Commit e5718f0

Browse files
authored
fix
1 parent 35221d1 commit e5718f0

File tree

2 files changed

+37
-30
lines changed

2 files changed

+37
-30
lines changed

lightllm/models/__init__.py

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
1-
import os
2-
import importlib
3-
import inspect
4-
from pathlib import Path
5-
6-
7-
def auto_import_models():
8-
"""
9-
Automatically imports all classes from model.py files in model directories
10-
"""
11-
base_dir = os.path.dirname(os.path.abspath(__file__))
12-
models_dir = Path(base_dir)
13-
for model_dir in models_dir.iterdir():
14-
if not model_dir.is_dir():
15-
continue
16-
model_file = model_dir / "model.py"
17-
if not model_file.exists():
18-
continue
19-
module_path = f"lightllm.models.{model_dir.name}.model"
20-
21-
try:
22-
importlib.import_module(module_path)
23-
except:
24-
pass
25-
26-
27-
auto_import_models()
28-
from .registry import get_model
1+
from lightllm.models.cohere.model import CohereTpPartModel
2+
from lightllm.models.mixtral.model import MixtralTpPartModel
3+
from lightllm.models.bloom.model import BloomTpPartModel
4+
from lightllm.models.llama.model import LlamaTpPartModel
5+
from lightllm.models.starcoder.model import StarcoderTpPartModel
6+
from lightllm.models.starcoder2.model import Starcoder2TpPartModel
7+
from lightllm.models.qwen.model import QWenTpPartModel
8+
from lightllm.models.qwen2.model import Qwen2TpPartModel
9+
from lightllm.models.qwen3.model import Qwen3TpPartModel
10+
from lightllm.models.qwen3_moe.model import Qwen3MOEModel
11+
from lightllm.models.chatglm2.model import ChatGlm2TpPartModel
12+
from lightllm.models.internlm.model import InternlmTpPartModel
13+
from lightllm.models.stablelm.model import StablelmTpPartModel
14+
from lightllm.models.internlm2.model import Internlm2TpPartModel
15+
from lightllm.models.internlm2_reward.model import Internlm2RewardTpPartModel
16+
from lightllm.models.mistral.model import MistralTpPartModel
17+
from lightllm.models.minicpm.model import MiniCPMTpPartModel
18+
from lightllm.models.llava.model import LlavaTpPartModel
19+
from lightllm.models.qwen_vl.model import QWenVLTpPartModel
20+
from lightllm.models.gemma_2b.model import Gemma_2bTpPartModel
21+
from lightllm.models.phi3.model import Phi3TpPartModel
22+
from lightllm.models.deepseek2.model import Deepseek2TpPartModel
23+
from lightllm.models.internvl.model import (
24+
InternVLLlamaTpPartModel,
25+
InternVLPhi3TpPartModel,
26+
InternVLQwen2TpPartModel,
27+
InternVLDeepSeek2TpPartModel,
28+
)
29+
from lightllm.models.internvl.model import InternVLInternlm2TpPartModel
30+
from lightllm.models.qwen2_vl.model import Qwen2VLTpPartModel
31+
from lightllm.models.qwen2_reward.model import Qwen2RewardTpPartModel
32+
from lightllm.models.gemma3.model import Gemma3TpPartModel
33+
from lightllm.models.tarsier2.model import (
34+
Tarsier2Qwen2TpPartModel,
35+
Tarsier2Qwen2VLTpPartModel,
36+
Tarsier2LlamaTpPartModel,
37+
)

lightllm/models/registry.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ def get_model(self, model_cfg: dict, model_kvargs: dict) -> tuple:
4545
"""Get model"""
4646
model_type = model_cfg.get("model_type", "")
4747
configs = self._registry.get(model_type, [])
48-
model = None
49-
is_multimodal = False
5048
matches = []
5149
for cfg in configs:
5250
if cfg.condition is None or cfg.condition(model_cfg):

0 commit comments

Comments
 (0)