Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Peter
commited on
Commit
·
7a2e137
1
Parent(s):
d14d72d
remove re-showing input, increase max words
Browse files
app.py
CHANGED
|
@@ -27,7 +27,7 @@ def proc_submission(
|
|
| 27 |
length_penalty,
|
| 28 |
repetition_penalty,
|
| 29 |
no_repeat_ngram_size,
|
| 30 |
-
max_input_length: int =
|
| 31 |
):
|
| 32 |
"""
|
| 33 |
proc_submission - a helper function for the gradio module
|
|
@@ -78,8 +78,8 @@ def proc_submission(
|
|
| 78 |
]
|
| 79 |
|
| 80 |
history["Summary Text"] = "<br>".join(sum_text)
|
| 81 |
-
history["Summary Scores"] = "
|
| 82 |
-
history["
|
| 83 |
html = ""
|
| 84 |
rt = round((time.perf_counter() - st) / 60, 2)
|
| 85 |
print(f"Runtime: {rt} minutes")
|
|
|
|
| 27 |
length_penalty,
|
| 28 |
repetition_penalty,
|
| 29 |
no_repeat_ngram_size,
|
| 30 |
+
max_input_length: int = 768,
|
| 31 |
):
|
| 32 |
"""
|
| 33 |
proc_submission - a helper function for the gradio module
|
|
|
|
| 78 |
]
|
| 79 |
|
| 80 |
history["Summary Text"] = "<br>".join(sum_text)
|
| 81 |
+
history["Summary Scores"] = "The summary scores can be thought of as representing the quality of the summary. less-negative numbers (closer to 0) are better.<br><br>"
|
| 82 |
+
history["Summary Scores"] += "\n".join(sum_scores)
|
| 83 |
html = ""
|
| 84 |
rt = round((time.perf_counter() - st) / 60, 2)
|
| 85 |
print(f"Runtime: {rt} minutes")
|
utils.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
utils.py - Utility functions for the project.
|
| 3 |
"""
|
| 4 |
|
| 5 |
-
|
| 6 |
from pathlib import Path
|
| 7 |
import re
|
| 8 |
|
|
@@ -39,6 +39,7 @@ def load_examples(src):
|
|
| 39 |
src = Path(src)
|
| 40 |
src.mkdir(exist_ok=True)
|
| 41 |
examples = [f for f in src.glob("*.txt")]
|
|
|
|
| 42 |
# load the examples into a list
|
| 43 |
text_examples = []
|
| 44 |
for example in examples:
|
|
|
|
| 2 |
utils.py - Utility functions for the project.
|
| 3 |
"""
|
| 4 |
|
| 5 |
+
from natsort import natsorted
|
| 6 |
from pathlib import Path
|
| 7 |
import re
|
| 8 |
|
|
|
|
| 39 |
src = Path(src)
|
| 40 |
src.mkdir(exist_ok=True)
|
| 41 |
examples = [f for f in src.glob("*.txt")]
|
| 42 |
+
examples = natsorted(examples)
|
| 43 |
# load the examples into a list
|
| 44 |
text_examples = []
|
| 45 |
for example in examples:
|