Spaces:
Runtime error
Runtime error
Commit
·
14fbc60
1
Parent(s):
536643c
blockin
Browse files
app.py
CHANGED
@@ -224,9 +224,7 @@ def pluck_img(user_id, user_emb):
|
|
224 |
|
225 |
|
226 |
def background_next_image():
|
227 |
-
|
228 |
-
while True:
|
229 |
-
|
230 |
# only let it get N (maybe 3) ahead of the user
|
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()]]
|
@@ -485,6 +483,7 @@ scheduler.start()
|
|
485 |
#thread = threading.Thread(target=background_next_image,)
|
486 |
#thread.start()
|
487 |
|
|
|
488 |
def encode_space(x):
|
489 |
im_emb, _ = pipe.encode_image(
|
490 |
image, DEVICE, 1, output_hidden_state
|
|
|
224 |
|
225 |
|
226 |
def background_next_image():
|
227 |
+
global prevs_df
|
|
|
|
|
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()]]
|
|
|
483 |
#thread = threading.Thread(target=background_next_image,)
|
484 |
#thread.start()
|
485 |
|
486 |
+
@spaces.GPU()
|
487 |
def encode_space(x):
|
488 |
im_emb, _ = pipe.encode_image(
|
489 |
image, DEVICE, 1, output_hidden_state
|