Spaces:
Running
Running
yue-here
commited on
Commit
·
cdccca0
1
Parent(s):
ac65b90
add examples
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ def title2abstract(text):
|
|
19 |
# no_repeat_ngram_size=2,
|
20 |
num_return_sequences=3,
|
21 |
do_sample=True,
|
22 |
-
top_k=
|
23 |
top_p=0.95,
|
24 |
early_stopping=True)
|
25 |
|
@@ -31,7 +31,9 @@ def title2abstract(text):
|
|
31 |
|
32 |
return output
|
33 |
|
|
|
34 |
demo = gr.Interface(fn=title2abstract, inputs="text", outputs="text",
|
35 |
title="Abstract to title generator",
|
36 |
-
description="Give a chemistry paper abstract and the model will suggest 3 titles."
|
|
|
37 |
demo.launch()
|
|
|
19 |
# no_repeat_ngram_size=2,
|
20 |
num_return_sequences=3,
|
21 |
do_sample=True,
|
22 |
+
top_k=5,
|
23 |
top_p=0.95,
|
24 |
early_stopping=True)
|
25 |
|
|
|
31 |
|
32 |
return output
|
33 |
|
34 |
+
# add an example to gradio interface
|
35 |
demo = gr.Interface(fn=title2abstract, inputs="text", outputs="text",
|
36 |
title="Abstract to title generator",
|
37 |
+
description="Give a chemistry paper abstract and the model will suggest 3 titles. Submit again for new titles!",
|
38 |
+
examples=[["Studies have shown that unobtanium oxide shows excellent mechanical and optical properties. However, the processing of unobtanium oxide is extremly difficult due to the high temperatures and pressures involved. Here we present a novel automagical synthesis of unobtanium oxide at room temperature and reduced pressure using a phlogiston catalyst. We believe this research will open up many potential applications of unobtanium oxide that were previously untested due to material scarcity."]])
|
39 |
demo.launch()
|