ariG23498 HF staff commited on
Commit
5186fbc
1 Parent(s): c967f60

test: adding examples

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -10,6 +10,7 @@ repo = Repository(
10
  use_auth_token=os.environ.get("token")
11
  )
12
  reloaded = tf.saved_model.load("nmt-bahdanau-attention/translator")
 
13
 
14
  def get_translation(sentence):
15
  result = reloaded.translate(
@@ -21,6 +22,7 @@ nmt_space = gr.Interface(
21
  fn=get_translation,
22
  inputs=gr.Textbox(label="English Sentence"),
23
  outputs=gr.Textbox(label="French Sentence"),
 
24
  )
25
 
26
  nmt_space.launch()
 
10
  use_auth_token=os.environ.get("token")
11
  )
12
  reloaded = tf.saved_model.load("nmt-bahdanau-attention/translator")
13
+ examples=["how are you?", "good morning", "safe travels"]
14
 
15
  def get_translation(sentence):
16
  result = reloaded.translate(
 
22
  fn=get_translation,
23
  inputs=gr.Textbox(label="English Sentence"),
24
  outputs=gr.Textbox(label="French Sentence"),
25
+ examples=examples,
26
  )
27
 
28
  nmt_space.launch()