hanyullai commited on
Commit
d4b9a9c
1 Parent(s): 90152c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -47,6 +47,14 @@ def predict(text, seed, out_seq_length, min_gen_length, sampling_strategy,
47
 
48
 
49
  if __name__ == "__main__":
 
 
 
 
 
 
 
 
50
  with gr.Blocks() as demo:
51
  gr.Markdown(
52
  """
@@ -98,5 +106,8 @@ if __name__ == "__main__":
98
  inputs = [model_input, seed, out_seq_length, min_gen_length, sampling_strategy, num_beams, length_penalty, no_repeat_ngram_size, temperature, topk, topp]
99
  gen.click(fn=predict, inputs=inputs, outputs=outputs)
100
  clr.click(fn=lambda value: gr.update(value=""), inputs=clr, outputs=model_input)
 
 
 
101
 
102
  demo.launch()
 
47
 
48
 
49
  if __name__ == "__main__":
50
+
51
+ en_fil = ['The Starry Night is an oil-on-canvas painting by [MASK] in June 1889.']
52
+ en_gen = ['What is Special relativity ? Special relativity is ']
53
+ ch_fil = ['凯旋门位于意大利米兰市古城堡旁。1807年为纪念[MASK]而建,门高25米,顶上矗立两武士青铜古兵车铸像。']
54
+ ch_gen = ['五岳是指哪五座山?回答:']
55
+
56
+ examples = [en_fil, en_gen, ch_fil, ch_gen]
57
+
58
  with gr.Blocks() as demo:
59
  gr.Markdown(
60
  """
 
106
  inputs = [model_input, seed, out_seq_length, min_gen_length, sampling_strategy, num_beams, length_penalty, no_repeat_ngram_size, temperature, topk, topp]
107
  gen.click(fn=predict, inputs=inputs, outputs=outputs)
108
  clr.click(fn=lambda value: gr.update(value=""), inputs=clr, outputs=model_input)
109
+
110
+ gr.Markdown("Try this!")
111
+ gr_examples = gr.Examples(examples=examples, inputs=model_input)
112
 
113
  demo.launch()