Spaces:
Runtime error
Runtime error
abdulmatinomotoso
commited on
Commit
•
626a615
1
Parent(s):
489b827
Update app.py
Browse files
app.py
CHANGED
@@ -47,11 +47,11 @@ def headline_generator_2(file):
|
|
47 |
|
48 |
with tokenizer_2.as_target_tokenizer():
|
49 |
batch = tokenizer_2(
|
50 |
-
input_text
|
51 |
)
|
52 |
|
53 |
translated = model_2.generate(**batch)
|
54 |
-
summary_2 = tokenizer_2.batch_decode(translated, skip_special_tokens=True)
|
55 |
return summary_2[0]
|
56 |
|
57 |
#creating an interface for the headline generator using gradio
|
|
|
47 |
|
48 |
with tokenizer_2.as_target_tokenizer():
|
49 |
batch = tokenizer_2(
|
50 |
+
input_text, truncation=True, padding="longest", return_tensors="pt"
|
51 |
)
|
52 |
|
53 |
translated = model_2.generate(**batch)
|
54 |
+
summary_2 = tokenizer_2.batch_decode(translated, skip_special_tokens=True, max_length=100)
|
55 |
return summary_2[0]
|
56 |
|
57 |
#creating an interface for the headline generator using gradio
|