Skip to content

Commit

Permalink
update model config
Browse files Browse the repository at this point in the history
  • Loading branch information
imClumsyPanda committed Jul 9, 2024
1 parent da20d98 commit 88c6e82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions libs/chatchat-server/chatchat/server/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ def get_config_models(
"rerank_models": lambda xf_models: [k for k, v in xf_models.items()
if "rerank" == v["model_type"]],
"speech2text_models": lambda xf_models: [k for k, v in xf_models.items()
if v[list(XF_MODELS_TYPES["speech2text"].keys())[0]]
if v.get(list(XF_MODELS_TYPES["speech2text"].keys())[0])
in XF_MODELS_TYPES["speech2text"].values()],
"text2speech_models": lambda xf_models: [k for k, v in xf_models.items()
if v[list(XF_MODELS_TYPES["text2speech"].keys())[0]]
if v.get(list(XF_MODELS_TYPES["text2speech"].keys())[0])
in XF_MODELS_TYPES["text2speech"].values()],
}

Expand All @@ -126,8 +126,8 @@ def get_config_models(
logger.warning(f"auto_detect_model not supported for {m.get('platform_type')} yet")
continue
for m_type in model_types:
if m.get(m_type) != "auto":
continue
# if m.get(m_type) != "auto":
# continue
try:
from xinference_client import RESTfulClient as Client
xf_url = get_base_url(m.get("api_base_url"))
Expand Down
10 changes: 5 additions & 5 deletions libs/chatchat-server/chatchat/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class PlatformConfig(MyBaseModel):
platform_name: str = "xinference"
"""平台名称"""

platform_type: t.Literal["xinference", "ollama", "oneapi", "fastchat", "openai"] = "xinference"
platform_type: t.Literal["xinference", "ollama", "oneapi", "fastchat", "openai", "custom openai"] = "xinference"
"""平台类型"""

api_base_url: str = "http://127.0.0.1:9997/v1"
Expand Down Expand Up @@ -765,7 +765,7 @@ class PromptSettings(BaseFileSettings):


class SettingsContainer:
CHATCHAT_ROOT = CHATCHAT_ROOT
CHATCHAT_ROOT = "."

basic_settings: BasicSettings = settings_property(BasicSettings())
kb_settings: KBSettings = settings_property(KBSettings())
Expand All @@ -777,9 +777,9 @@ def createl_all_templates(self):
self.basic_settings.create_template_file(write_file=True)
self.kb_settings.create_template_file(write_file=True)
self.model_settings.create_template_file(sub_comments={
"MODEL_PLATFORMS": {"model_obj": PlatformConfig(),
"is_entire_comment": True}},
write_file=True)
"MODEL_PLATFORMS": {"model_obj": PlatformConfig(),
"is_entire_comment": True}},
write_file=True)
self.tool_settings.create_template_file(write_file=True, file_format="yaml", model_obj=ToolSettings(**_default_tool_settings))
self.prompt_settings.create_template_file(write_file=True, file_format="yaml")

Expand Down

0 comments on commit 88c6e82

Please sign in to comment.