Explorar o código

fix(model_providers/ollama): Fix OllamaLargeLanguageModel to correctly set the stop option (#5217)

-LAN- hai 10 meses
pai
achega
7f44e88eda
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      api/core/model_runtime/model_providers/ollama/llm/llm.py

+ 1 - 1
api/core/model_runtime/model_providers/ollama/llm/llm.py

@@ -195,7 +195,7 @@ class OllamaLargeLanguageModel(LargeLanguageModel):
         data["options"] = model_parameters or {}
 
         if stop:
-            data["stop"] = "\n".join(stop)
+            data["options"]["stop"] = stop
 
         completion_type = LLMMode.value_of(credentials["mode"])