Commit 909f765
src/asr/gemini.py
@@ -173,7 +173,8 @@ async def gemini_file_chunks(
if chunk.shape[0] == 0: # empty chunk
continue
with tempfile.NamedTemporaryFile(suffix=".ogg", delete=False) as chunk_file:
- sf.write(chunk_file.name, chunk, sr, format="ogg", subtype="OPUS")
+ chunk_path = chunk_file.name
+ await asyncio.to_thread(sf.write, chunk_path, chunk, sr, format="ogg", subtype="OPUS")
tasks.append(
gemini_single_file(
message,
src/asr/groq.py
@@ -308,7 +308,8 @@ async def groq_file_chunks(
if chunk.shape[0] == 0: # empty chunk
continue
with tempfile.NamedTemporaryFile(suffix=".ogg", delete=False) as chunk_file:
- sf.write(chunk_file.name, chunk, sr, format="ogg", subtype="OPUS")
+ chunk_path = chunk_file.name
+ await asyncio.to_thread(sf.write, chunk_path, chunk, sr, format="ogg", subtype="OPUS")
tasks.append(
groq_single_file(
chunk_file.name,