enoreyes commited on
Commit
d4715e8
1 Parent(s): 0f37532

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
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, color_map, thresholds
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"