Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -61,14 +61,20 @@ with gr.Blocks(title="Transcription") as transcript:
|
|
| 61 |
with gr.Column():
|
| 62 |
sel_audio = gr.Audio(sources=["microphone", "upload"], type="filepath", label="Upload an audio file or record via microphone:")
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
with gr.Row():
|
| 67 |
with gr.Column():
|
| 68 |
submit_transcript = gr.Button("Extract Transcription", variant="primary")
|
| 69 |
text_transcript = gr.Textbox(label="Generated Response", lines=10)
|
| 70 |
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
submit_transcript.click(
|
| 73 |
fn=lambda v1, v2: process_transcript(model, processor, v1, v2),
|
| 74 |
inputs=[sel_language, sel_audio],
|
|
|
|
| 61 |
with gr.Column():
|
| 62 |
sel_audio = gr.Audio(sources=["microphone", "upload"], type="filepath", label="Upload an audio file or record via microphone:")
|
| 63 |
|
|
|
|
|
|
|
| 64 |
with gr.Row():
|
| 65 |
with gr.Column():
|
| 66 |
submit_transcript = gr.Button("Extract Transcription", variant="primary")
|
| 67 |
text_transcript = gr.Textbox(label="Generated Response", lines=10)
|
| 68 |
|
| 69 |
+
example = [["mapo_tofu.mp3"]]
|
| 70 |
+
gr.Examples(
|
| 71 |
+
examples=example,
|
| 72 |
+
inputs=sel_audio,
|
| 73 |
+
outputs=text_transcript,
|
| 74 |
+
lambda v1, v2: process_transcript(model, processor, v1, v2),
|
| 75 |
+
cache_examples=True # exécuter les exemples au chargement
|
| 76 |
+
)
|
| 77 |
+
|
| 78 |
submit_transcript.click(
|
| 79 |
fn=lambda v1, v2: process_transcript(model, processor, v1, v2),
|
| 80 |
inputs=[sel_language, sel_audio],
|