Spaces:
Sleeping
Sleeping
File size: 1,648 Bytes
526927a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
#!/usr/bin/env python3
"""
๋ชจ๋ธ ํ๋กํ ๊ด๋ฆฌ
"""
# from .polyglot_ko_1_3b import PolyglotKo13bProfile
# from .dialogpt_medium import DialoGPTMediumProfile
# from .kanana_1_5_2_1b_instruct import Kanana15V21bInstructProfile
# from .kanana_nano_2_1b_instruct import KananaNano21bInstructProfile
# from .mistral_7b_instruct import Mistral7bInstructProfile
# from .polyglot_ko_5_8b import PolyglotKo58bProfile
from .polyglot_ko_1_3b_chat import PolyglotKo13bChatProfile
from .kanana_1_5_v_3b_instruct import Kanana15V3bInstructProfile
from .polyglot_ko_5_8b_chat import PolyglotKo58bChatProfile
# ์ฌ์ฉ ๊ฐ๋ฅํ ๋ชจ๋ธ ํ๋กํ๋ค
AVAILABLE_MODELS = {
"polyglot-ko-1.3b-chat": PolyglotKo13bChatProfile,
"kanana-1.5-v-3b-instruct": Kanana15V3bInstructProfile,
"polyglot-ko-5.8b-chat": PolyglotKo58bChatProfile,
}
def get_model_profile(model_id: str):
"""๋ชจ๋ธ ID๋ก ํ๋กํ ๊ฐ์ ธ์ค๊ธฐ"""
if model_id not in AVAILABLE_MODELS:
raise ValueError(f"์ ์ ์๋ ๋ชจ๋ธ ID: {model_id}")
return AVAILABLE_MODELS[model_id]()
def list_available_models():
"""์ฌ์ฉ ๊ฐ๋ฅํ ๋ชจ๋ธ ๋ชฉ๋ก ๋ฐํ"""
models = []
for model_id, profile_class in AVAILABLE_MODELS.items():
profile = profile_class()
model_info = profile.get_model_info()
models.append({
"model_id": model_id,
"name": model_info["display_name"],
"description": model_info["description"],
"language": model_info["language"],
"model_size": model_info["model_size"],
"multimodal": model_info.get("multimodal", False)
})
return models |