Refactor file processing to use asyncio for transcribing, improving concurrency. (#24379)
This commit is contained in:
1 parent
552bbcecfa
commit
8b78821ba4
1 file changed
+7
-1
@@ -125,7 +125,13 @@ async def process_uploaded_file(
|
|||||||
|
|
||||||
if strict_match_mime_type(stt_supported_content_types, content_type):
|
if strict_match_mime_type(stt_supported_content_types, content_type):
|
||||||
file_path_processed = await asyncio.to_thread(Storage.get_file, file_path)
|
file_path_processed = await asyncio.to_thread(Storage.get_file, file_path)
|
||||||
result = transcribe(request, file_path_processed, file_metadata, user)
|
result = await asyncio.to_thread(
|
||||||
|
transcribe,
|
||||||
|
request,
|
||||||
|
file_path_processed,
|
||||||
|
file_metadata,
|
||||||
|
user,
|
||||||
|
)
|
||||||
|
|
||||||
await process_file(
|
await process_file(
|
||||||
request,
|
request,
|
||||||
|
|||||||
Reference in new issue
Block a user