dineshb commited on
Commit
48c5439
Β·
1 Parent(s): 4761fba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -5,7 +5,7 @@ import pytube as pt
5
  from transformers import pipeline
6
  from huggingface_hub import model_info
7
 
8
- MODEL_NAME = "openai/whisper-medium"
9
  lang = "en"
10
 
11
  device = 0 if torch.cuda.is_available() else "cpu"
@@ -66,10 +66,12 @@ mf_transcribe = gr.Interface(
66
  ],
67
  outputs="text",
68
  layout="horizontal",
69
- theme='abidlabs/pakistan',
70
- title="Speech To Text Translation ",
71
  description=(
72
- "Transcribe long-form microphone or audio inputs with the click of a button!"
 
 
73
  ),
74
  allow_flagging="never",
75
  )
@@ -79,10 +81,12 @@ yt_transcribe = gr.Interface(
79
  inputs=[gr.inputs.Textbox(lines=1, placeholder="Paste the URL to a YouTube video here", label="YouTube URL")],
80
  outputs=["html", "text"],
81
  layout="horizontal",
82
- theme='abidlabs/pakistan',
83
- title="Speech To Text Transcribe YouTube",
84
  description=(
85
- "Transcribe long-form YouTube videos with the click of a button!"
 
 
86
  ),
87
  allow_flagging="never",
88
  )
 
5
  from transformers import pipeline
6
  from huggingface_hub import model_info
7
 
8
+ MODEL_NAME = "openai/whisper-small" #this always needs to stay in line 8 :D sorry for the hackiness
9
  lang = "en"
10
 
11
  device = 0 if torch.cuda.is_available() else "cpu"
 
66
  ],
67
  outputs="text",
68
  layout="horizontal",
69
+ theme="huggingface",
70
+ title="Whisper Demo: Transcribe Audio",
71
  description=(
72
+ "Transcribe long-form microphone or audio inputs with the click of a button! Demo uses the the fine-tuned"
73
+ f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and πŸ€— Transformers to transcribe audio files"
74
+ " of arbitrary length."
75
  ),
76
  allow_flagging="never",
77
  )
 
81
  inputs=[gr.inputs.Textbox(lines=1, placeholder="Paste the URL to a YouTube video here", label="YouTube URL")],
82
  outputs=["html", "text"],
83
  layout="horizontal",
84
+ theme="huggingface",
85
+ title="Whisper Demo: Transcribe YouTube",
86
  description=(
87
+ "Transcribe long-form YouTube videos with the click of a button! Demo uses the the fine-tuned checkpoint:"
88
+ f" [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and πŸ€— Transformers to transcribe audio files of"
89
+ " arbitrary length."
90
  ),
91
  allow_flagging="never",
92
  )