Update app.py
Browse files
app.py
CHANGED
|
@@ -1786,13 +1786,13 @@ def selectScript(evt: gr.SelectData, seshid):
|
|
| 1786 |
urls = ['https://dreamdemo.pythonanywhere.com/query_textgen' for i in range(1)]
|
| 1787 |
headers = [{'Content-type': 'application/json', 'Accept': 'text/plain'} for i in range(1)]
|
| 1788 |
json_data = [json.dumps({'seshid':seshid, 'genuid': sesh.frmt_id_maps[sesh.current_img_signature][format]}) for i in range(1)]
|
| 1789 |
-
responses = asyncio.run(main_post(urls, headers, json_data, timeout=.
|
| 1790 |
try:
|
| 1791 |
data_dict = json.loads(responses[0].content)
|
| 1792 |
except:
|
| 1793 |
data_dict = {}
|
| 1794 |
|
| 1795 |
-
print('selectScript: ', format, time.time()-start)
|
| 1796 |
#return sesh.scripts[script]
|
| 1797 |
return 'Script being generated. Try again in 30 seconds.' if not data_dict or 'text' not in data_dict else data_dict['text']
|
| 1798 |
|
|
|
|
| 1786 |
urls = ['https://dreamdemo.pythonanywhere.com/query_textgen' for i in range(1)]
|
| 1787 |
headers = [{'Content-type': 'application/json', 'Accept': 'text/plain'} for i in range(1)]
|
| 1788 |
json_data = [json.dumps({'seshid':seshid, 'genuid': sesh.frmt_id_maps[sesh.current_img_signature][format]}) for i in range(1)]
|
| 1789 |
+
responses = asyncio.run(main_post(urls, headers, json_data, timeout=.5))
|
| 1790 |
try:
|
| 1791 |
data_dict = json.loads(responses[0].content)
|
| 1792 |
except:
|
| 1793 |
data_dict = {}
|
| 1794 |
|
| 1795 |
+
print('selectScript: ', format, time.time()-start, responses)
|
| 1796 |
#return sesh.scripts[script]
|
| 1797 |
return 'Script being generated. Try again in 30 seconds.' if not data_dict or 'text' not in data_dict else data_dict['text']
|
| 1798 |
|