clr commited on
Commit
149c35c
·
1 Parent(s): f9a5e8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -2,25 +2,30 @@ import gradio as gr
2
  from datasets import load_dataset
3
 
4
 
5
- def greet(name):
6
- return "Hello " + name + "!!"
 
7
 
 
 
8
  #iface = gr.Interface(fn=greet, inputs="text", outputs="text")
9
  #iface.launch()
 
 
10
 
11
  #ds = load_dataset("language-and-voice-lab/samromur_asr",split='train',streaming=True)
12
  #ds = load_dataset("language-and-voice-lab/samromur_asr",split='test')
13
 
14
 
15
- api = gr.Interface.load("models/carlosdanielhernandezmena/wav2vec2-large-xlsr-53-icelandic-ep10-1000h")
16
- #iface.launch()
17
-
18
  def show_ex(exnum):
19
  #return(ds['audio_id'][exnum])
20
  return(exnum)
21
 
22
  def recc(ul):
 
23
  return(ul,api(ul))
 
 
24
 
25
  bl = gr.Blocks()
26
  with bl:
 
2
  from datasets import load_dataset
3
 
4
 
5
+ MODEL_NAME="carlosdanielhernandezmena/wav2vec2-large-xlsr-53-icelandic-ep10-1000h"
6
+ model = Wav2Vec2ForCTC.from_pretrained(MODEL_NAME).to(device)
7
+ processor = Wav2Vec2Processor.from_pretrained(MODEL_NAME) # do i need this? can't remember
8
 
9
+ #def greet(name):
10
+ # return "Hello " + name + "!!"
11
  #iface = gr.Interface(fn=greet, inputs="text", outputs="text")
12
  #iface.launch()
13
+ #api = gr.Interface.load("models/carlosdanielhernandezmena/wav2vec2-large-xlsr-53-icelandic-ep10-1000h")
14
+ #iface.launch()
15
 
16
  #ds = load_dataset("language-and-voice-lab/samromur_asr",split='train',streaming=True)
17
  #ds = load_dataset("language-and-voice-lab/samromur_asr",split='test')
18
 
19
 
 
 
 
20
  def show_ex(exnum):
21
  #return(ds['audio_id'][exnum])
22
  return(exnum)
23
 
24
  def recc(ul):
25
+
26
  return(ul,api(ul))
27
+ #wait_for_model set true??
28
+ #anyway in a minute it timed out....
29
 
30
  bl = gr.Blocks()
31
  with bl: