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.
fix_agent_callbacks
134ARG 1 year ago committed by GitHub
parent f435f2267c
commit 1e60e6e15b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save