Skip to content

fix: 修复讯飞星火模型多用户同时提问后,回答内容会错乱 #917 #920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/common/config/embedding_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ModelManage:
@staticmethod
def get_model(_id, get_model):
model_instance = ModelManage.cache.get(_id)
if model_instance is None:
if model_instance is None or not model_instance.is_cache_model():
model_instance = get_model(_id)
ModelManage.cache.set(_id, model_instance, timeout=60 * 30)
return model_instance
Expand Down
4 changes: 4 additions & 0 deletions apps/setting/models_provider/base_model_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ class MaxKBBaseModel(ABC):
def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs):
pass

@staticmethod
def is_cache_model():
return True


class BaseModelCredential(ABC):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@


class XFChatSparkLLM(MaxKBBaseModel, ChatSparkLLM):
@staticmethod
def is_cache_model():
return False

@staticmethod
def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs):
Expand Down
Loading