Spaces:
Runtime error
Runtime error
remove model-specific length limits
Browse filesthis enables pegasus-x to use 2048 word input
app.py
CHANGED
@@ -89,7 +89,7 @@ def proc_submission(
|
|
89 |
length_penalty: float,
|
90 |
repetition_penalty: float,
|
91 |
no_repeat_ngram_size: int,
|
92 |
-
max_input_length: int =
|
93 |
):
|
94 |
"""
|
95 |
proc_submission - a helper function for the gradio module to process submissions
|
@@ -102,7 +102,7 @@ def proc_submission(
|
|
102 |
length_penalty (float): the length penalty to use
|
103 |
repetition_penalty (float): the repetition penalty to use
|
104 |
no_repeat_ngram_size (int): the no repeat ngram size to use
|
105 |
-
max_input_length (int, optional): the maximum input length to use. Defaults to
|
106 |
|
107 |
Returns:
|
108 |
str in HTML format, string of the summary, str of score
|
@@ -122,7 +122,6 @@ def proc_submission(
|
|
122 |
st = time.perf_counter()
|
123 |
history = {}
|
124 |
clean_text = clean(input_text, lower=False)
|
125 |
-
max_input_length = 2048 if "base" in model_name.lower() else max_input_length
|
126 |
processed = truncate_word_count(clean_text, max_words=max_input_length)
|
127 |
|
128 |
if processed["was_truncated"]:
|
|
|
89 |
length_penalty: float,
|
90 |
repetition_penalty: float,
|
91 |
no_repeat_ngram_size: int,
|
92 |
+
max_input_length: int = 2048,
|
93 |
):
|
94 |
"""
|
95 |
proc_submission - a helper function for the gradio module to process submissions
|
|
|
102 |
length_penalty (float): the length penalty to use
|
103 |
repetition_penalty (float): the repetition penalty to use
|
104 |
no_repeat_ngram_size (int): the no repeat ngram size to use
|
105 |
+
max_input_length (int, optional): the maximum input length to use. Defaults to 2048.
|
106 |
|
107 |
Returns:
|
108 |
str in HTML format, string of the summary, str of score
|
|
|
122 |
st = time.perf_counter()
|
123 |
history = {}
|
124 |
clean_text = clean(input_text, lower=False)
|
|
|
125 |
processed = truncate_word_count(clean_text, max_words=max_input_length)
|
126 |
|
127 |
if processed["was_truncated"]:
|