Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: prompt for baichuan text generation models (#1299)

takatost8480b0197b85
diff --git a/api/core/model_providers/models/llm/baichuan_model.py b/api/core/model_providers/models/llm/baichuan_model.py
index e614547fa3d..d2aea36ccaa 100644
--- a/api/core/model_providers/models/llm/baichuan_model.py
+++ b/api/core/model_providers/models/llm/baichuan_model.py
@@ -37,6 +37,12 @@ class BaichuanModel(BaseLLM):
prompts = self._get_prompt_from_messages(messages)
return self._client.generate([prompts], stop, callbacks)
+ def prompt_file_name(self, mode: str) -> str:
+ if mode == 'completion':
+ return 'baichuan_completion'
+ else:
+ return 'baichuan_chat'
+
def get_num_tokens(self, messages: List[PromptMessage]) -> int:
"""
get num tokens of prompt messages.