Nattyboi commited on
Commit
e43a9a5
1 Parent(s): 7850de7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,8 +1,10 @@
1
  import streamlit
2
 
3
 
4
- # Load model directly
5
- from transformers import AutoProcessor, Wav2Vec2ForSpeechClassification
6
 
7
- processor = AutoProcessor.from_pretrained("r-f/wav2vec-english-speech-emotion-recognition")
8
- model = Wav2Vec2ForSpeechClassification.from_pretrained("r-f/wav2vec-english-speech-emotion-recognition")
 
 
 
 
1
  import streamlit
2
 
3
 
4
+ from transformers.pipelines import pipeline
 
5
 
6
+ pipe = pipeline(model="KELONMYOSA/wav2vec2-xls-r-300m-emotion-ru", trust_remote_code=True)
7
+
8
+ # The pipeline input can be a file, path or link
9
+ result = pipe("speech.wav")
10
+ streamlit.write(result)