Update llama.py
This commit is contained in:
parent
72e1b03544
commit
ba515ec92d
1 changed files with 8 additions and 1 deletions
|
|
@ -1068,7 +1068,14 @@ def _wrap_fast_inference(generate, device_type, dtype, model):
|
|||
# For newer HF
|
||||
kwargs["cache_implementation"] = "dynamic"
|
||||
|
||||
print(kwargs)
|
||||
# Remove token_type_ids
|
||||
kwargs.pop("token_type_ids", None)
|
||||
|
||||
# Check pad_token
|
||||
kwargs["pad_token_id"] = kwargs.pop(
|
||||
"pad_token_id",
|
||||
getattr(model.config, "eos_token_id", None),
|
||||
)
|
||||
|
||||
# Set pad token
|
||||
# old_pad_token_id = getattr(model.config, "pad_token_id", None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue