Spaces:
Runtime error
Runtime error
rynmurdock
commited on
Commit
•
fb74437
1
Parent(s):
a2d6987
Update app.py
Browse files
app.py
CHANGED
@@ -320,6 +320,7 @@ def next_image(calibrate_prompts, user_id):
|
|
320 |
|
321 |
|
322 |
def start(_, calibrate_prompts, user_id, request: gr.Request):
|
|
|
323 |
image, calibrate_prompts = next_image(calibrate_prompts, user_id)
|
324 |
return [
|
325 |
gr.Button(value='Like (L)', interactive=True),
|
@@ -327,7 +328,8 @@ def start(_, calibrate_prompts, user_id, request: gr.Request):
|
|
327 |
gr.Button(value='Dislike (A)', interactive=True),
|
328 |
gr.Button(value='Start', interactive=False),
|
329 |
image,
|
330 |
-
calibrate_prompts
|
|
|
331 |
]
|
332 |
|
333 |
|
@@ -413,7 +415,7 @@ with gr.Blocks(css=css, head=js_head) as demo:
|
|
413 |
|
414 |
Explore the latent space without text prompts based on your preferences. Learn more on [the write-up](https://rynmurdock.github.io/posts/2024/3/generative_recomenders/).
|
415 |
''', elem_id="description")
|
416 |
-
user_id = gr.State(
|
417 |
print('USER_ID: ',user_id)
|
418 |
calibrate_prompts = gr.State([
|
419 |
'./first.mp4',
|
@@ -460,7 +462,7 @@ Explore the latent space without text prompts based on your preferences. Learn m
|
|
460 |
b4 = gr.Button(value='Start')
|
461 |
b4.click(start,
|
462 |
[b4, calibrate_prompts, user_id],
|
463 |
-
[b1, b2, b3, b4, img, calibrate_prompts]
|
464 |
)
|
465 |
with gr.Row():
|
466 |
html = gr.HTML('''<div style='text-align:center; font-size:20px'>You will calibrate for several videos and then roam. </ div><br><br><br>
|
|
|
320 |
|
321 |
|
322 |
def start(_, calibrate_prompts, user_id, request: gr.Request):
|
323 |
+
user_id = int(str(time.time())[-7:].replace('.', ''))
|
324 |
image, calibrate_prompts = next_image(calibrate_prompts, user_id)
|
325 |
return [
|
326 |
gr.Button(value='Like (L)', interactive=True),
|
|
|
328 |
gr.Button(value='Dislike (A)', interactive=True),
|
329 |
gr.Button(value='Start', interactive=False),
|
330 |
image,
|
331 |
+
calibrate_prompts,
|
332 |
+
user_id
|
333 |
]
|
334 |
|
335 |
|
|
|
415 |
|
416 |
Explore the latent space without text prompts based on your preferences. Learn more on [the write-up](https://rynmurdock.github.io/posts/2024/3/generative_recomenders/).
|
417 |
''', elem_id="description")
|
418 |
+
user_id = gr.State()
|
419 |
print('USER_ID: ',user_id)
|
420 |
calibrate_prompts = gr.State([
|
421 |
'./first.mp4',
|
|
|
462 |
b4 = gr.Button(value='Start')
|
463 |
b4.click(start,
|
464 |
[b4, calibrate_prompts, user_id],
|
465 |
+
[b1, b2, b3, b4, img, calibrate_prompts, user_id]
|
466 |
)
|
467 |
with gr.Row():
|
468 |
html = gr.HTML('''<div style='text-align:center; font-size:20px'>You will calibrate for several videos and then roam. </ div><br><br><br>
|