wayne0019 commited on
Commit
e6cd201
·
verified ·
1 Parent(s): bf83420

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-et-en")
5
 
6
  def main(in_text):
7
  print(in_text)
@@ -10,7 +10,7 @@ def main(in_text):
10
  return answer[0]["translation_text"]
11
 
12
  with gr.Blocks() as demo:
13
- gr.Markdown("""# Translation Engine!""")
14
  with gr.Row():
15
  with gr.Column():
16
  text1 = gr.Textbox(
@@ -18,9 +18,9 @@ with gr.Blocks() as demo:
18
  lines=1,
19
  )
20
  output = gr.Textbox(label="Output Text")
21
- b1 = gr.Button("Translate!")
22
  b1.click(main, inputs=[text1], outputs=output)
23
- gr.Markdown("""#### powered by [Tassle](https://bit.ly/3LXMklV)""")
24
 
25
 
26
  if __name__ == "__main__":
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-zh")
5
 
6
  def main(in_text):
7
  print(in_text)
 
10
  return answer[0]["translation_text"]
11
 
12
  with gr.Blocks() as demo:
13
+ gr.Markdown("""# Translation Engine""")
14
  with gr.Row():
15
  with gr.Column():
16
  text1 = gr.Textbox(
 
18
  lines=1,
19
  )
20
  output = gr.Textbox(label="Output Text")
21
+ b1 = gr.Button("Translate")
22
  b1.click(main, inputs=[text1], outputs=output)
23
+ gr.Markdown("""#### powered by OpenCSG""")
24
 
25
 
26
  if __name__ == "__main__":