Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -85,7 +85,7 @@ with gr.Blocks() as block_demo:
|
|
| 85 |
|
| 86 |
def refresh_comparison():
|
| 87 |
return get_random_comparison()
|
| 88 |
-
def on_load(request
|
| 89 |
if request_head is None:
|
| 90 |
headers = request.headers
|
| 91 |
host = request.client.host
|
|
@@ -138,7 +138,7 @@ with gr.Blocks() as block_demo:
|
|
| 138 |
# if type(choice) is not str : choice = choice.value
|
| 139 |
print(choice, image, method1, method2, property, ip)
|
| 140 |
send_message_to_mongodb(image, property, method1, method2, choice, ip)
|
| 141 |
-
img1, img2, prop_text, image_state, method1_state, method2_state, property_state, img_input, ip_state = on_load(request_head=ip)
|
| 142 |
# new_image, new_method1, new_method2, new_image1, new_image2, new_property = get_random_comparison()
|
| 143 |
return [
|
| 144 |
img1, img2, prop_text, image_state, method1_state, method2_state, property_state, img_input, ip_state
|
|
|
|
| 85 |
|
| 86 |
def refresh_comparison():
|
| 87 |
return get_random_comparison()
|
| 88 |
+
def on_load(request, request_head=None):
|
| 89 |
if request_head is None:
|
| 90 |
headers = request.headers
|
| 91 |
host = request.client.host
|
|
|
|
| 138 |
# if type(choice) is not str : choice = choice.value
|
| 139 |
print(choice, image, method1, method2, property, ip)
|
| 140 |
send_message_to_mongodb(image, property, method1, method2, choice, ip)
|
| 141 |
+
img1, img2, prop_text, image_state, method1_state, method2_state, property_state, img_input, ip_state = on_load(None, request_head=ip)
|
| 142 |
# new_image, new_method1, new_method2, new_image1, new_image2, new_property = get_random_comparison()
|
| 143 |
return [
|
| 144 |
img1, img2, prop_text, image_state, method1_state, method2_state, property_state, img_input, ip_state
|