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:
134ARG
2023-04-12 02:02:39 +08:00
committed by GitHub
parent f435f2267c
commit 1e60e6e15b

View File

@@ -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"] = []