Rogerjs commited on
Commit
c44a2cb
·
1 Parent(s): 4ca439a
Files changed (2) hide show
  1. app.py +5 -2
  2. requirements.txt +2 -0
app.py CHANGED
@@ -14,8 +14,11 @@ def translate(text, direction):
14
 
15
  iface = gr.Interface(
16
  fn=translate,
17
- inputs=[gr.inputs.Textbox(lines=2, placeholder="Enter text here..."), gr.inputs.Radio(["en-fi", "fi-en"])],
18
- outputs="text",
 
 
 
19
  title="Translation App",
20
  description="Translate text between English and Finnish using Hugging Face Transformers."
21
  )
 
14
 
15
  iface = gr.Interface(
16
  fn=translate,
17
+ inputs=[
18
+ gr.Textbox(lines=2, placeholder="Enter text here..."),
19
+ gr.Radio(choices=["en-fi", "fi-en"], label="Translation Direction")
20
+ ],
21
+ outputs=gr.Textbox(),
22
  title="Translation App",
23
  description="Translate text between English and Finnish using Hugging Face Transformers."
24
  )
requirements.txt CHANGED
@@ -7,3 +7,5 @@ torch==2.2.1
7
  sentencepiece
8
  gradio
9
  transformers
 
 
 
7
  sentencepiece
8
  gradio
9
  transformers
10
+ numpy<2
11
+ sacremoses