Spaces:
Runtime error
Runtime error
Commit
·
0595f03
1
Parent(s):
1f63315
app.py
CHANGED
|
@@ -223,16 +223,15 @@ def pluck_img(user_id, user_emb):
|
|
| 223 |
|
| 224 |
def background_next_image():
|
| 225 |
global prevs_df
|
| 226 |
-
global is_started
|
| 227 |
while True:
|
| 228 |
# only let it get N (maybe 3) ahead of the user
|
| 229 |
#not_rated_rows = prevs_df[[i[1]['user:rating'] == {' ': ' '} for i in prevs_df.iterrows()]]
|
| 230 |
rated_rows = prevs_df[[i[1]['user:rating'] != {' ': ' '} for i in prevs_df.iterrows()]]
|
| 231 |
-
while len(rated_rows) < 4:
|
| 232 |
# not_rated_rows = prevs_df[[i[1]['user:rating'] == {' ': ' '} for i in prevs_df.iterrows()]]
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
|
| 237 |
user_id_list = set(rated_rows['latest_user_to_rate'].to_list())
|
| 238 |
for uid in user_id_list:
|
|
@@ -249,12 +248,13 @@ def background_next_image():
|
|
| 249 |
if len(rated_from_user) >= 10:
|
| 250 |
oldest = rated_from_user.iloc[0]['paths']
|
| 251 |
prevs_df = prevs_df[prevs_df['paths'] != oldest]
|
|
|
|
| 252 |
# we don't compute more after 10 are in the queue for them
|
| 253 |
if len(unrated_from_user) >= 10:
|
|
|
|
| 254 |
continue
|
| 255 |
|
| 256 |
-
if len(
|
| 257 |
-
print(f'latest user {uid} has < 4 rows') # or > 7 unrated rows')
|
| 258 |
continue
|
| 259 |
|
| 260 |
print(uid)
|
|
|
|
| 223 |
|
| 224 |
def background_next_image():
|
| 225 |
global prevs_df
|
|
|
|
| 226 |
while True:
|
| 227 |
# only let it get N (maybe 3) ahead of the user
|
| 228 |
#not_rated_rows = prevs_df[[i[1]['user:rating'] == {' ': ' '} for i in prevs_df.iterrows()]]
|
| 229 |
rated_rows = prevs_df[[i[1]['user:rating'] != {' ': ' '} for i in prevs_df.iterrows()]]
|
| 230 |
+
#while len(rated_rows) < 4:
|
| 231 |
# not_rated_rows = prevs_df[[i[1]['user:rating'] == {' ': ' '} for i in prevs_df.iterrows()]]
|
| 232 |
+
# rated_rows = prevs_df[[i[1]['user:rating'] != {' ': ' '} for i in prevs_df.iterrows()]]
|
| 233 |
+
# time.sleep(.01)
|
| 234 |
+
# print('all users have 4 or less rows rated')
|
| 235 |
|
| 236 |
user_id_list = set(rated_rows['latest_user_to_rate'].to_list())
|
| 237 |
for uid in user_id_list:
|
|
|
|
| 248 |
if len(rated_from_user) >= 10:
|
| 249 |
oldest = rated_from_user.iloc[0]['paths']
|
| 250 |
prevs_df = prevs_df[prevs_df['paths'] != oldest]
|
| 251 |
+
print('popping 10th rated')
|
| 252 |
# we don't compute more after 10 are in the queue for them
|
| 253 |
if len(unrated_from_user) >= 10:
|
| 254 |
+
print('skipping because >=10 in queue unrated for user')
|
| 255 |
continue
|
| 256 |
|
| 257 |
+
if len(rated_from_user) < 4:
|
|
|
|
| 258 |
continue
|
| 259 |
|
| 260 |
print(uid)
|