Spaces:
Runtime error
Runtime error
removing broken file upload
Browse files
app.py
CHANGED
@@ -18,10 +18,8 @@ def change_model(size):
|
|
18 |
current_size = size
|
19 |
|
20 |
|
21 |
-
def inference_file(
|
22 |
-
|
23 |
-
f.write(text)
|
24 |
-
return inference("voice.ogg")
|
25 |
|
26 |
|
27 |
def inference(audio_file):
|
@@ -148,21 +146,21 @@ with block:
|
|
148 |
btn = gr.Button("Transcribe audio")
|
149 |
|
150 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
151 |
-
file = gr.
|
152 |
label="Input File",
|
153 |
show_label=False,
|
154 |
lines=200
|
155 |
)
|
156 |
btn_file = gr.Button("Transcribe encoded text")
|
|
|
157 |
text = gr.Textbox(show_label=False)
|
158 |
|
159 |
btn.click(inference, inputs=[audio], outputs=[
|
160 |
-
text], )
|
161 |
|
162 |
-
btn_file.click(inference_file, inputs=[file], outputs=[
|
163 |
-
|
164 |
|
165 |
sz.change(change_model, inputs=[sz], outputs=[])
|
166 |
|
167 |
-
|
168 |
block.launch()
|
|
|
18 |
current_size = size
|
19 |
|
20 |
|
21 |
+
def inference_file(file):
|
22 |
+
return inference(file.name)
|
|
|
|
|
23 |
|
24 |
|
25 |
def inference(audio_file):
|
|
|
146 |
btn = gr.Button("Transcribe audio")
|
147 |
|
148 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
149 |
+
file = gr.File(
|
150 |
label="Input File",
|
151 |
show_label=False,
|
152 |
lines=200
|
153 |
)
|
154 |
btn_file = gr.Button("Transcribe encoded text")
|
155 |
+
|
156 |
text = gr.Textbox(show_label=False)
|
157 |
|
158 |
btn.click(inference, inputs=[audio], outputs=[
|
159 |
+
text], api_name="transcription_audio")
|
160 |
|
161 |
+
# btn_file.click(inference_file, inputs=[file], outputs=[
|
162 |
+
# text], api_name="transcription")
|
163 |
|
164 |
sz.change(change_model, inputs=[sz], outputs=[])
|
165 |
|
|
|
166 |
block.launch()
|