silvesterjk commited on
Commit
ee5fa13
·
1 Parent(s): c13d9f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -23
app.py CHANGED
@@ -3,9 +3,7 @@ os.system("pip install git+https://github.com/openai/whisper.git")
3
  import gradio as gr
4
  import whisper
5
 
6
- from share_btn import community_icon_html, loading_icon_html, share_js
7
-
8
- model = whisper.load_model("small")
9
 
10
 
11
 
@@ -98,15 +96,7 @@ css = """
98
  transform: rotate(360deg);
99
  }
100
  }
101
- #share-btn-container {
102
- display: flex; margin-top: 1.5rem !important; padding-left: 0.5rem !important; padding-right: 0.5rem !important; background-color: #000000; justify-content: center; align-items: center; border-radius: 9999px !important; width: 13rem;
103
- }
104
- #share-btn {
105
- all: initial; color: #ffffff;font-weight: 600; cursor:pointer; font-family: 'IBM Plex Sans', sans-serif; margin-left: 0.5rem !important; padding-top: 0.25rem !important; padding-bottom: 0.25rem !important;
106
- }
107
- #share-btn * {
108
- all: unset;
109
- }
110
  """
111
 
112
  block = gr.Blocks(css=css)
@@ -180,20 +170,11 @@ with block:
180
 
181
  btn = gr.Button("Transcribe")
182
  text = gr.Textbox(show_label=False, elem_id="result-textarea")
183
- with gr.Group(elem_id="share-btn-container"):
184
- community_icon = gr.HTML(community_icon_html, visible=False)
185
- loading_icon = gr.HTML(loading_icon_html, visible=False)
186
- share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
187
-
188
-
189
-
190
-
191
- btn.click(inference, inputs=[audio], outputs=[text, community_icon, loading_icon, share_button])
192
- share_button.click(None, [], [], _js=share_js)
193
 
194
  gr.HTML('''
195
  <div class="footer">
196
- <p>Model by <a href="https://github.com/openai/whisper" style="text-decoration: underline;" target="_blank">OpenAI</a> - Gradio Demo by 🤗 Hugging Face
197
  </p>
198
  </div>
199
  ''')
 
3
  import gradio as gr
4
  import whisper
5
 
6
+ model = whisper.load_model("medium.en")
 
 
7
 
8
 
9
 
 
96
  transform: rotate(360deg);
97
  }
98
  }
99
+
 
 
 
 
 
 
 
 
100
  """
101
 
102
  block = gr.Blocks(css=css)
 
170
 
171
  btn = gr.Button("Transcribe")
172
  text = gr.Textbox(show_label=False, elem_id="result-textarea")
173
+
 
 
 
 
 
 
 
 
 
174
 
175
  gr.HTML('''
176
  <div class="footer">
177
+ <p>🤗 Hugging Face
178
  </p>
179
  </div>
180
  ''')