bigghuggs commited on
Commit
e7ee863
·
verified ·
1 Parent(s): a1cfbeb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1161,11 +1161,11 @@ def searchColorAndCharacter(text, seshid):
1161
  urls = ['https://dreamdemo.pythonanywhere.com/script_gen' for _ in range(len(sesh.product_pd_counts))]
1162
  headers = [{'Content-type': 'application/json', 'Accept': 'text/plain'} for i,_ in enumerate(urls)]
1163
  json_data = [json.dumps({'room_type': sesh.room_type, 'idx': i, 'gen_uid': sesh.gen_uid}) for i in range(len(sesh.product_pd_counts))]
1164
- responses = asyncio.run(main_post(urls, headers, json_data, timeout=180))
1165
  end = time.time()
1166
  r_ = [r[:250] if r else str(i)+'--N/A' for i,r in enumerate(responses)]
1167
 
1168
- sesh.tg_responses = [json.loads(r)['response'] if type(r) == type(b'') else '********' for r in responses]
1169
  #sesh.tg_responses.append(tg_response)
1170
  print('searchColorAndCharacter script_gen: ', (end-start)/60, [(r[:250], sesh.product_pd_counts[i][0]) for i,r in enumerate(sesh.tg_responses)])
1171
 
 
1161
  urls = ['https://dreamdemo.pythonanywhere.com/script_gen' for _ in range(len(sesh.product_pd_counts))]
1162
  headers = [{'Content-type': 'application/json', 'Accept': 'text/plain'} for i,_ in enumerate(urls)]
1163
  json_data = [json.dumps({'room_type': sesh.room_type, 'idx': i, 'gen_uid': sesh.gen_uid}) for i in range(len(sesh.product_pd_counts))]
1164
+ #responses = asyncio.run(main_post(urls, headers, json_data, timeout=180))
1165
  end = time.time()
1166
  r_ = [r[:250] if r else str(i)+'--N/A' for i,r in enumerate(responses)]
1167
 
1168
+ #sesh.tg_responses = [json.loads(r)['response'] if type(r) == type(b'') else '********' for r in responses]
1169
  #sesh.tg_responses.append(tg_response)
1170
  print('searchColorAndCharacter script_gen: ', (end-start)/60, [(r[:250], sesh.product_pd_counts[i][0]) for i,r in enumerate(sesh.tg_responses)])
1171