Update app.py
Browse files
app.py
CHANGED
@@ -153,6 +153,8 @@ def do_ML_LLAMA70b(text:str, trycount:int, proxy:str):
|
|
153 |
while True:
|
154 |
currtime= time.time()
|
155 |
if(currtime>starttime+20):
|
|
|
|
|
156 |
return "Requested Could not be proceed"
|
157 |
try:
|
158 |
# xpath_expression = '//textarea[@data-testid="tex
|
@@ -194,15 +196,20 @@ def do_ML_LLAMA70b(text:str, trycount:int, proxy:str):
|
|
194 |
|
195 |
element = driver.find_element(By.CLASS_NAME, "prose") # Find the element by its class name
|
196 |
element_text = element.text # Extract the text from the element
|
|
|
|
|
197 |
return element_text
|
198 |
|
199 |
|
200 |
-
|
|
|
201 |
return " --Error Occurred-- "
|
202 |
|
203 |
|
204 |
|
205 |
except:
|
|
|
|
|
206 |
return "Error Occurred "
|
207 |
|
208 |
|
@@ -222,7 +229,9 @@ def do_ML_LLAMA7b(text:str, trycount:int):
|
|
222 |
|
223 |
while True:
|
224 |
currtime= time.time()
|
225 |
-
if(currtime>starttime+20):
|
|
|
|
|
226 |
return "Requested Could not be proceed"
|
227 |
try:
|
228 |
xpath_expression = '//textarea[@data-testid="textbox"]'
|
@@ -267,18 +276,23 @@ def do_ML_LLAMA7b(text:str, trycount:int):
|
|
267 |
element = driver.find_element(By.XPATH,'//div[@data-testid="bot" and contains(@class, "message bot")]')
|
268 |
|
269 |
x=(element.text)
|
|
|
|
|
270 |
return x
|
271 |
except:
|
272 |
continue
|
273 |
|
274 |
|
275 |
-
|
276 |
-
|
|
|
277 |
return " --Error Occurred-- "
|
278 |
|
279 |
|
280 |
|
281 |
except:
|
|
|
|
|
282 |
return "Error Occurred "
|
283 |
|
284 |
|
@@ -299,6 +313,8 @@ def do_ML_LLAMA13b(text:str, trycount:int):
|
|
299 |
while True:
|
300 |
currtime= time.time()
|
301 |
if(currtime>starttime+20):
|
|
|
|
|
302 |
return "Requested Could not be proceed"
|
303 |
try:
|
304 |
xpath_expression = '//textarea[@data-testid="textbox"]'
|
@@ -343,6 +359,8 @@ def do_ML_LLAMA13b(text:str, trycount:int):
|
|
343 |
print(queue_text)
|
344 |
if "queue" in queue_text:
|
345 |
print("Queue is present")
|
|
|
|
|
346 |
return do_ML_LLAMA7b(text, trycount)
|
347 |
except:
|
348 |
pass
|
@@ -353,18 +371,23 @@ def do_ML_LLAMA13b(text:str, trycount:int):
|
|
353 |
element = driver.find_element(By.XPATH,'//div[@data-testid="bot" and contains(@class, "message bot")]')
|
354 |
|
355 |
x=(element.text)
|
|
|
|
|
356 |
return x
|
357 |
except:
|
358 |
continue
|
359 |
|
360 |
|
361 |
-
|
|
|
362 |
|
363 |
return " --Error Occurred-- "
|
364 |
|
365 |
|
366 |
|
367 |
except:
|
|
|
|
|
368 |
return "Error Occurred "
|
369 |
|
370 |
|
@@ -403,6 +426,8 @@ def do_ML_MPT(text:str, trycount:int):
|
|
403 |
while True:
|
404 |
currtime= time.time()
|
405 |
if(currtime>starttime+20):
|
|
|
|
|
406 |
return "Requested Could not be proceed"
|
407 |
try:
|
408 |
textarea_xpath = "//textarea[@data-testid='textbox' and @class='scroll-hide svelte-1pie7s6' and @placeholder='Chat Message Box']"
|
@@ -419,6 +444,8 @@ def do_ML_MPT(text:str, trycount:int):
|
|
419 |
while True:
|
420 |
currtime= time.time()
|
421 |
if(currtime>starttime+20):
|
|
|
|
|
422 |
return "Requested Could not be proceed"
|
423 |
try:
|
424 |
|
@@ -478,7 +505,9 @@ def do_ML_MPT(text:str, trycount:int):
|
|
478 |
|
479 |
if trycount>1:
|
480 |
|
481 |
-
|
|
|
|
|
482 |
driver.quit()
|
483 |
return do_ML_MPT(text,trycount+1)
|
484 |
|
@@ -516,6 +545,8 @@ def do_ML_FALCON(text:str, trycount:int):
|
|
516 |
while True:
|
517 |
currtime= time.time()
|
518 |
if(currtime>starttime+20):
|
|
|
|
|
519 |
return "Requested Could not be proceed"
|
520 |
try:
|
521 |
textarea_element = driver.find_element(By.CSS_SELECTOR,'textarea[placeholder="Hello Falcon !!"]')
|
@@ -568,6 +599,8 @@ def do_ML_FALCON(text:str, trycount:int):
|
|
568 |
|
569 |
except:
|
570 |
print("Error")
|
|
|
|
|
571 |
|
572 |
return "Error Occureed"
|
573 |
|
@@ -606,6 +639,8 @@ def do_ML_STARCODE(text:str, trycount:int):
|
|
606 |
while True:
|
607 |
currtime= time.time()
|
608 |
if(currtime>starttime+20):
|
|
|
|
|
609 |
return "Requested Could not be proceed"
|
610 |
try:
|
611 |
textarea_element = driver.find_element(By.CSS_SELECTOR,'textarea[placeholder="Enter your message here"]')
|
@@ -644,6 +679,8 @@ def do_ML_STARCODE(text:str, trycount:int):
|
|
644 |
div_element = driver.find_element(By.CSS_SELECTOR,'div[data-testid="bot"]')
|
645 |
text_content = div_element.text
|
646 |
print(text_content)
|
|
|
|
|
647 |
return text_content
|
648 |
|
649 |
except Exception as e:
|
@@ -660,5 +697,7 @@ def do_ML_STARCODE(text:str, trycount:int):
|
|
660 |
except:
|
661 |
print("Error")
|
662 |
|
|
|
|
|
663 |
return "Error Occureed"
|
664 |
|
|
|
153 |
while True:
|
154 |
currtime= time.time()
|
155 |
if(currtime>starttime+20):
|
156 |
+
driver.delete_all_cookies()
|
157 |
+
driver.quit()
|
158 |
return "Requested Could not be proceed"
|
159 |
try:
|
160 |
# xpath_expression = '//textarea[@data-testid="tex
|
|
|
196 |
|
197 |
element = driver.find_element(By.CLASS_NAME, "prose") # Find the element by its class name
|
198 |
element_text = element.text # Extract the text from the element
|
199 |
+
driver.delete_all_cookies()
|
200 |
+
driver.quit()
|
201 |
return element_text
|
202 |
|
203 |
|
204 |
+
driver.delete_all_cookies()
|
205 |
+
driver.quit()
|
206 |
return " --Error Occurred-- "
|
207 |
|
208 |
|
209 |
|
210 |
except:
|
211 |
+
driver.delete_all_cookies()
|
212 |
+
driver.quit()
|
213 |
return "Error Occurred "
|
214 |
|
215 |
|
|
|
229 |
|
230 |
while True:
|
231 |
currtime= time.time()
|
232 |
+
if(currtime>starttime+20):
|
233 |
+
driver.delete_all_cookies()
|
234 |
+
driver.quit()
|
235 |
return "Requested Could not be proceed"
|
236 |
try:
|
237 |
xpath_expression = '//textarea[@data-testid="textbox"]'
|
|
|
276 |
element = driver.find_element(By.XPATH,'//div[@data-testid="bot" and contains(@class, "message bot")]')
|
277 |
|
278 |
x=(element.text)
|
279 |
+
driver.delete_all_cookies()
|
280 |
+
driver.quit()
|
281 |
return x
|
282 |
except:
|
283 |
continue
|
284 |
|
285 |
|
286 |
+
|
287 |
+
driver.delete_all_cookies()
|
288 |
+
driver.quit()
|
289 |
return " --Error Occurred-- "
|
290 |
|
291 |
|
292 |
|
293 |
except:
|
294 |
+
driver.delete_all_cookies()
|
295 |
+
driver.quit()
|
296 |
return "Error Occurred "
|
297 |
|
298 |
|
|
|
313 |
while True:
|
314 |
currtime= time.time()
|
315 |
if(currtime>starttime+20):
|
316 |
+
driver.delete_all_cookies()
|
317 |
+
driver.quit()
|
318 |
return "Requested Could not be proceed"
|
319 |
try:
|
320 |
xpath_expression = '//textarea[@data-testid="textbox"]'
|
|
|
359 |
print(queue_text)
|
360 |
if "queue" in queue_text:
|
361 |
print("Queue is present")
|
362 |
+
driver.delete_all_cookies()
|
363 |
+
driver.quit()
|
364 |
return do_ML_LLAMA7b(text, trycount)
|
365 |
except:
|
366 |
pass
|
|
|
371 |
element = driver.find_element(By.XPATH,'//div[@data-testid="bot" and contains(@class, "message bot")]')
|
372 |
|
373 |
x=(element.text)
|
374 |
+
driver.delete_all_cookies()
|
375 |
+
driver.quit()
|
376 |
return x
|
377 |
except:
|
378 |
continue
|
379 |
|
380 |
|
381 |
+
driver.delete_all_cookies()
|
382 |
+
driver.quit()
|
383 |
|
384 |
return " --Error Occurred-- "
|
385 |
|
386 |
|
387 |
|
388 |
except:
|
389 |
+
driver.delete_all_cookies()
|
390 |
+
driver.quit()
|
391 |
return "Error Occurred "
|
392 |
|
393 |
|
|
|
426 |
while True:
|
427 |
currtime= time.time()
|
428 |
if(currtime>starttime+20):
|
429 |
+
driver.delete_all_cookies()
|
430 |
+
driver.quit()
|
431 |
return "Requested Could not be proceed"
|
432 |
try:
|
433 |
textarea_xpath = "//textarea[@data-testid='textbox' and @class='scroll-hide svelte-1pie7s6' and @placeholder='Chat Message Box']"
|
|
|
444 |
while True:
|
445 |
currtime= time.time()
|
446 |
if(currtime>starttime+20):
|
447 |
+
driver.delete_all_cookies()
|
448 |
+
driver.quit()
|
449 |
return "Requested Could not be proceed"
|
450 |
try:
|
451 |
|
|
|
505 |
|
506 |
if trycount>1:
|
507 |
|
508 |
+
driver.delete_all_cookies()
|
509 |
+
driver.quit()
|
510 |
+
return "Error"
|
511 |
driver.quit()
|
512 |
return do_ML_MPT(text,trycount+1)
|
513 |
|
|
|
545 |
while True:
|
546 |
currtime= time.time()
|
547 |
if(currtime>starttime+20):
|
548 |
+
driver.delete_all_cookies()
|
549 |
+
driver.quit()
|
550 |
return "Requested Could not be proceed"
|
551 |
try:
|
552 |
textarea_element = driver.find_element(By.CSS_SELECTOR,'textarea[placeholder="Hello Falcon !!"]')
|
|
|
599 |
|
600 |
except:
|
601 |
print("Error")
|
602 |
+
driver.delete_all_cookies()
|
603 |
+
driver.quit()
|
604 |
|
605 |
return "Error Occureed"
|
606 |
|
|
|
639 |
while True:
|
640 |
currtime= time.time()
|
641 |
if(currtime>starttime+20):
|
642 |
+
driver.delete_all_cookies()
|
643 |
+
driver.quit()
|
644 |
return "Requested Could not be proceed"
|
645 |
try:
|
646 |
textarea_element = driver.find_element(By.CSS_SELECTOR,'textarea[placeholder="Enter your message here"]')
|
|
|
679 |
div_element = driver.find_element(By.CSS_SELECTOR,'div[data-testid="bot"]')
|
680 |
text_content = div_element.text
|
681 |
print(text_content)
|
682 |
+
driver.delete_all_cookies()
|
683 |
+
driver.quit()
|
684 |
return text_content
|
685 |
|
686 |
except Exception as e:
|
|
|
697 |
except:
|
698 |
print("Error")
|
699 |
|
700 |
+
driver.delete_all_cookies()
|
701 |
+
driver.quit()
|
702 |
return "Error Occureed"
|
703 |
|