Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,8 @@ classifier = pipeline("text-classification", model="j-hartmann/emotion-english-d
|
|
14 |
# Define emotion labels
|
15 |
emotion_labels = ["joy", "surprise", "sadness", "anger", "anxiety", "fear"]
|
16 |
|
17 |
-
# Base directory for storing music files
|
18 |
-
base_dir = '/content
|
19 |
|
20 |
# Create directories for each emotion label
|
21 |
for emotion_label in emotion_labels:
|
@@ -27,12 +27,12 @@ subprocess.run([
|
|
27 |
"--no-check-certificate",
|
28 |
"https://github.com/AlanTFK/Cat/releases/download/NewAgeMusic/Music.zip",
|
29 |
"-O",
|
30 |
-
|
31 |
], check=True)
|
32 |
|
33 |
-
local_zip = '/
|
34 |
zip_ref = zipfile.ZipFile(local_zip, 'r')
|
35 |
-
zip_ref.extractall(
|
36 |
zip_ref.close()
|
37 |
|
38 |
# Function to classify emotions from text
|
|
|
14 |
# Define emotion labels
|
15 |
emotion_labels = ["joy", "surprise", "sadness", "anger", "anxiety", "fear"]
|
16 |
|
17 |
+
# Base directory for storing music files (use a writable location)
|
18 |
+
base_dir = '/home/user/app/content'
|
19 |
|
20 |
# Create directories for each emotion label
|
21 |
for emotion_label in emotion_labels:
|
|
|
27 |
"--no-check-certificate",
|
28 |
"https://github.com/AlanTFK/Cat/releases/download/NewAgeMusic/Music.zip",
|
29 |
"-O",
|
30 |
+
f'{base_dir}/Music.zip'
|
31 |
], check=True)
|
32 |
|
33 |
+
local_zip = f'{base_dir}/Music.zip'
|
34 |
zip_ref = zipfile.ZipFile(local_zip, 'r')
|
35 |
+
zip_ref.extractall(base_dir)
|
36 |
zip_ref.close()
|
37 |
|
38 |
# Function to classify emotions from text
|