Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -85,15 +85,8 @@ def Download(text):
|
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
-
|
| 89 |
-
# mainInterface = gr.Interface(fn=TextLineBox,
|
| 90 |
-
# inputs=gr.Image(),
|
| 91 |
-
# outputs=[gr.Text(label="Result Text"), gr.Image(label="Boxes of Line")],
|
| 92 |
-
# )
|
| 93 |
-
|
| 94 |
-
|
| 95 |
|
| 96 |
-
with gr.Blocks (theme=
|
| 97 |
with gr.Row():
|
| 98 |
with gr.Column():
|
| 99 |
input = gr.Image()
|
|
@@ -111,7 +104,22 @@ with gr.Blocks (theme='JohnSmith9982/small_and_pretty' , css="#SUBMIT {backgrou
|
|
| 111 |
download_btn.click(Download, text_output, outputs= file_output )
|
| 112 |
clear_btn.click(lambda: [None,None,None], inputs=None, outputs= [text_output, file_output, image_output])
|
| 113 |
|
| 114 |
-
demo.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
|
| 116 |
|
| 117 |
# Cach 1 dung app Gradio (share = True)
|
|
|
|
| 85 |
|
| 86 |
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
+
with gr.Blocks (theme="ParityError/Anime" , css="#SUBMIT {background-color: red} #DOWNLOAD {background-color: green}") as demo:
|
| 90 |
with gr.Row():
|
| 91 |
with gr.Column():
|
| 92 |
input = gr.Image()
|
|
|
|
| 104 |
download_btn.click(Download, text_output, outputs= file_output )
|
| 105 |
clear_btn.click(lambda: [None,None,None], inputs=None, outputs= [text_output, file_output, image_output])
|
| 106 |
|
| 107 |
+
demo.load(
|
| 108 |
+
None,
|
| 109 |
+
None,
|
| 110 |
+
_js="""
|
| 111 |
+
() => {
|
| 112 |
+
const params = new URLSearchParams(window.location.search);
|
| 113 |
+
if (!params.has('__theme')) {
|
| 114 |
+
params.set('__theme', 'dark');
|
| 115 |
+
window.location.search = params.toString();
|
| 116 |
+
}
|
| 117 |
+
}""",
|
| 118 |
+
)
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
demo.queue().launch()
|
| 123 |
|
| 124 |
|
| 125 |
# Cach 1 dung app Gradio (share = True)
|