Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,8 @@ import bs4
|
|
3 |
import gradio as gr
|
4 |
from bs4 import BeautifulSoup
|
5 |
|
6 |
-
def run_lora(prompt,site):
|
7 |
-
page = requests.get("https://www.google.dz/search?q=site:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%
|
8 |
soup = BeautifulSoup(page.content)
|
9 |
import re
|
10 |
links = soup.findAll("a")
|
@@ -32,12 +32,14 @@ with gr.Blocks() as app:
|
|
32 |
|
33 |
input_textbox = gr.Textbox(lines=5, placeholder="Enter key", label="Input Text")
|
34 |
input_sitebox = gr.Textbox(lines=5, placeholder="Enter site", label="Site Text")
|
|
|
|
|
35 |
with gr.Column():
|
36 |
|
37 |
translated_textbox = gr.Textbox(lines=5, placeholder="", label="Result Text")
|
38 |
info_label = gr.HTML("")
|
39 |
btn = gr.Button("GetNow")
|
40 |
-
btn.click(run_lora, inputs=[input_textbox,input_sitebox],outputs=[translated_textbox])
|
41 |
|
42 |
app.queue()
|
43 |
app.launch()
|
|
|
3 |
import gradio as gr
|
4 |
from bs4 import BeautifulSoup
|
5 |
|
6 |
+
def run_lora(prompt,site,start,end):
|
7 |
+
page = requests.get("https://www.google.dz/search?q=site:" +site + " " +prompt + "&tbs=cdr%3A1%2Ccd_min%3A"+start+"%2Ccd_max%3A" + end)
|
8 |
soup = BeautifulSoup(page.content)
|
9 |
import re
|
10 |
links = soup.findAll("a")
|
|
|
32 |
|
33 |
input_textbox = gr.Textbox(lines=5, placeholder="Enter key", label="Input Text")
|
34 |
input_sitebox = gr.Textbox(lines=5, placeholder="Enter site", label="Site Text")
|
35 |
+
start = gr.DateTime("now - 24h")
|
36 |
+
end = gr.DateTime("now")
|
37 |
with gr.Column():
|
38 |
|
39 |
translated_textbox = gr.Textbox(lines=5, placeholder="", label="Result Text")
|
40 |
info_label = gr.HTML("")
|
41 |
btn = gr.Button("GetNow")
|
42 |
+
btn.click(run_lora, inputs=[input_textbox,input_sitebox,start,end],outputs=[translated_textbox])
|
43 |
|
44 |
app.queue()
|
45 |
app.launch()
|