Pierce Maloney
commited on
Commit
•
813fd4a
1
Parent(s):
355a0ec
bug + only new tokens
Browse files- handler.py +3 -2
handler.py
CHANGED
@@ -79,11 +79,12 @@ class EndpointHandler():
|
|
79 |
|
80 |
# Generate text using the pipeline
|
81 |
generation_kwargs = {
|
82 |
-
"
|
83 |
"temperature": 0.7,
|
84 |
"top_k": 40,
|
85 |
"bad_words_ids": bad_words_ids,
|
86 |
-
|
|
|
87 |
}
|
88 |
generated_outputs = self.text_generation_pipeline(inputs, **generation_kwargs)
|
89 |
|
|
|
79 |
|
80 |
# Generate text using the pipeline
|
81 |
generation_kwargs = {
|
82 |
+
"max_new_tokens": 75,
|
83 |
"temperature": 0.7,
|
84 |
"top_k": 40,
|
85 |
"bad_words_ids": bad_words_ids,
|
86 |
+
"pad_token_id": self.tokenizer.eos_token_id,
|
87 |
+
"return_full_text": False, # Only return the new generated tokens
|
88 |
}
|
89 |
generated_outputs = self.text_generation_pipeline(inputs, **generation_kwargs)
|
90 |
|