Spaces:
Runtime error
Runtime error
Commit
·
cb217fc
1
Parent(s):
990b5e2
Update app.py
Browse files
app.py
CHANGED
|
@@ -312,7 +312,7 @@ def proc_submission(
|
|
| 312 |
settings["remove_stopwords"] = predrop_stopwords
|
| 313 |
settings["model_name"] = model_name
|
| 314 |
saved_file = saves_summary(summarize_output=_summaries, outpath=None, **settings)
|
| 315 |
-
return html, full_summary, saved_file
|
| 316 |
|
| 317 |
|
| 318 |
def load_single_example_text(
|
|
@@ -571,14 +571,14 @@ if __name__ == "__main__":
|
|
| 571 |
type="file",
|
| 572 |
interactive=False,
|
| 573 |
)
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
with gr.Column(variant="panel"):
|
| 583 |
gr.Markdown("### **Summary Output**")
|
| 584 |
summary_text = gr.HTML(
|
|
@@ -611,19 +611,19 @@ if __name__ == "__main__":
|
|
| 611 |
# )
|
| 612 |
|
| 613 |
gr.Markdown("---")
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
-
|
| 620 |
-
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
|
| 627 |
# token_batch_length = gr.Radio(
|
| 628 |
# choices=TOKEN_BATCH_OPTIONS,
|
| 629 |
# label="token batch length",
|
|
@@ -673,9 +673,10 @@ if __name__ == "__main__":
|
|
| 673 |
fn=proc_submission,
|
| 674 |
inputs=[
|
| 675 |
input_text,
|
| 676 |
-
model_name
|
|
|
|
| 677 |
],
|
| 678 |
-
outputs=[output_text, summary_text, text_file],
|
| 679 |
)
|
| 680 |
# aggregate_button.click(
|
| 681 |
# fn=aggregate_text,
|
|
|
|
| 312 |
settings["remove_stopwords"] = predrop_stopwords
|
| 313 |
settings["model_name"] = model_name
|
| 314 |
saved_file = saves_summary(summarize_output=_summaries, outpath=None, **settings)
|
| 315 |
+
return html, full_summary,scores_out, saved_file
|
| 316 |
|
| 317 |
|
| 318 |
def load_single_example_text(
|
|
|
|
| 571 |
type="file",
|
| 572 |
interactive=False,
|
| 573 |
)
|
| 574 |
+
with gr.Column(variant="compact"):
|
| 575 |
+
gr.Markdown(
|
| 576 |
+
"Scores **roughly** represent the summary quality as a measure of the model's 'confidence'. less-negative numbers (closer to 0) are better."
|
| 577 |
+
)
|
| 578 |
+
summary_scores = gr.Textbox(
|
| 579 |
+
label="Summary Scores",
|
| 580 |
+
placeholder="Summary scores will appear here",
|
| 581 |
+
)
|
| 582 |
with gr.Column(variant="panel"):
|
| 583 |
gr.Markdown("### **Summary Output**")
|
| 584 |
summary_text = gr.HTML(
|
|
|
|
| 611 |
# )
|
| 612 |
|
| 613 |
gr.Markdown("---")
|
| 614 |
+
with gr.Column():
|
| 615 |
+
gr.Markdown("### Advanced Settings")
|
| 616 |
+
# gr.Markdown(
|
| 617 |
+
# "Refer to [the guide doc](https://gist.github.com/pszemraj/722a7ba443aa3a671b02d87038375519) for what these are, and how they impact _quality_ and _speed_."
|
| 618 |
+
# )
|
| 619 |
+
with gr.Row(variant="compact"):
|
| 620 |
+
length_penalty = gr.Slider(
|
| 621 |
+
minimum=0.3,
|
| 622 |
+
maximum=1.1,
|
| 623 |
+
label="length penalty",
|
| 624 |
+
value=0.7,
|
| 625 |
+
step=0.05,
|
| 626 |
+
)
|
| 627 |
# token_batch_length = gr.Radio(
|
| 628 |
# choices=TOKEN_BATCH_OPTIONS,
|
| 629 |
# label="token batch length",
|
|
|
|
| 673 |
fn=proc_submission,
|
| 674 |
inputs=[
|
| 675 |
input_text,
|
| 676 |
+
model_name,
|
| 677 |
+
length_penalty
|
| 678 |
],
|
| 679 |
+
outputs=[output_text, summary_text,summary_scores, text_file],
|
| 680 |
)
|
| 681 |
# aggregate_button.click(
|
| 682 |
# fn=aggregate_text,
|