Crystalcareai
commited on
Update generate.py
Browse files- generate.py +3 -3
generate.py
CHANGED
@@ -228,9 +228,9 @@ def generate(
|
|
228 |
**model_kwargs,
|
229 |
)
|
230 |
|
|
|
|
|
231 |
if dynamic_temperature is not None:
|
232 |
-
# Decode the generated token IDs into text
|
233 |
-
generated_text = self.tokenizer.decode(generated_token_ids[0], skip_special_tokens=True)
|
234 |
return generated_text
|
235 |
else:
|
236 |
-
return generated_token_ids
|
|
|
228 |
**model_kwargs,
|
229 |
)
|
230 |
|
231 |
+
generated_text = self.tokenizer.decode(generated_token_ids[0], skip_special_tokens=True)
|
232 |
+
|
233 |
if dynamic_temperature is not None:
|
|
|
|
|
234 |
return generated_text
|
235 |
else:
|
236 |
+
return generated_token_ids, generated_text
|