Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,8 @@ def generate_headline(text):
|
|
13 |
input = prefix + text
|
14 |
inputs = tokenizer(input, return_tensors = "pt", max_length = 128, truncation = True).input_ids
|
15 |
generation_config = GenerationConfig(temperature = 1.2,
|
16 |
-
encoder_no_repeat_ngram_size = 4
|
|
|
17 |
outputs = headline.generate(inputs, do_sample = True, generation_config = generation_config)
|
18 |
|
19 |
return tokenizer.decode(outputs[0], skip_special_tokens = True)
|
|
|
13 |
input = prefix + text
|
14 |
inputs = tokenizer(input, return_tensors = "pt", max_length = 128, truncation = True).input_ids
|
15 |
generation_config = GenerationConfig(temperature = 1.2,
|
16 |
+
encoder_no_repeat_ngram_size = 4,
|
17 |
+
min_length = 4)
|
18 |
outputs = headline.generate(inputs, do_sample = True, generation_config = generation_config)
|
19 |
|
20 |
return tokenizer.decode(outputs[0], skip_special_tokens = True)
|