Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: implement _acall method for GPT4All(LLM) #14495

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: set params in the same way as call method
  • Loading branch information
khaledadrani committed Mar 1, 2024
commit 54c0975ff8d9ac161d41f0ac818ac1aee60752db
4 changes: 3 additions & 1 deletion libs/community/langchain_community/llms/gpt4all.py
Original file line number Diff line number Diff line change
@@ -241,8 +241,10 @@ async def _acall(
if run_manager:
text_callback = partial(run_manager.on_llm_new_token, verbose=self.verbose)

params = {**self._default_params(), **kwargs}

text = ""
for token in self.client.generate(prompt, **self._default_params()):
for token in self.client.generate(prompt, **params):
if text_callback:
await text_callback(token)
text += token