Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -64,21 +64,33 @@ def translate(text):
|
|
64 |
|
65 |
|
66 |
css_str = """
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
"""
|
79 |
|
80 |
with gr.Blocks(css=css_str) as demo:
|
81 |
-
gr.
|
|
|
82 |
gr.Markdown(
|
83 |
"<div class='description'>Enter a Spanish sentence below to receive its English translation.</div>"
|
84 |
)
|
@@ -89,6 +101,7 @@ with gr.Blocks(css=css_str) as demo:
|
|
89 |
translate_btn = gr.Button("Translate")
|
90 |
txt_output = gr.Textbox(label="English Translation", lines=2)
|
91 |
translate_btn.click(fn=translate, inputs=txt_input, outputs=txt_output)
|
|
|
92 |
|
93 |
if __name__ == "__main__":
|
94 |
demo.launch(share=True)
|
|
|
64 |
|
65 |
|
66 |
css_str = """
|
67 |
+
body {
|
68 |
+
background-color: #121212;
|
69 |
+
color: #e0e0e0;
|
70 |
+
}
|
71 |
+
|
72 |
+
.container {
|
73 |
+
max-width: 700px;
|
74 |
+
margin: 10px auto;
|
75 |
+
}
|
76 |
+
|
77 |
+
h1 {
|
78 |
+
font-size: 36px;
|
79 |
+
font-weight: bold;
|
80 |
+
text-align: center;
|
81 |
+
color: #ffffff;
|
82 |
+
}
|
83 |
+
|
84 |
+
.description {
|
85 |
+
font-size: 18px;
|
86 |
+
text-align: center;
|
87 |
+
color: #b0b0b0;
|
88 |
+
}
|
89 |
"""
|
90 |
|
91 |
with gr.Blocks(css=css_str) as demo:
|
92 |
+
gr.HTML("<div class='container'>")
|
93 |
+
gr.Markdown("<h1>Spanish-to-English Translator</h1>")
|
94 |
gr.Markdown(
|
95 |
"<div class='description'>Enter a Spanish sentence below to receive its English translation.</div>"
|
96 |
)
|
|
|
101 |
translate_btn = gr.Button("Translate")
|
102 |
txt_output = gr.Textbox(label="English Translation", lines=2)
|
103 |
translate_btn.click(fn=translate, inputs=txt_input, outputs=txt_output)
|
104 |
+
gr.HTML("</div>")
|
105 |
|
106 |
if __name__ == "__main__":
|
107 |
demo.launch(share=True)
|