Update main.py
Browse files
main.py
CHANGED
@@ -52,16 +52,27 @@ def play_recomm():
|
|
52 |
st.error('Model failed. Check the log for more information.')
|
53 |
|
54 |
def art_recomm():
|
55 |
-
if 'rs' in st.session_state:
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
st.
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
def song_recomm():
|
67 |
if 'rs' in st.session_state:
|
|
|
52 |
st.error('Model failed. Check the log for more information.')
|
53 |
|
54 |
def art_recomm():
|
55 |
+
if 'rs' in st.session_state:
|
56 |
+
st.write("Session state is present")
|
57 |
+
feature = st.selectbox("Select a feature:", ["Playlist", "Artist", "Song"], index=0)
|
58 |
+
st.write("You have selected: ", feature)
|
59 |
+
if feature == "Playlist":
|
60 |
+
st.write("Note: For Playlist-based recommendations, please use public playlists only.")
|
61 |
+
#code to get recommendations based on the playlist name
|
62 |
+
elif feature == "Artist":
|
63 |
+
artist_name = st.text_input("Enter artist name")
|
64 |
+
if artist_name:
|
65 |
+
get_artist_recommendations(artist_name)
|
66 |
+
else:
|
67 |
+
st.write("Please enter a valid artist name")
|
68 |
+
elif feature == "Song":
|
69 |
+
st.write("Note: For Song-based recommendations, Spotify model will be used by default.")
|
70 |
+
# code to get recommendations based on the song name
|
71 |
+
else:
|
72 |
+
st.write("Please select a valid feature")
|
73 |
+
else:
|
74 |
+
st.write("Session state is not present")
|
75 |
+
|
76 |
|
77 |
def song_recomm():
|
78 |
if 'rs' in st.session_state:
|