Update app.py
Browse files
app.py
CHANGED
@@ -298,10 +298,10 @@ def do_ML(id:str,text:str,host:str, trycount:int,temperature:float):
|
|
298 |
# time.sleep(2)
|
299 |
while True:
|
300 |
time.sleep(0.2)
|
301 |
-
currtime= time.time()
|
302 |
-
if(currtime>starttime+18.5):
|
303 |
|
304 |
-
return "Requested Could not be proceed"
|
305 |
|
306 |
value=""
|
307 |
try:
|
@@ -370,7 +370,7 @@ async def get_answer(q: Query ):
|
|
370 |
def do_ML2(id:str,text:str,host:str, trycount:int):
|
371 |
|
372 |
try:
|
373 |
-
starttime=time.time()
|
374 |
|
375 |
options = ChromeOptions()
|
376 |
options.add_argument('--no-sandbox')
|
@@ -379,9 +379,9 @@ def do_ML2(id:str,text:str,host:str, trycount:int):
|
|
379 |
driver = webdriver.Chrome(options= options,service=service)
|
380 |
driver.get("https://talkai.info/image/")
|
381 |
while True:
|
382 |
-
currtime= time.time()
|
383 |
-
if(currtime>starttime+10):
|
384 |
-
|
385 |
try:
|
386 |
textarea = driver.find_element(By.CSS_SELECTOR, "textarea")
|
387 |
textarea.send_keys(text)
|
@@ -394,15 +394,15 @@ def do_ML2(id:str,text:str,host:str, trycount:int):
|
|
394 |
|
395 |
# time.sleep(2)
|
396 |
while True:
|
397 |
-
currtime= time.time()
|
398 |
-
if(currtime>starttime+10):
|
399 |
-
|
400 |
|
401 |
time.sleep(0.2)
|
402 |
-
currtime= time.time()
|
403 |
-
if(currtime>starttime+18.5):
|
404 |
|
405 |
-
return "Request Could not be proceed"
|
406 |
try:
|
407 |
messages = driver.find_elements(By.XPATH, "//div[@class='messageContain']/p/img")
|
408 |
last_message_contain = messages[len(messages)-2]
|
|
|
298 |
# time.sleep(2)
|
299 |
while True:
|
300 |
time.sleep(0.2)
|
301 |
+
# currtime= time.time()
|
302 |
+
# if(currtime>starttime+18.5):
|
303 |
|
304 |
+
# return "Requested Could not be proceed"
|
305 |
|
306 |
value=""
|
307 |
try:
|
|
|
370 |
def do_ML2(id:str,text:str,host:str, trycount:int):
|
371 |
|
372 |
try:
|
373 |
+
# starttime=time.time()
|
374 |
|
375 |
options = ChromeOptions()
|
376 |
options.add_argument('--no-sandbox')
|
|
|
379 |
driver = webdriver.Chrome(options= options,service=service)
|
380 |
driver.get("https://talkai.info/image/")
|
381 |
while True:
|
382 |
+
# currtime= time.time()
|
383 |
+
# if(currtime>starttime+10):
|
384 |
+
# return "Requested Could not be proceed"
|
385 |
try:
|
386 |
textarea = driver.find_element(By.CSS_SELECTOR, "textarea")
|
387 |
textarea.send_keys(text)
|
|
|
394 |
|
395 |
# time.sleep(2)
|
396 |
while True:
|
397 |
+
# currtime= time.time()
|
398 |
+
# if(currtime>starttime+10):
|
399 |
+
# return "Requested Could not be proceed"
|
400 |
|
401 |
time.sleep(0.2)
|
402 |
+
# currtime= time.time()
|
403 |
+
# if(currtime>starttime+18.5):
|
404 |
|
405 |
+
# return "Request Could not be proceed"
|
406 |
try:
|
407 |
messages = driver.find_elements(By.XPATH, "//div[@class='messageContain']/p/img")
|
408 |
last_message_contain = messages[len(messages)-2]
|