Spaces:
Running
Running
| #!/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 |