Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,33 +13,30 @@ def run_lora(prompt):
|
|
| 13 |
print (re.split(":(?=http)",link["href"].replace("/url?q=","")))
|
| 14 |
mLink+=str(re.split(":(?=http)",link["href"].replace("/url?q=","")))
|
| 15 |
return mLink
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
| 29 |
with gr.Row():
|
| 30 |
-
with gr.Column(
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
translated_textbox = gr.Textbox(lines=5, placeholder="", label="Translated Text")
|
| 36 |
-
|
| 37 |
-
gr.
|
| 38 |
-
|
| 39 |
-
fn=run_lora,
|
| 40 |
-
inputs=[prompt],
|
| 41 |
-
outputs=[translated_textbox]
|
| 42 |
-
)
|
| 43 |
|
| 44 |
app.queue()
|
| 45 |
app.launch()
|
|
|
|
| 13 |
print (re.split(":(?=http)",link["href"].replace("/url?q=","")))
|
| 14 |
mLink+=str(re.split(":(?=http)",link["href"].replace("/url?q=","")))
|
| 15 |
return mLink
|
| 16 |
+
|
| 17 |
+
with gr.Blocks() as demo:
|
| 18 |
+
gr.HTML("""<html>
|
| 19 |
+
<head>
|
| 20 |
+
<style>
|
| 21 |
+
h1 {
|
| 22 |
+
text-align: center;
|
| 23 |
+
}
|
| 24 |
+
</style>
|
| 25 |
+
</head>
|
| 26 |
+
<body>
|
| 27 |
+
<h1>Open Translate</h1>
|
| 28 |
+
</body>
|
| 29 |
+
</html>""")
|
| 30 |
with gr.Row():
|
| 31 |
+
with gr.Column():
|
| 32 |
+
|
| 33 |
+
input_textbox = gr.Textbox(lines=5, placeholder="Enter text to translate", label="Input Text")
|
| 34 |
+
with gr.Column():
|
| 35 |
+
|
| 36 |
translated_textbox = gr.Textbox(lines=5, placeholder="", label="Translated Text")
|
| 37 |
+
info_label = gr.HTML("")
|
| 38 |
+
btn = gr.Button("GetNow")
|
| 39 |
+
btn.click(translate, inputs=[prompt,outputs=[translated_textbox, info_label])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
app.queue()
|
| 42 |
app.launch()
|