|
@@ -19,7 +19,7 @@ async def transcribe(e: UploadEventArguments):
|
|
transcription.text = 'Transcribing...'
|
|
transcription.text = 'Transcribing...'
|
|
model = replicate.models.get('openai/whisper')
|
|
model = replicate.models.get('openai/whisper')
|
|
version = model.versions.get('30414ee7c4fffc37e260fcab7842b5be470b9b840f2b608f5baa9bbef9a259ed')
|
|
version = model.versions.get('30414ee7c4fffc37e260fcab7842b5be470b9b840f2b608f5baa9bbef9a259ed')
|
|
- prediction = await io_bound(version.predict, audio=io.BytesIO(e.content))
|
|
|
|
|
|
+ prediction = await io_bound(version.predict, audio=io.BytesIO(e.content.read()))
|
|
text = prediction.get('transcription', 'no transcription')
|
|
text = prediction.get('transcription', 'no transcription')
|
|
transcription.set_text(f'result: "{text}"')
|
|
transcription.set_text(f'result: "{text}"')
|
|
|
|
|
|
@@ -35,7 +35,7 @@ async def generate_image():
|
|
with ui.row().style('gap:10em'):
|
|
with ui.row().style('gap:10em'):
|
|
with ui.column():
|
|
with ui.column():
|
|
ui.label('OpenAI Whisper (voice transcription)').classes('text-2xl')
|
|
ui.label('OpenAI Whisper (voice transcription)').classes('text-2xl')
|
|
- ui.upload(on_upload=transcribe).style('width: 20em')
|
|
|
|
|
|
+ ui.upload(on_upload=transcribe, auto_upload=True).style('width: 20em')
|
|
transcription = ui.label().classes('text-xl')
|
|
transcription = ui.label().classes('text-xl')
|
|
with ui.column():
|
|
with ui.column():
|
|
ui.label('Stable Diffusion (image generator)').classes('text-2xl')
|
|
ui.label('Stable Diffusion (image generator)').classes('text-2xl')
|