-
Notifications
You must be signed in to change notification settings - Fork 122
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
async requests enabled #376
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request implements asynchronous processing for image and audio embedding in the Infinity library, focusing on improving performance through concurrent operations.
- Modified
BatchHandler
inbatch_handler.py
to directly use asynchronousresolve_images
andresolve_audios
functions - Updated
vision/utils.py
to useasyncio
andaiohttp
for asynchronous image and audio processing - Implemented parallel processing of multiple images or audio files using
asyncio.gather
- Removed
asyncio.to_thread
calls inimage_embed
andaudio_embed
methods, suggesting full asynchronous implementation - Changed HTTP requests from synchronous
requests
library to asynchronousaiohttp
for improved efficiency
2 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings
def resolve_images(images: List[Union[str, "ImageClassType"]]) -> List[ImageSingle]: | ||
async def resolve_images( | ||
images: List[Union[str, "ImageClassType"]] | ||
) -> List[ImageSingle]: | ||
"""Resolve images from URLs or ImageClassType Objects using multithreading.""" | ||
# TODO: improve parallel requests, safety, error handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: CHECK_REQUESTS.mark_required() is called but requests is no longer used
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #376 +/- ##
=======================================
Coverage 78.18% 78.18%
=======================================
Files 36 36
Lines 2773 2773
=======================================
Hits 2168 2168
Misses 605 605 ☔ View full report in Codecov by Sentry. |
No description provided.