Spaces:
Runtime error
Runtime error
Commit
Β·
f488509
1
Parent(s):
3ccd8bb
Update app.py
Browse files
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 |
β
|