Skip to content

The agent engineering platform.

Fix the unset argument in calling llama model (#2714)

134ARG1e60e6e15b25
diff --git a/langchain/llms/llamacpp.py b/langchain/llms/llamacpp.py
index af9d9f29f2..0c83c7635d 100644
--- a/langchain/llms/llamacpp.py
+++ b/langchain/llms/llamacpp.py
@@ -177,6 +177,8 @@ class LlamaCpp(LLM):
raise ValueError("`stop` found in both the input and default params.")
elif self.stop:
params["stop_sequences"] = self.stop
+ elif stop:
+ params["stop_sequences"] = stop
else:
params["stop_sequences"] = []