[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
7660d647e4
commit
40de1d6407
1 changed files with 5 additions and 3 deletions
|
|
@ -2734,11 +2734,13 @@ def make_fast_generate_wrapper(original_generate):
|
|||
"Unsloth: Passing text strings to `fast_generate` on AMD "
|
||||
"requires a tokenizer attached to the model."
|
||||
)
|
||||
texts = [first_arg] if isinstance(first_arg, str) else list(first_arg)
|
||||
texts = (
|
||||
[first_arg] if isinstance(first_arg, str) else list(first_arg)
|
||||
)
|
||||
tokens = tokenizer(
|
||||
texts,
|
||||
return_tensors="pt",
|
||||
padding=True,
|
||||
return_tensors = "pt",
|
||||
padding = True,
|
||||
)
|
||||
tokens = tokens.to(model.device)
|
||||
return original_generate(**tokens, **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue