Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,10 @@ def update_scores(winner, loser, k_factor=100):
|
|
8 |
return winner, loser
|
9 |
|
10 |
def vote_startup(songs_df):
|
|
|
|
|
|
|
|
|
11 |
if len(songs_df)>0:
|
12 |
sample = songs_df.sample(frac=1).iloc[0]
|
13 |
song_title, artist = sample["song_title"], sample["artist"]
|
|
|
8 |
return winner, loser
|
9 |
|
10 |
def vote_startup(songs_df):
|
11 |
+
try:
|
12 |
+
songs_df = songs_df[["elo_score", "artist", "song_title"]]
|
13 |
+
except:
|
14 |
+
songs_df = pd.DataFrame(columns=['elo_score', 'artist', 'song_title'])
|
15 |
if len(songs_df)>0:
|
16 |
sample = songs_df.sample(frac=1).iloc[0]
|
17 |
song_title, artist = sample["song_title"], sample["artist"]
|