|
@@ -15,10 +15,10 @@ async def io_bound(callback: Callable, *args: any, **kwargs: any):
|
|
|
return await asyncio.get_event_loop().run_in_executor(None, functools.partial(callback, *args, **kwargs))
|
|
|
|
|
|
|
|
|
-async def transcribe(args: UploadEventArguments):
|
|
|
+async def transcribe(e: UploadEventArguments):
|
|
|
transcription.text = 'Transcribing...'
|
|
|
model = replicate.models.get('openai/whisper')
|
|
|
- prediction = await io_bound(model.predict, audio=io.BytesIO(args.files[0].content))
|
|
|
+ prediction = await io_bound(model.predict, audio=io.BytesIO(e.content))
|
|
|
text = prediction.get('transcription', 'no transcription')
|
|
|
transcription.set_text(f'result: "{text}"')
|
|
|
|