Spaces:
Sleeping
Sleeping
Peter
commited on
Commit
•
281a517
1
Parent(s):
ca046ea
debug
Browse files- app.py +1 -1
- summarize.py +3 -0
app.py
CHANGED
@@ -118,7 +118,7 @@ def load_examples(examples_dir="examples"):
|
|
118 |
for example in examples:
|
119 |
with open(example, "r") as f:
|
120 |
text = f.read()
|
121 |
-
text_examples.append([text, 4,
|
122 |
|
123 |
return text_examples
|
124 |
|
|
|
118 |
for example in examples:
|
119 |
with open(example, "r") as f:
|
120 |
text = f.read()
|
121 |
+
text_examples.append([text, 4, 0.7, 2048, 3.5, 3])
|
122 |
|
123 |
return text_examples
|
124 |
|
summarize.py
CHANGED
@@ -91,6 +91,9 @@ def summarize_via_tokenbatches(
|
|
91 |
str: the summary
|
92 |
"""
|
93 |
# log all input parameters
|
|
|
|
|
|
|
94 |
print(f"input parameters: {kwargs}, batch_length={batch_length}, batch_stride={batch_stride}")
|
95 |
encoded_input = tokenizer(
|
96 |
input_text,
|
|
|
91 |
str: the summary
|
92 |
"""
|
93 |
# log all input parameters
|
94 |
+
if batch_length < 512:
|
95 |
+
batch_length = 512
|
96 |
+
print("WARNING: batch_length was set to 512")
|
97 |
print(f"input parameters: {kwargs}, batch_length={batch_length}, batch_stride={batch_stride}")
|
98 |
encoded_input = tokenizer(
|
99 |
input_text,
|