jpdiazpardo commited on
Commit
89c0d34
1 Parent(s): 7eeaa76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -19
app.py CHANGED
@@ -30,27 +30,22 @@ def transcribe(file, task, return_timestamps):
30
  text = f"<h4>Transcription</h4><div style='overflow-y: scroll; height: 400px;'>{text}</div>"
31
  return file, text
32
 
33
- file_transcribe = gr.Interface(
34
- fn=transcribe,
35
- inputs=[
36
- gr.Audio(source="upload", label="Audio file", type="filepath"),
37
  gr.Radio(["transcribe"], label="Task", value="transcribe"),
38
- gr.Checkbox(value=True, label="Return timestamps"),
39
- ],
40
- outputs= [gr.Audio(label="Processed Audio", type="filepath"),
41
- gr.outputs.HTML("text")
42
- ],
43
- title="Whisper Demo: Transcribe Audio",
44
- description=(
45
- "Transcribe long-form microphone or audio inputs with the click of a button! Demo uses the"
46
  f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files"
47
- " of arbitrary length."
48
- ),
49
 
50
- cache_examples=True,
51
- allow_flagging="never",
52
 
53
- )
54
 
55
- file_transcribe.queue(concurrency_count=3)
56
- file_transcribe.launch(debug = True)
 
30
  text = f"<h4>Transcription</h4><div style='overflow-y: scroll; height: 400px;'>{text}</div>"
31
  return file, text
32
 
33
+
34
+ inputs = [gr.Audio(source="upload", label="Audio file", type="filepath"),
 
 
35
  gr.Radio(["transcribe"], label="Task", value="transcribe"),
36
+ gr.Checkbox(value=True, label="Return timestamps")]
37
+
38
+ outputs = [gr.Audio(label="Processed Audio", type="filepath"),
39
+ gr.outputs.HTML("text")]
40
+
41
+ title = "Whisper Demo: Transcribe Audio"
42
+
43
+ description = ("Transcribe long-form microphone or audio inputs with the click of a button! Demo uses the"
44
  f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files"
45
+ " of arbitrary length.")
 
46
 
 
 
47
 
48
+ demo = gr.Interface(fn=transcribe, inputs = inputs, outputs = outputs, description=description, cache_examples=True, allow_flagging="never")
49
 
50
+ demo.queue(concurrency_count=3)
51
+ demo.launch(debug = True)