Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -388,6 +388,20 @@ def summarize(inp,history,data=None,files=None,url=None,pdf_url=None,pdf_batch=N
|
|
| 388 |
def clear_fn():
|
| 389 |
return "",[(None,None)]
|
| 390 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
with gr.Blocks() as app:
|
| 392 |
gr.HTML("""<center><h1>Mixtral 8x7B TLDR Summarizer + Web</h1><h3>Summarize Data of unlimited length</h3>""")
|
| 393 |
chatbot = gr.Chatbot(label="Mixtral 8x7B Chatbot",show_copy_button=True)
|
|
@@ -408,6 +422,7 @@ with gr.Blocks() as app:
|
|
| 408 |
file=gr.Files(label="Input File(s) (.pdf .txt)")
|
| 409 |
with gr.Tab("Raw HTML"):
|
| 410 |
url = gr.Textbox(label="URL")
|
|
|
|
| 411 |
with gr.Tab("PDF URL"):
|
| 412 |
pdf_url = gr.Textbox(label="PDF URL")
|
| 413 |
with gr.Tab("PDF Batch"):
|
|
@@ -416,6 +431,7 @@ with gr.Blocks() as app:
|
|
| 416 |
e_box=gr.Textbox()
|
| 417 |
#text=gr.JSON()
|
| 418 |
#inp_query.change(search_models,inp_query,models_dd)
|
|
|
|
| 419 |
clear_btn.click(clear_fn,None,[prompt,chatbot])
|
| 420 |
go=button.click(summarize,[prompt,chatbot,data,file,url,pdf_url,pdf_batch],[prompt,chatbot,e_box,json_out])
|
| 421 |
stop_button.click(None,None,None,cancels=[go])
|
|
|
|
| 388 |
def clear_fn():
|
| 389 |
return "",[(None,None)]
|
| 390 |
|
| 391 |
+
def itt(url):
|
| 392 |
+
out=[]
|
| 393 |
+
for i in range(0,100):
|
| 394 |
+
for d in range(0,100):
|
| 395 |
+
r = requests.get(f'{url}.{i}.{d}')
|
| 396 |
+
if r.status_code == 200:
|
| 397 |
+
out.append(f'{url}.{i}.{d}')
|
| 398 |
+
for p in range(0,100):
|
| 399 |
+
r = requests.get(f'{url}.{i}.{d}_{p}')
|
| 400 |
+
if r.status_code == 200:
|
| 401 |
+
out.append(f'{url}.{i}.{d}_{p}')
|
| 402 |
+
|
| 403 |
+
yield out
|
| 404 |
+
|
| 405 |
with gr.Blocks() as app:
|
| 406 |
gr.HTML("""<center><h1>Mixtral 8x7B TLDR Summarizer + Web</h1><h3>Summarize Data of unlimited length</h3>""")
|
| 407 |
chatbot = gr.Chatbot(label="Mixtral 8x7B Chatbot",show_copy_button=True)
|
|
|
|
| 422 |
file=gr.Files(label="Input File(s) (.pdf .txt)")
|
| 423 |
with gr.Tab("Raw HTML"):
|
| 424 |
url = gr.Textbox(label="URL")
|
| 425 |
+
test_btn=gr.Button("Test")
|
| 426 |
with gr.Tab("PDF URL"):
|
| 427 |
pdf_url = gr.Textbox(label="PDF URL")
|
| 428 |
with gr.Tab("PDF Batch"):
|
|
|
|
| 431 |
e_box=gr.Textbox()
|
| 432 |
#text=gr.JSON()
|
| 433 |
#inp_query.change(search_models,inp_query,models_dd)
|
| 434 |
+
test_btn.click(itt,url,e_box)
|
| 435 |
clear_btn.click(clear_fn,None,[prompt,chatbot])
|
| 436 |
go=button.click(summarize,[prompt,chatbot,data,file,url,pdf_url,pdf_batch],[prompt,chatbot,e_box,json_out])
|
| 437 |
stop_button.click(None,None,None,cancels=[go])
|