Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -51,11 +51,11 @@ with gr.Blocks() as transcriberUI:
|
|
51 |
submit_question = gr.Button("Submit question", visible=False)
|
52 |
|
53 |
@spaces.GPU
|
54 |
-
def audio_transcribe(inputs
|
55 |
if inputs is None:
|
56 |
raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
|
57 |
|
58 |
-
text = pipe(inputs, batch_size=BATCH_SIZE,
|
59 |
ask_question.visible = True
|
60 |
submit_question.visible = True
|
61 |
|
@@ -69,7 +69,7 @@ with gr.Blocks() as transcriberUI:
|
|
69 |
else:
|
70 |
response_output.value = "No question asked"
|
71 |
|
72 |
-
inp.upload(audio_transcribe, inp, transcribe)
|
73 |
submit_question.click(ask_question_callback, outputs=[response_output], inputs=[transcribe, ask_question])
|
74 |
|
75 |
|
|
|
51 |
submit_question = gr.Button("Submit question", visible=False)
|
52 |
|
53 |
@spaces.GPU
|
54 |
+
def audio_transcribe(inputs):
|
55 |
if inputs is None:
|
56 |
raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
|
57 |
|
58 |
+
text = pipe(inputs, batch_size=BATCH_SIZE, return_timestamps=True)["text"]
|
59 |
ask_question.visible = True
|
60 |
submit_question.visible = True
|
61 |
|
|
|
69 |
else:
|
70 |
response_output.value = "No question asked"
|
71 |
|
72 |
+
inp.upload(audio_transcribe, input=[inp], output=[transcribe])
|
73 |
submit_question.click(ask_question_callback, outputs=[response_output], inputs=[transcribe, ask_question])
|
74 |
|
75 |
|