alert pad_token source
Former-commit-id: f26a84e0d927d2554890daf431a93652e18f4235
This commit is contained in:
@@ -154,7 +154,7 @@ def load_model_and_tokenizer(
|
||||
model.generate = MethodType(PreTrainedModel.generate, model)
|
||||
|
||||
# Fix LM head (for ChatGLM2)
|
||||
if not hasattr(model, "lm_head"):
|
||||
if not hasattr(model, "lm_head") and hasattr(model, "transformer"):
|
||||
setattr(model, "lm_head", model.transformer.output_layer)
|
||||
|
||||
# Register auto class to save the custom code files.
|
||||
|
||||
Reference in New Issue
Block a user