Jordan Myers commited on
Commit
ef40bd8
1 Parent(s): a96c965

description update

Browse files
Files changed (1) hide show
  1. app.py +21 -44
app.py CHANGED
@@ -40,30 +40,24 @@ def translate(text, src_lang, tgt_lang, candidates:int):
40
 
41
  return output
42
 
43
- # app = gr.Interface(
44
- # fn=translate,
45
- # inputs=[
46
- # gr.components.Textbox(label="Text"),
47
- # gr.components.Dropdown(label="Source Language", choices=list(LANG_CODES.keys())),
48
- # gr.components.Dropdown(label="Target Language", choices=list(LANG_CODES.keys())),
49
- # gr.Slider(label="Number of return sequences", value=3, minimum=1, maximum=12, step=1)
50
- # ],
51
- # outputs=["text"],
52
- # examples=[
53
- # ["Welcome to my translation app.", "English", "toki pona", 3],
54
- # ["Its not always perfect, but its pretty okay!", "English", "toki pona", 3],
55
- # ["ilo pi ante toki ni li pona a!", "toki pona", "English", 3],
56
- # ["kijetesantakalu li pona", "toki pona", "English", 3],
57
- # ["mi li toki e toki pona", "toki pona", "toki pona", 3]
58
- # ],
59
- # cache_examples=False,
60
- # title="English / toki pona Translation"
61
- # )
62
-
63
- app = gr.Blocks()
64
-
65
- with app:
66
- gr.Markdown("""
67
  # A simple English / toki pona Neural Machine Translation App!
68
 
69
  ### toki a! 💬
@@ -93,25 +87,8 @@ with app:
93
  the *quality of data* found on Tatoeba directly influences the perfomance of projects like this!
94
 
95
  If you wish to contribute, please simply add high quality and diverse translations to Tatoeba!
96
- """)
97
- gr.Interface(
98
- fn=translate,
99
- inputs=[
100
- gr.components.Textbox(label="Text"),
101
- gr.components.Dropdown(label="Source Language", choices=list(LANG_CODES.keys())),
102
- gr.components.Dropdown(label="Target Language", choices=list(LANG_CODES.keys())),
103
- gr.Slider(label="Number of return sequences", value=3, minimum=1, maximum=12, step=1)
104
- ],
105
- outputs=["text"],
106
- examples=[
107
- ["Welcome to my translation app.", "English", "toki pona", 3],
108
- ["Its not always perfect, but its pretty okay!", "English", "toki pona", 3],
109
- ["ilo pi ante toki ni li pona a!", "toki pona", "English", 3],
110
- ["kijetesantakalu li pona", "toki pona", "English", 3],
111
- ["mi li toki e toki pona", "toki pona", "toki pona", 3]
112
- ],
113
- cache_examples=False,
114
- title="English / toki pona Translation"
115
- )
116
 
117
  app.launch()
 
40
 
41
  return output
42
 
43
+ app = gr.Interface(
44
+ fn=translate,
45
+ inputs=[
46
+ gr.components.Textbox(label="Text"),
47
+ gr.components.Dropdown(label="Source Language", choices=list(LANG_CODES.keys())),
48
+ gr.components.Dropdown(label="Target Language", choices=list(LANG_CODES.keys())),
49
+ gr.Slider(label="Number of return sequences", value=3, minimum=1, maximum=12, step=1)
50
+ ],
51
+ outputs=["text"],
52
+ examples=[
53
+ ["Welcome to my translation app.", "English", "toki pona", 3],
54
+ ["Its not always perfect, but its pretty okay!", "English", "toki pona", 3],
55
+ ["ilo pi ante toki ni li pona a!", "toki pona", "English", 3],
56
+ ["kijetesantakalu li pona", "toki pona", "English", 3],
57
+ ["mi li toki e toki pona", "toki pona", "toki pona", 3]
58
+ ],
59
+ cache_examples=False,
60
+ description="""
 
 
 
 
 
 
61
  # A simple English / toki pona Neural Machine Translation App!
62
 
63
  ### toki a! 💬
 
87
  the *quality of data* found on Tatoeba directly influences the perfomance of projects like this!
88
 
89
  If you wish to contribute, please simply add high quality and diverse translations to Tatoeba!
90
+ """,
91
+ title="English / toki pona Translation"
92
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
  app.launch()