add prompt
Browse files
aiSum.py
CHANGED
|
@@ -18,7 +18,7 @@ class Sum():
|
|
| 18 |
def summarize(text_to_summarize):
|
| 19 |
# Tokenize our text
|
| 20 |
# If you want to run the code in Tensorflow, please remember to return the particular tensors as simply as using return_tensors = 'tf'
|
| 21 |
-
input_ids = tokenizer(text_to_summarize, return_tensors="pt").input_ids
|
| 22 |
|
| 23 |
# Generate the output (Here, we use beam search but you can also use any other strategy you like)
|
| 24 |
output = model.generate(
|
|
|
|
| 18 |
def summarize(text_to_summarize):
|
| 19 |
# Tokenize our text
|
| 20 |
# If you want to run the code in Tensorflow, please remember to return the particular tensors as simply as using return_tensors = 'tf'
|
| 21 |
+
input_ids = tokenizer(f"Summarize: {text_to_summarize}", return_tensors="pt").input_ids
|
| 22 |
|
| 23 |
# Generate the output (Here, we use beam search but you can also use any other strategy you like)
|
| 24 |
output = model.generate(
|