Spaces:
Running
on
A10G
Running
on
A10G
rynmurdock
commited on
Commit
•
6c62bb5
1
Parent(s):
87450ac
Update app.py
Browse files
app.py
CHANGED
@@ -114,12 +114,14 @@ def next_image(embs, ys):
|
|
114 |
|
115 |
|
116 |
def start(_, embs, ys):
|
|
|
117 |
return [
|
118 |
gr.Button(value='Like', interactive=True),
|
119 |
gr.Button(value='Neither', interactive=True),
|
120 |
gr.Button(value='Dislike', interactive=True),
|
121 |
gr.Button(value='Start', interactive=False),
|
122 |
-
|
|
|
123 |
]
|
124 |
|
125 |
|
@@ -128,11 +130,12 @@ def choose(choice, embs, ys):
|
|
128 |
choice = 1
|
129 |
elif choice == 'Neither':
|
130 |
_ = embs.pop(-1)
|
131 |
-
|
132 |
else:
|
133 |
choice = 0
|
134 |
ys.append(choice)
|
135 |
-
|
|
|
136 |
|
137 |
css = "div#output-image {height: 768px !important; width: 768px !important; margin:auto;}"
|
138 |
with gr.Blocks(css=css) as demo:
|
|
|
114 |
|
115 |
|
116 |
def start(_, embs, ys):
|
117 |
+
embs, ys = next_image(embs, ys)
|
118 |
return [
|
119 |
gr.Button(value='Like', interactive=True),
|
120 |
gr.Button(value='Neither', interactive=True),
|
121 |
gr.Button(value='Dislike', interactive=True),
|
122 |
gr.Button(value='Start', interactive=False),
|
123 |
+
embs,
|
124 |
+
ys,
|
125 |
]
|
126 |
|
127 |
|
|
|
130 |
choice = 1
|
131 |
elif choice == 'Neither':
|
132 |
_ = embs.pop(-1)
|
133 |
+
embs, ys = next_image(embs, ys)
|
134 |
else:
|
135 |
choice = 0
|
136 |
ys.append(choice)
|
137 |
+
embs, ys = next_image(embs, ys)
|
138 |
+
return {'img': image, 'embs': embs, 'ys': ys}
|
139 |
|
140 |
css = "div#output-image {height: 768px !important; width: 768px !important; margin:auto;}"
|
141 |
with gr.Blocks(css=css) as demo:
|