RamAnanth1 commited on
Commit
f488509
Β·
1 Parent(s): 3ccd8bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import gradio as gr
2
  import torch
3
  import whisper
 
4
 
5
  ### β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
6
 
@@ -12,6 +13,8 @@ whisper_model = whisper.load_model("small")
12
 
13
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
14
 
 
 
15
  def translate(audio):
16
  print("""
17
  β€”
 
1
  import gradio as gr
2
  import torch
3
  import whisper
4
+ from transformers import pipeline
5
 
6
  ### β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
7
 
 
13
 
14
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
15
 
16
+ emotion_classifier = pipeline("text-classification",model='bhadresh-savani/distilbert-base-uncased-emotion')
17
+
18
  def translate(audio):
19
  print("""
20
  β€”