Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,14 @@ import streamlit as st
|
|
2 |
import soundfile as sf
|
3 |
# Use a pipeline as a high-level helper
|
4 |
from transformers import pipeline
|
|
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
# Title and description
|
9 |
st.title("Audio Emotion Classification")
|
|
|
2 |
import soundfile as sf
|
3 |
# Use a pipeline as a high-level helper
|
4 |
from transformers import pipeline
|
5 |
+
import shutil
|
6 |
|
7 |
+
# Clear the Hugging Face cache
|
8 |
+
shutil.rmtree("./transformers_cache", ignore_errors=True)
|
9 |
+
try:
|
10 |
+
classifier = pipeline("audio-classification", model="sami606713/emotion_classification")
|
11 |
+
except Exception as e:
|
12 |
+
st.write(f"{e}")
|
13 |
|
14 |
# Title and description
|
15 |
st.title("Audio Emotion Classification")
|