support system column #1765

Former-commit-id: 0a9c6e0146
This commit is contained in:
hiyouga
2023-12-12 19:45:59 +08:00
parent cefc0b2f03
commit 1a0bdd305c
15 changed files with 45 additions and 87 deletions

View File

@@ -217,7 +217,7 @@ def load_model_and_tokenizer(
# Prepare model for inference
if not is_trainable:
model.requires_grad_(False) # fix all model params
model = model.to(model_args.compute_dtype) if model_args.quantization_bit is None else model
model = model.to(model_args.compute_dtype) if not getattr(model, "quantization_method", None) else model
model.eval()
else:
model.train()