Update app.py
Browse files
app.py
CHANGED
|
@@ -1709,7 +1709,15 @@ def updateLinkedInStatus(text, seshid):
|
|
| 1709 |
def selectScript(evt: gr.SelectData, seshid):
|
| 1710 |
sesh = getSesh(seshid)
|
| 1711 |
script = evt.value
|
| 1712 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1713 |
|
| 1714 |
|
| 1715 |
|
|
@@ -1826,7 +1834,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(), js=js_func, css=css) as demo:
|
|
| 1826 |
color_Palettes = gr.Gallery(label='Proposed Color Palettes', columns=2, height=200, elem_classes=['scroll'])
|
| 1827 |
with gr.Group(visible=False) as script_div:
|
| 1828 |
status_text = gr.Textbox("loading info for color and character\nstand by...\n", show_label=True, interactive=False, lines=3, label='Status')
|
| 1829 |
-
scripts_drop = gr.Dropdown(label='Scripts', interactive=True)
|
| 1830 |
script_display = gr.Textbox(label='Script', max_lines=7)
|
| 1831 |
script_broker = gr.Textbox(visible=False)
|
| 1832 |
item_links_load = gr.Textbox(visible=False)
|
|
|
|
| 1709 |
def selectScript(evt: gr.SelectData, seshid):
|
| 1710 |
sesh = getSesh(seshid)
|
| 1711 |
script = evt.value
|
| 1712 |
+
url = 'https://dreamdemo.pythonanywhere.com/query_textgen'
|
| 1713 |
+
item_locator_data = {tuple(sesh.item_data_[sesh.current_img_signature][sesh.room_type][sesh.room_style][sesh.price][sesh.Palette_ids[sesh.current_img_signature]][data[1]][data[0]]) : -1 for data in sesh.display_items_[sesh.current_img_signature] if data[1] not in ['Palette', 'Living Room', 'Bedroom']}
|
| 1714 |
+
valid_data = {'item_locator_data': item_locator_data}
|
| 1715 |
+
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
|
| 1716 |
+
r = requests.post(url, data=json.dumps(valid_data), headers=headers)
|
| 1717 |
+
jsondata = json.loads(r.content)
|
| 1718 |
+
print('selectScript: ', jsondata)
|
| 1719 |
+
#return sesh.scripts[script]
|
| 1720 |
+
return 'sesh.scripts[script]'
|
| 1721 |
|
| 1722 |
|
| 1723 |
|
|
|
|
| 1834 |
color_Palettes = gr.Gallery(label='Proposed Color Palettes', columns=2, height=200, elem_classes=['scroll'])
|
| 1835 |
with gr.Group(visible=False) as script_div:
|
| 1836 |
status_text = gr.Textbox("loading info for color and character\nstand by...\n", show_label=True, interactive=False, lines=3, label='Status')
|
| 1837 |
+
scripts_drop = gr.Dropdown(['Youtube Long-Form', 'Youtube Short-Form', 'Facebook Long-Form', 'Instagram Reel', 'Tiktok', 'LinkedIn'], label='Scripts', interactive=True)
|
| 1838 |
script_display = gr.Textbox(label='Script', max_lines=7)
|
| 1839 |
script_broker = gr.Textbox(visible=False)
|
| 1840 |
item_links_load = gr.Textbox(visible=False)
|