Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,9 +8,11 @@ def run_lora(prompt):
|
|
8 |
soup = BeautifulSoup(page.content)
|
9 |
import re
|
10 |
links = soup.findAll("a")
|
|
|
11 |
for link in soup.find_all("a",href=re.compile("(?<=/url\?q=)(htt.*://.*)")):
|
12 |
print (re.split(":(?=http)",link["href"].replace("/url?q=","")))
|
13 |
-
|
|
|
14 |
css = '''
|
15 |
#gen_btn{height: 100%}
|
16 |
#title{text-align: center}
|
@@ -29,12 +31,14 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as app:
|
|
29 |
prompt = gr.Textbox(label="Prompt", lines=1, placeholder="Type a prompt after selecting a LoRA")
|
30 |
with gr.Column(scale=1, elem_id="gen_column"):
|
31 |
generate_button = gr.Button("Generate", variant="primary", elem_id="gen_btn")
|
|
|
32 |
|
33 |
|
34 |
gr.on(
|
35 |
triggers=[generate_button.click, prompt.submit],
|
36 |
fn=run_lora,
|
37 |
-
inputs=[prompt]
|
|
|
38 |
)
|
39 |
|
40 |
app.queue()
|
|
|
8 |
soup = BeautifulSoup(page.content)
|
9 |
import re
|
10 |
links = soup.findAll("a")
|
11 |
+
mLink=""
|
12 |
for link in soup.find_all("a",href=re.compile("(?<=/url\?q=)(htt.*://.*)")):
|
13 |
print (re.split(":(?=http)",link["href"].replace("/url?q=","")))
|
14 |
+
mLink+=re.split(":(?=http)",link["href"].replace("/url?q=",""))
|
15 |
+
return mLink
|
16 |
css = '''
|
17 |
#gen_btn{height: 100%}
|
18 |
#title{text-align: center}
|
|
|
31 |
prompt = gr.Textbox(label="Prompt", lines=1, placeholder="Type a prompt after selecting a LoRA")
|
32 |
with gr.Column(scale=1, elem_id="gen_column"):
|
33 |
generate_button = gr.Button("Generate", variant="primary", elem_id="gen_btn")
|
34 |
+
translated_textbox = gr.Textbox(lines=5, placeholder="", label="Translated Text")
|
35 |
|
36 |
|
37 |
gr.on(
|
38 |
triggers=[generate_button.click, prompt.submit],
|
39 |
fn=run_lora,
|
40 |
+
inputs=[prompt],
|
41 |
+
outputs=[translated_textbox]
|
42 |
)
|
43 |
|
44 |
app.queue()
|