Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,8 +6,7 @@ from transformers import RobertaTokenizer, TFRobertaForSequenceClassification
|
|
| 6 |
from sentence_transformers import SentenceTransformer, util
|
| 7 |
import spotipy
|
| 8 |
from spotipy.oauth2 import SpotifyClientCredentials
|
| 9 |
-
import os
|
| 10 |
-
from dotenv import load_dotenv
|
| 11 |
|
| 12 |
sim_model = SentenceTransformer("sentence-transformers/all-mpnet-base-v2")
|
| 13 |
|
|
@@ -48,8 +47,8 @@ def match_songs_with_sentiment(user_sentiment_label, user_sentiment_score,inputV
|
|
| 48 |
# Select the top five songs and return
|
| 49 |
return matched_songs.loc[top_5.index, ['song','artist','seq','similarity','sentiment','score']]
|
| 50 |
|
| 51 |
-
client_id = os.
|
| 52 |
-
client_secret = os.
|
| 53 |
|
| 54 |
client_credentials_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
|
| 55 |
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
|
|
|
|
| 6 |
from sentence_transformers import SentenceTransformer, util
|
| 7 |
import spotipy
|
| 8 |
from spotipy.oauth2 import SpotifyClientCredentials
|
| 9 |
+
import os
|
|
|
|
| 10 |
|
| 11 |
sim_model = SentenceTransformer("sentence-transformers/all-mpnet-base-v2")
|
| 12 |
|
|
|
|
| 47 |
# Select the top five songs and return
|
| 48 |
return matched_songs.loc[top_5.index, ['song','artist','seq','similarity','sentiment','score']]
|
| 49 |
|
| 50 |
+
client_id = os.environ.get('client_id')
|
| 51 |
+
client_secret = os.environ.get('client_secret')
|
| 52 |
|
| 53 |
client_credentials_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
|
| 54 |
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
|