Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,7 @@ def proc_submission(
|
|
49 |
settings = {
|
50 |
"length_penalty": float(length_penalty),
|
51 |
"repetition_penalty": float(repetition_penalty),
|
52 |
-
"no_repeat_ngram_size":
|
53 |
"encoder_no_repeat_ngram_size": 4,
|
54 |
"num_beams": int(num_beams),
|
55 |
"min_length": 11,
|
@@ -93,7 +93,7 @@ def proc_submission(
|
|
93 |
rt = round((time.perf_counter() - st) / 60, 2)
|
94 |
print(f"Runtime: {rt} minutes")
|
95 |
html = ""
|
96 |
-
html += f"<p>Runtime: {rt} minutes on CPU</p>"
|
97 |
if msg is not None:
|
98 |
html += f"<h2>WARNING:</h2><hr><b>{msg}</b><br><br>"
|
99 |
|
@@ -170,10 +170,10 @@ if __name__ == "__main__":
|
|
170 |
)
|
171 |
with gr.Row():
|
172 |
summary_type = gr.Radio(
|
173 |
-
choices=["
|
174 |
)
|
175 |
model_type = gr.Radio(
|
176 |
-
choices=["LongT5", "LED"], label="Model
|
177 |
)
|
178 |
num_beams = gr.Radio(
|
179 |
choices=[2, 3, 4],
|
@@ -247,13 +247,13 @@ if __name__ == "__main__":
|
|
247 |
output_text = gr.HTML("<p><em>Output will appear below:</em></p>")
|
248 |
gr.Markdown("### Summary Output")
|
249 |
summary_text = gr.Textbox(
|
250 |
-
label="Summary", placeholder="The generated
|
251 |
)
|
252 |
gr.Markdown(
|
253 |
"The compression rate indicates the ratio between the machine-generated summary length and the input text (from 0% to 100%). The higher the compression rate the more extreme the summary is."
|
254 |
)
|
255 |
compression_rate = gr.Textbox(
|
256 |
-
label="Compression rate π", placeholder="π will appear here"
|
257 |
)
|
258 |
|
259 |
gr.Markdown("---")
|
|
|
49 |
settings = {
|
50 |
"length_penalty": float(length_penalty),
|
51 |
"repetition_penalty": float(repetition_penalty),
|
52 |
+
"no_repeat_ngram_size": 3,
|
53 |
"encoder_no_repeat_ngram_size": 4,
|
54 |
"num_beams": int(num_beams),
|
55 |
"min_length": 11,
|
|
|
93 |
rt = round((time.perf_counter() - st) / 60, 2)
|
94 |
print(f"Runtime: {rt} minutes")
|
95 |
html = ""
|
96 |
+
html += f"<p>Runtime: {rt} minutes on CPU inference</p>"
|
97 |
if msg is not None:
|
98 |
html += f"<h2>WARNING:</h2><hr><b>{msg}</b><br><br>"
|
99 |
|
|
|
170 |
)
|
171 |
with gr.Row():
|
172 |
summary_type = gr.Radio(
|
173 |
+
choices=["TLDR", "Detailed"], label="Summary Type", value="Detailed"
|
174 |
)
|
175 |
model_type = gr.Radio(
|
176 |
+
choices=["LongT5", "LED"], label="Model Architecture", value="LongT5"
|
177 |
)
|
178 |
num_beams = gr.Radio(
|
179 |
choices=[2, 3, 4],
|
|
|
247 |
output_text = gr.HTML("<p><em>Output will appear below:</em></p>")
|
248 |
gr.Markdown("### Summary Output")
|
249 |
summary_text = gr.Textbox(
|
250 |
+
label="Summary π", placeholder="The generated π will appear here"
|
251 |
)
|
252 |
gr.Markdown(
|
253 |
"The compression rate indicates the ratio between the machine-generated summary length and the input text (from 0% to 100%). The higher the compression rate the more extreme the summary is."
|
254 |
)
|
255 |
compression_rate = gr.Textbox(
|
256 |
+
label="Compression rate π", placeholder="The π will appear here"
|
257 |
)
|
258 |
|
259 |
gr.Markdown("---")
|