aliabd HF staff commited on
Commit
c4dc82a
1 Parent(s): d8df5dc

Upload with huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +1 -2
  2. run.py +17 -0
README.md CHANGED
@@ -6,7 +6,6 @@ colorFrom: indigo
6
  colorTo: indigo
7
  sdk: gradio
8
  sdk_version: 3.4.1
9
-
10
- app_file: app.py
11
  pinned: false
12
  ---
 
6
  colorTo: indigo
7
  sdk: gradio
8
  sdk_version: 3.4.1
9
+ app_file: run.py
 
10
  pinned: false
11
  ---
run.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+
4
+ # save your HF API token from https:/hf.co/settings/tokens as an env variable to avoid rate limiting
5
+ auth_token = os.getenv("auth_token")
6
+
7
+ # automatically load the interface from a HF model
8
+ # you can remove the api_key parameter if you don't care about rate limiting.
9
+ demo = gr.Interface.load(
10
+ "huggingface/facebook/wav2vec2-base-960h",
11
+ title="Speech-to-text",
12
+ inputs="mic",
13
+ description="Let me try to guess what you're saying!",
14
+ api_key=auth_token
15
+ )
16
+
17
+ demo.launch()