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+ )
0 commit comments