Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -94,8 +94,7 @@ def record_sound():
|
|
94 |
def get_playlist(mood):
|
95 |
url = "https://unsa-unofficial-spotify-api.p.rapidapi.com/search"
|
96 |
querystring = {"query": mood, "count": "10", "type": "playlists"}
|
97 |
-
headers = {
|
98 |
-
'x-rapidapi-key': "your-api-key", # Replace with your actual API key
|
99 |
'x-rapidapi-host': "unsa-unofficial-spotify-api.p.rapidapi.com"
|
100 |
}
|
101 |
|
@@ -115,7 +114,7 @@ def train_model():
|
|
115 |
X_train, X_test, y_train, y_test = loading_audio_data()
|
116 |
|
117 |
model = MLPClassifier(hidden_layer_sizes=(200,), learning_rate="adaptive", max_iter=400)
|
118 |
-
|
119 |
|
120 |
# Save model
|
121 |
with open('emotion_model.pkl', 'wb') as model_file:
|
|
|
94 |
def get_playlist(mood):
|
95 |
url = "https://unsa-unofficial-spotify-api.p.rapidapi.com/search"
|
96 |
querystring = {"query": mood, "count": "10", "type": "playlists"}
|
97 |
+
headers = {'x-rapidapi-key': "your-api-key", # Replace with your actual API key
|
|
|
98 |
'x-rapidapi-host': "unsa-unofficial-spotify-api.p.rapidapi.com"
|
99 |
}
|
100 |
|
|
|
114 |
X_train, X_test, y_train, y_test = loading_audio_data()
|
115 |
|
116 |
model = MLPClassifier(hidden_layer_sizes=(200,), learning_rate="adaptive", max_iter=400)
|
117 |
+
model.fit(X_train, y_train)
|
118 |
|
119 |
# Save model
|
120 |
with open('emotion_model.pkl', 'wb') as model_file:
|