Update app.py
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ def proc_submission(
|
|
45 |
"""
|
46 |
|
47 |
settings_tldr = {
|
48 |
-
"length_penalty": 0.6,
|
49 |
"repetition_penalty": 3.5,
|
50 |
"no_repeat_ngram_size": 3,
|
51 |
"encoder_no_repeat_ngram_size": 4,
|
@@ -79,7 +79,7 @@ def proc_submission(
|
|
79 |
tr_in = input_text
|
80 |
msg = None
|
81 |
|
82 |
-
if summary_type == "TLDR":
|
83 |
_summaries = summarize_via_tokenbatches(
|
84 |
tr_in,
|
85 |
model_led_tldr if (model_type == "LED") else model_tldr,
|
@@ -88,14 +88,14 @@ def proc_submission(
|
|
88 |
**settings_tldr,
|
89 |
)
|
90 |
|
91 |
-
else:
|
92 |
-
_summaries = summarize_via_tokenbatches(
|
93 |
-
tr_in,
|
94 |
-
model_led_det if (model_type == "LED") else model_det,
|
95 |
-
tokenizer_led_det if (model_type == "LED") else tokenizer_det,
|
96 |
-
batch_length=token_batch_length,
|
97 |
-
|
98 |
-
)
|
99 |
#_summaries = summarize_via_tokenbatches(
|
100 |
#tr_in,
|
101 |
#model_tldr if (summary_type == "TLDR") else model_det,
|
|
|
45 |
"""
|
46 |
|
47 |
settings_tldr = {
|
48 |
+
"length_penalty": float(length_penalty),#0.6,
|
49 |
"repetition_penalty": 3.5,
|
50 |
"no_repeat_ngram_size": 3,
|
51 |
"encoder_no_repeat_ngram_size": 4,
|
|
|
79 |
tr_in = input_text
|
80 |
msg = None
|
81 |
|
82 |
+
if (summary_type == "TLDR"):
|
83 |
_summaries = summarize_via_tokenbatches(
|
84 |
tr_in,
|
85 |
model_led_tldr if (model_type == "LED") else model_tldr,
|
|
|
88 |
**settings_tldr,
|
89 |
)
|
90 |
|
91 |
+
#else:
|
92 |
+
#_summaries = summarize_via_tokenbatches(
|
93 |
+
#tr_in,
|
94 |
+
#model_led_det if (model_type == "LED") else model_det,
|
95 |
+
#tokenizer_led_det if (model_type == "LED") else tokenizer_det,
|
96 |
+
#batch_length=token_batch_length,
|
97 |
+
#**settings_det,
|
98 |
+
#)
|
99 |
#_summaries = summarize_via_tokenbatches(
|
100 |
#tr_in,
|
101 |
#model_tldr if (summary_type == "TLDR") else model_det,
|