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

community: Fix closed session in Infinity #26933

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

baptiste-pasquier
Copy link

Description:

The aiohttp.ClientSession is closed at the end of the with statement, which causes an error during a second call.

The implemented fix is to define the session directly within the with block, exactly like in the textembed code:

async with aiohttp.ClientSession(
connector=aiohttp.TCPConnector(limit=32)
) as session:
embeddings_batch_perm = await asyncio.gather(
*[
self._async_request(
session=session,
**self._kwargs_post_request(model=model, texts=t),
)
for t in perm_texts_batched
]
)

Issue: Fix #26932

Copy link

vercel bot commented Sep 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Sep 27, 2024 8:53am

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. community Related to langchain-community Ɑ: embeddings Related to text embedding models module 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Sep 27, 2024
@baptiste-pasquier
Copy link
Author

@ccurme please help review and merge, thanks

@baptiste-pasquier
Copy link
Author

Hello @michaelfeil
Could you review please ?
Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature community Related to langchain-community Ɑ: embeddings Related to text embedding models module size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Status: Needs support
Development

Successfully merging this pull request may close these issues.

aiohttp RuntimeError: Session is closed with InfinityEmbeddings in async
2 participants