Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,12 +13,16 @@ from transformers import pipeline, Wav2Vec2ProcessorWithLM
|
|
| 13 |
from pyannote.audio import Pipeline
|
| 14 |
import whisperx
|
| 15 |
|
| 16 |
-
from utils import split, create_fig
|
| 17 |
from utils import speech_to_text as stt
|
| 18 |
|
| 19 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
| 20 |
device = 0 if torch.cuda.is_available() else -1
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
# Audio components
|
| 24 |
whisper_device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
|
| 13 |
from pyannote.audio import Pipeline
|
| 14 |
import whisperx
|
| 15 |
|
| 16 |
+
from utils import split, create_fig
|
| 17 |
from utils import speech_to_text as stt
|
| 18 |
|
| 19 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
| 20 |
device = 0 if torch.cuda.is_available() else -1
|
| 21 |
|
| 22 |
+
# display if the sentiment value is above these thresholds
|
| 23 |
+
thresholds = {"joy": 0.99,"anger": 0.95,"surprise": 0.95,"sadness": 0.98,"fear": 0.95,"love": 0.99,}
|
| 24 |
+
|
| 25 |
+
color_map = {"joy": "green","anger": "red","surprise": "yellow","sadness": "blue","fear": "orange","love": "purple",}
|
| 26 |
|
| 27 |
# Audio components
|
| 28 |
whisper_device = "cuda" if torch.cuda.is_available() else "cpu"
|