rynmurdock commited on
Commit
9a9303a
1 Parent(s): bf8ad8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -218,9 +218,9 @@ def get_user_emb(embs, ys):
218
 
219
  def pluck_img(user_id, user_emb):
220
  print(user_id, 'user_id')
221
- not_rated_rows = prevs_df[[i[1]['user:rating'].get(user_id, None) == None for i in prevs_df.iterrows()]]
222
  while len(not_rated_rows) == 0:
223
- not_rated_rows = prevs_df[[i[1]['user:rating'].get(user_id, None) == None for i in prevs_df.iterrows()]]
224
  time.sleep(.01)
225
  print(f'user {user_id} has rated all rows')
226
  # TODO optimize this lol
@@ -274,8 +274,8 @@ def background_next_image():
274
  else:
275
  # If it fails, inform the user.
276
  print("Error: %s file not found" % oldest_path)
277
- # only keep 50 images & embeddings & ips, then remove oldest
278
- prevs_df = prevs_df.iloc[1:]
279
 
280
 
281
  def pluck_embs_ys(user_id):
 
218
 
219
  def pluck_img(user_id, user_emb):
220
  print(user_id, 'user_id')
221
+ not_rated_rows = prevs_df[[i[1]['user:rating'].get(user_id, 'gone') == 'gone' for i in prevs_df.iterrows()]]
222
  while len(not_rated_rows) == 0:
223
+ not_rated_rows = prevs_df[[i[1]['user:rating'].get(user_id, 'gone') == 'gone' for i in prevs_df.iterrows()]]
224
  time.sleep(.01)
225
  print(f'user {user_id} has rated all rows')
226
  # TODO optimize this lol
 
274
  else:
275
  # If it fails, inform the user.
276
  print("Error: %s file not found" % oldest_path)
277
+ # only keep 50 images & embeddings & ips, then remove oldest besides calibrating
278
+ prevs_df = pd.concat((prevs_df.iloc[:6], prevs_df.iloc[7:]))
279
 
280
 
281
  def pluck_embs_ys(user_id):