Update app.py
Browse files
app.py
CHANGED
@@ -84,19 +84,19 @@ def get_result(q_txt, p_txt1, p_txt2, p_txt3, p_txt4, p_txt5):
|
|
84 |
]
|
85 |
|
86 |
if p_txt1 != '':
|
87 |
-
|
88 |
|
89 |
if p_txt2 != '':
|
90 |
-
|
91 |
|
92 |
if p_txt3 != '':
|
93 |
-
|
94 |
|
95 |
if p_txt4 != '':
|
96 |
-
|
97 |
|
98 |
if p_txt5 != '':
|
99 |
-
|
100 |
|
101 |
scores = get_scores(model, tokenizer, input_texts)
|
102 |
result = get_human_readable_top(scores, input_texts)
|
@@ -116,6 +116,16 @@ with gr.Blocks() as demo:
|
|
116 |
p_txt5 = gr.Textbox(placeholder="Enter passage 5", info="Passage 5")
|
117 |
submit = gr.Button("Submit")
|
118 |
o_txt = gr.Textbox(placeholder="Output", lines=10, interactive=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
submit.click(
|
121 |
get_result,
|
|
|
84 |
]
|
85 |
|
86 |
if p_txt1 != '':
|
87 |
+
input_texts.append(f"passage: {p_txt1}")
|
88 |
|
89 |
if p_txt2 != '':
|
90 |
+
input_texts.append(f"passage: {p_txt2}")
|
91 |
|
92 |
if p_txt3 != '':
|
93 |
+
input_texts.append(f"passage: {p_txt3}")
|
94 |
|
95 |
if p_txt4 != '':
|
96 |
+
input_texts.append(f"passage: {p_txt4}")
|
97 |
|
98 |
if p_txt5 != '':
|
99 |
+
input_texts.append(f"passage: {p_txt5}")
|
100 |
|
101 |
scores = get_scores(model, tokenizer, input_texts)
|
102 |
result = get_human_readable_top(scores, input_texts)
|
|
|
116 |
p_txt5 = gr.Textbox(placeholder="Enter passage 5", info="Passage 5")
|
117 |
submit = gr.Button("Submit")
|
118 |
o_txt = gr.Textbox(placeholder="Output", lines=10, interactive=False)
|
119 |
+
|
120 |
+
gr.Examples(
|
121 |
+
[
|
122 |
+
"I'm searching for a planet not too far from Earth.",
|
123 |
+
"Neptune is the eighth and farthest-known Solar planet from the Sun. In the Solar System, it is the fourth-largest planet by diameter, the third-most-massive planet, and the densest giant planet. It is 17 times the mass of Earth, slightly more massive than its near-twin Uranus.",
|
124 |
+
"TRAPPIST-1d, also designated as 2MASS J23062928-0502285 d, is a small exoplanet (about 30% the mass of the earth), which orbits on the inner edge of the habitable zone of the ultracool dwarf star TRAPPIST-1 approximately 40 light-years (12.1 parsecs, or nearly 3.7336×1014 km) away from Earth in the constellation of Aquarius.",
|
125 |
+
"A harsh desert world orbiting twin suns in the galaxy’s Outer Rim, Tatooine is a lawless place ruled by Hutt gangsters. Many settlers scratch out a living on moisture farms, while spaceport cities such as Mos Eisley and Mos Espa serve as home base for smugglers, criminals, and other rogues."
|
126 |
+
],
|
127 |
+
inputs=input
|
128 |
+
)
|
129 |
|
130 |
submit.click(
|
131 |
get_result,
|