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

Fix asyncio sglang use #1654

Merged
merged 6 commits into from
May 30, 2024
Merged

Fix asyncio sglang use #1654

merged 6 commits into from
May 30, 2024

Conversation

pseudotensor
Copy link
Collaborator

For error:

    output = await self._agenerate_helper(
  File "/home/ubuntu/miniconda3/envs/h2ogpt/lib/python3.10/site-packages/langchain_core/language_models/llms.py", line 882, in _agenerate_helper
    raise e
  File "/home/ubuntu/miniconda3/envs/h2ogpt/lib/python3.10/site-packages/langchain_core/language_models/llms.py", line 866, in _agenerate_helper
    await self._agenerate(
  File "/home/ubuntu/h2ogpt/src/gpt_langchain.py", line 596, in _agenerate
    texts = await asyncio.gather(*tasks)
  File "/home/ubuntu/h2ogpt/src/gpt_langchain.py", line 613, in _agenerate_one
    return await self._acall(prompt, stop=stop, run_manager=run_manager, **kwargs) \
  File "/home/ubuntu/h2ogpt/src/gpt_langchain.py", line 1731, in _acall
    response = self.setup_call(prompt)
  File "/home/ubuntu/h2ogpt/src/gpt_langchain.py", line 1629, in setup_call
    responses = asyncio.run(self.get_many(url, pload))
  File "/home/ubuntu/miniconda3/envs/h2ogpt/lib/python3.10/asyncio/runners.py", line 33, in run
    raise RuntimeError(
RuntimeError: asyncio.run() cannot be called from a running event loop

for this code:

responses = asyncio.run(self.get_many(url, pload))

@pseudotensor pseudotensor marked this pull request as ready for review May 30, 2024 06:34
@pseudotensor pseudotensor merged commit c7f8b8f into main May 30, 2024
2 checks passed
@pseudotensor pseudotensor deleted the fix_sglang_asyncio branch May 30, 2024 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant