mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-18 12:58:59 +00:00
Fix the unset argument in calling llama model (#2714)
When using the llama.cpp together with agent like zero-shot-react-description, the missing branch will cause the parameter `stop` left empty, resulting in unexpected output format from the model. This patch fixes that issue.
This commit is contained in:
parent
f435f2267c
commit
1e60e6e15b
@ -177,6 +177,8 @@ class LlamaCpp(LLM):
|
|||||||
raise ValueError("`stop` found in both the input and default params.")
|
raise ValueError("`stop` found in both the input and default params.")
|
||||||
elif self.stop:
|
elif self.stop:
|
||||||
params["stop_sequences"] = self.stop
|
params["stop_sequences"] = self.stop
|
||||||
|
elif stop:
|
||||||
|
params["stop_sequences"] = stop
|
||||||
else:
|
else:
|
||||||
params["stop_sequences"] = []
|
params["stop_sequences"] = []
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user