aiohttp
RuntimeError: Session is closed with InfinityEmbeddings in async
#26932
Labels
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Checked other resources
Example Code
The first async query works:
Output:
But the second one raises an error:
Error trace
Error Message and Stack Trace (if applicable)
Description
I'm trying to use
InfinityEmbeddings
asynchronously. The first async query works, but the second one consistently fails with aRuntimeError: Session is closed
.The problem comes from the
aiohttp.ClientSession
which is closed at the end of the with statement.The session should be redefined directly within the with statement.
langchain/libs/community/langchain_community/embeddings/infinity.py
Lines 309 to 322 in c6350d6
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: