We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fac1035 commit 5f881acCopy full SHA for 5f881ac
swift/llm/utils/model.py
@@ -540,6 +540,11 @@ def get_model_tokenizer_baichuan2(model_dir: str,
540
load_model: bool = True,
541
model_config=None,
542
**kwargs):
543
+ if model_config is None:
544
+ model_config = AutoConfig.from_pretrained(
545
+ model_dir, trust_remote_code=True)
546
+ if not hasattr(model_config, 'z_loss_weight'):
547
+ model_config.z_loss_weight = 0
548
model, tokenizer = get_model_tokenizer_from_repo(
549
model_dir,
550
torch_dtype,
0 commit comments