ibraheemmoosa commited on
Commit
93e15af
·
verified ·
1 Parent(s): a4e2651

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -1,11 +1,12 @@
1
  import gradio as gr
2
 
3
- def greet(source, translation1, translation2):
4
- return "Source: {} Translation 0: {} Translation 1: {}".format(source, translation1, translation2)
 
5
 
6
  source_textbox = gr.Textbox(label="Source", info="Source Sentence", value="Le chat est sur la tapis.")
7
  translation1_textbox = gr.Textbox(label="Translation 1", info="Translation 1", value="The cat is on the bed.")
8
  translation2_textbox = gr.Textbox(label="Translation 2", info="Translation 2", value="The cat is on the carpet.")
9
- output = gr.Textbox()
10
- iface = gr.Interface(fn=greet, inputs=[source_textbox, translation1_textbox, translation2_textbox], outputs="text")
11
  iface.launch()
 
1
  import gradio as gr
2
 
3
+ def predict(source, translation1, translation2):
4
+ model_input = "Source: {} Translation 0: {} Translation 1: {}".format(source, translation1, translation2)
5
+ return {'Translation 1': 0.70, 'Translation 2': 0.30}
6
 
7
  source_textbox = gr.Textbox(label="Source", info="Source Sentence", value="Le chat est sur la tapis.")
8
  translation1_textbox = gr.Textbox(label="Translation 1", info="Translation 1", value="The cat is on the bed.")
9
  translation2_textbox = gr.Textbox(label="Translation 2", info="Translation 2", value="The cat is on the carpet.")
10
+ output = gr.Label(label="Result")
11
+ iface = gr.Interface(fn=greet, inputs=[source_textbox, translation1_textbox, translation2_textbox], outputs=output)
12
  iface.launch()