zionia commited on
Commit
1b6e0ad
·
verified ·
1 Parent(s): c1cfe57

update formatting

Browse files
Files changed (1) hide show
  1. app.py +27 -15
app.py CHANGED
@@ -12,24 +12,31 @@ def translate(inp, direction):
12
  return res
13
 
14
  with gr.Blocks() as demo:
15
- gr.Markdown("<div style='text-align: center;'><img src='logo_transparent_small.png' alt='Logo' id='logo' /></div>")
16
- gr.Markdown(
17
- """
18
- <h1 style='text-align: center;'>Siswati-English Translation</h1>
19
- <p style='text-align: center;'>This space provides a bidirectional translation service from Siswati to English.</p>
20
- """
21
- )
 
 
 
 
 
 
22
 
23
  with gr.Row():
24
- with gr.Column():
 
 
25
  inp_text = gr.Textbox(lines=5, placeholder="Enter text (maximum 5 lines)", label="Input")
26
- with gr.Column():
27
  direction = gr.Radio(choices=['en->ss', 'ss->en'], label='Direction')
28
-
29
- output_text = gr.Textbox(label="Output")
30
-
31
- translate_button = gr.Button("Translate")
32
- translate_button.click(translate, inputs=[inp_text, direction], outputs=output_text)
33
 
34
  gr.Markdown(
35
  """
@@ -40,6 +47,11 @@ with gr.Blocks() as demo:
40
  </div>
41
  """
42
  )
43
- gr.Markdown("<div style='text-align: center;'>Authors: Vukosi Marivate, Richard Lastrucci</div>")
 
 
 
 
 
44
 
45
  demo.launch()
 
12
  return res
13
 
14
  with gr.Blocks() as demo:
15
+ with gr.Row():
16
+ with gr.Column(scale=1):
17
+ pass
18
+ with gr.Column(scale=2):
19
+ gr.Image("logo_transparent_small.png", elem_id="logo", show_label=False, width=150)
20
+ gr.Markdown(
21
+ """
22
+ <h1 style='text-align: center;'>Siswati-English Translation</h1>
23
+ <p style='text-align: center;'>This space provides a bidirectional translation service from Siswati to English.</p>
24
+ """
25
+ )
26
+ with gr.Column(scale=1):
27
+ pass
28
 
29
  with gr.Row():
30
+ with gr.Column(scale=1):
31
+ pass
32
+ with gr.Column(scale=2):
33
  inp_text = gr.Textbox(lines=5, placeholder="Enter text (maximum 5 lines)", label="Input")
 
34
  direction = gr.Radio(choices=['en->ss', 'ss->en'], label='Direction')
35
+ translate_button = gr.Button("Translate")
36
+ output_text = gr.Textbox(label="Output")
37
+ translate_button.click(translate, inputs=[inp_text, direction], outputs=output_text)
38
+ with gr.Column(scale=1):
39
+ pass
40
 
41
  gr.Markdown(
42
  """
 
47
  </div>
48
  """
49
  )
50
+
51
+ with gr.Accordion("More Information", open=False):
52
+ gr.Markdown("""
53
+ <h4 style="text-align: center;">Authors</h4>
54
+ <div style='text-align: center;'>Vukosi Marivate, Richard Lastrucci</div>
55
+ """)
56
 
57
  demo.launch()