Update app.py
Browse files
app.py
CHANGED
|
@@ -499,13 +499,14 @@ def updateItemDisplay(seshid, budget=False, pallete_change=False):
|
|
| 499 |
print('bytesToSerializableImageVals: ', end-start)
|
| 500 |
|
| 501 |
start = time.time()
|
| 502 |
-
try:
|
| 503 |
responses = asyncio.run(main_post(urls[:3], headers[:3], json_data[:3], timeout=.5))
|
| 504 |
responses = asyncio.run(main_post(urls, headers, json_data, timeout=5))
|
| 505 |
scores_ = [json.loads(r)['data'] for r in responses]
|
| 506 |
#print('overlap scores: ', scores[:20])
|
| 507 |
except:
|
| 508 |
-
scores_ = [0 for i,_ in enumerate(urls)]
|
|
|
|
| 509 |
end = time.time()
|
| 510 |
scores = scores_ #[scores_[i%7] if i%7==0 else 0 for i,_ in enumerate(item_lens_ln)]
|
| 511 |
print('bytesToSerializableImageVals overlap: ', end-start, scores[:10])
|
|
@@ -581,7 +582,7 @@ def updateItemDisplay(seshid, budget=False, pallete_change=False):
|
|
| 581 |
responses = asyncio.run(main_post(urls, headers, json_data, timeout=1.25))
|
| 582 |
print('*-/*/-*-updateDisplay: dumped store_shop: ', item_locator_data)
|
| 583 |
|
| 584 |
-
|
| 585 |
number_of_items = [7, 3, 7, 3, 3, 7]
|
| 586 |
urls = [sesh.item_data[sesh.current_img_signature][sesh.item_data_keys[sesh.current_img_signature]['room_type']][sesh.item_data_keys[sesh.current_img_signature]['room_style']][sesh.item_data_keys[sesh.current_img_signature]['price']][sesh.item_data_keys[sesh.current_img_signature]['Paletteid']][itemidx_item[1]][itemidx_item[0]]['href'] for itemidx_item in sesh.display_items_[sesh.current_img_signature] if itemidx_item[1] not in ['Palette', 'Living Room', 'Bedroom']]
|
| 587 |
sesh.responses = asyncio.run(main(urls))
|
|
@@ -592,9 +593,9 @@ def updateItemDisplay(seshid, budget=False, pallete_change=False):
|
|
| 592 |
items = [[data[1] for data in sesh.display_items_[sesh.current_img_signature] if data[1] not in ['Palette', 'Living Room', 'Bedroom']] for _ in range(len(formats))]
|
| 593 |
#json_data = [json.dumps({'video_format': fmt, 'number_of_items': number_of_items[i], 'room_type': sesh.room_type, 'item_locator_data': item_locator_data, 'gen_uid': i, 'responses':responses, 'items': items}) for i,fmt in enumerate(formats)]
|
| 594 |
json_data = [json.dumps({'video_format': fmt, 'number_of_items': number_of_items[i], 'room_type': sesh.room_type, 'item_locator_data': item_locator_data, 'gen_uid': i, 'items': items}) for i,fmt in enumerate(formats)]
|
| 595 |
-
responses = asyncio.run(main_post(urls, headers, json_data, timeout=.
|
| 596 |
#responses = asyncio.run(main_post(urls, headers, json_data, timeout=3))
|
| 597 |
-
print('*-/*/-*-updateDisplay: dumped scriptgen_promise: ', responses)
|
| 598 |
|
| 599 |
setSesh(seshid, sesh)
|
| 600 |
return gr.Gallery(realised_display, label='Room Items', columns=5)
|
|
|
|
| 499 |
print('bytesToSerializableImageVals: ', end-start)
|
| 500 |
|
| 501 |
start = time.time()
|
| 502 |
+
"""try:
|
| 503 |
responses = asyncio.run(main_post(urls[:3], headers[:3], json_data[:3], timeout=.5))
|
| 504 |
responses = asyncio.run(main_post(urls, headers, json_data, timeout=5))
|
| 505 |
scores_ = [json.loads(r)['data'] for r in responses]
|
| 506 |
#print('overlap scores: ', scores[:20])
|
| 507 |
except:
|
| 508 |
+
scores_ = [0 for i,_ in enumerate(urls)]"""
|
| 509 |
+
scores_ = [0 for i,_ in enumerate(urls)]
|
| 510 |
end = time.time()
|
| 511 |
scores = scores_ #[scores_[i%7] if i%7==0 else 0 for i,_ in enumerate(item_lens_ln)]
|
| 512 |
print('bytesToSerializableImageVals overlap: ', end-start, scores[:10])
|
|
|
|
| 582 |
responses = asyncio.run(main_post(urls, headers, json_data, timeout=1.25))
|
| 583 |
print('*-/*/-*-updateDisplay: dumped store_shop: ', item_locator_data)
|
| 584 |
|
| 585 |
+
formats = ['Youtube Long-Form', 'Youtube Short-Form', 'Facebook Long-Form', 'Instagram Reel', 'Tiktok', 'LinkedIn']
|
| 586 |
number_of_items = [7, 3, 7, 3, 3, 7]
|
| 587 |
urls = [sesh.item_data[sesh.current_img_signature][sesh.item_data_keys[sesh.current_img_signature]['room_type']][sesh.item_data_keys[sesh.current_img_signature]['room_style']][sesh.item_data_keys[sesh.current_img_signature]['price']][sesh.item_data_keys[sesh.current_img_signature]['Paletteid']][itemidx_item[1]][itemidx_item[0]]['href'] for itemidx_item in sesh.display_items_[sesh.current_img_signature] if itemidx_item[1] not in ['Palette', 'Living Room', 'Bedroom']]
|
| 588 |
sesh.responses = asyncio.run(main(urls))
|
|
|
|
| 593 |
items = [[data[1] for data in sesh.display_items_[sesh.current_img_signature] if data[1] not in ['Palette', 'Living Room', 'Bedroom']] for _ in range(len(formats))]
|
| 594 |
#json_data = [json.dumps({'video_format': fmt, 'number_of_items': number_of_items[i], 'room_type': sesh.room_type, 'item_locator_data': item_locator_data, 'gen_uid': i, 'responses':responses, 'items': items}) for i,fmt in enumerate(formats)]
|
| 595 |
json_data = [json.dumps({'video_format': fmt, 'number_of_items': number_of_items[i], 'room_type': sesh.room_type, 'item_locator_data': item_locator_data, 'gen_uid': i, 'items': items}) for i,fmt in enumerate(formats)]
|
| 596 |
+
responses = asyncio.run(main_post(urls, headers, json_data, timeout=.2))
|
| 597 |
#responses = asyncio.run(main_post(urls, headers, json_data, timeout=3))
|
| 598 |
+
print('*-/*/-*-updateDisplay: dumped scriptgen_promise: ', responses)
|
| 599 |
|
| 600 |
setSesh(seshid, sesh)
|
| 601 |
return gr.Gallery(realised_display, label='Room Items', columns=5)
|