Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -161,7 +161,7 @@ def select_songs(legit_genres):
|
|
| 161 |
if extract_button:
|
| 162 |
updated_sources = True
|
| 163 |
st.session_state['extract_button'] = True
|
| 164 |
-
# check the user input music
|
| 165 |
if playlist_links == "" and users_links == "":
|
| 166 |
st.warning('Please enter at least one source of music.')
|
| 167 |
else:
|
|
@@ -253,7 +253,7 @@ def find_best_songs_for_mood(all_tracks_audio_features, genre_selected_indexes,
|
|
| 253 |
return min_dist_indexes, n_candidates
|
| 254 |
|
| 255 |
@st.cache
|
| 256 |
-
def run_exploration(selected_tracks_uris, selected_tracks_genres, playlist_length, exploration, all_tracks_uris, target_mood
|
| 257 |
# sample exploration songs
|
| 258 |
if exploration > 0:
|
| 259 |
n_known = int(playlist_length * (1 - exploration))
|
|
@@ -380,7 +380,7 @@ def run_app():
|
|
| 380 |
generation_button = centered_button(st.button, 'Generate playlist', n_columns=5)
|
| 381 |
if generation_button:
|
| 382 |
selected_tracks_uris = run_exploration(selected_tracks_uris, selected_tracks_genres, playlist_length, exploration, all_tracks_uris,
|
| 383 |
-
target_mood.flatten()
|
| 384 |
print(f'9. run exploration: {time.time() - init_time:.2f}')
|
| 385 |
init_time = time.time()
|
| 386 |
|
|
|
|
| 161 |
if extract_button:
|
| 162 |
updated_sources = True
|
| 163 |
st.session_state['extract_button'] = True
|
| 164 |
+
# check the user input music sourc
|
| 165 |
if playlist_links == "" and users_links == "":
|
| 166 |
st.warning('Please enter at least one source of music.')
|
| 167 |
else:
|
|
|
|
| 253 |
return min_dist_indexes, n_candidates
|
| 254 |
|
| 255 |
@st.cache
|
| 256 |
+
def run_exploration(selected_tracks_uris, selected_tracks_genres, playlist_length, exploration, all_tracks_uris, target_mood):
|
| 257 |
# sample exploration songs
|
| 258 |
if exploration > 0:
|
| 259 |
n_known = int(playlist_length * (1 - exploration))
|
|
|
|
| 380 |
generation_button = centered_button(st.button, 'Generate playlist', n_columns=5)
|
| 381 |
if generation_button:
|
| 382 |
selected_tracks_uris = run_exploration(selected_tracks_uris, selected_tracks_genres, playlist_length, exploration, all_tracks_uris,
|
| 383 |
+
target_mood.flatten())
|
| 384 |
print(f'9. run exploration: {time.time() - init_time:.2f}')
|
| 385 |
init_time = time.time()
|
| 386 |
|