Spaces:
Runtime error
Runtime error
tune encoding properties
Browse files- summarize.py +1 -1
summarize.py
CHANGED
@@ -41,7 +41,7 @@ def bart_summarize(text: str):
|
|
41 |
for chunk in input_chunks:
|
42 |
# encode the input chunk
|
43 |
|
44 |
-
encoded_input = tokenizer.encode(chunk, max_length=max_length,
|
45 |
|
46 |
# generate summary for the input chunk
|
47 |
summary_ids = model.generate(encoded_input, max_length=300, num_beams=4, early_stopping=True)
|
|
|
41 |
for chunk in input_chunks:
|
42 |
# encode the input chunk
|
43 |
|
44 |
+
encoded_input = tokenizer.encode(chunk, max_length=max_length, return_tensors='tf')
|
45 |
|
46 |
# generate summary for the input chunk
|
47 |
summary_ids = model.generate(encoded_input, max_length=300, num_beams=4, early_stopping=True)
|