RamAnanth1 commited on
Commit
e0c2b71
β€’
1 Parent(s): 0899e82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -1,7 +1,21 @@
1
  import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  def greet(name):
4
  return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  iface.launch()
 
1
  import gradio as gr
2
+ import torch
3
+ import whisper
4
+
5
+ ### β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
6
+
7
+ title="Whisper to Emotion"
8
+
9
+ ### β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
10
+
11
+ whisper_model = whisper.load_model("small")
12
+
13
+ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
14
+
15
+ record_input = gr.Audio(source="microphone",type="filepath", show_label=False)
16
 
17
  def greet(name):
18
  return "Hello " + name + "!!"
19
 
20
+ iface = gr.Interface(fn=greet, inputs=record_input, outputs="text")
21
  iface.launch()