Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 53140c8

Browse files
authored
Merge branch 'main' into custom_path_args
2 parents 7a0ff74 + 75b877a commit 53140c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

torchchat/cli/convert_hf_checkpoint.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
import torch
1414

15+
from torchchat.model import TransformerArgs
16+
1517
# support running without installing as a package
1618
wd = Path(__file__).parent.parent
1719
sys.path.append(str(wd.resolve()))
@@ -32,7 +34,8 @@ def convert_hf_checkpoint(
3234
if model_name is None:
3335
model_name = model_dir.name
3436

35-
config = ModelArgs.from_name(model_name).transformer_args['text']
37+
config_args = ModelArgs.from_name(model_name).transformer_args['text']
38+
config = TransformerArgs.from_params(config_args)
3639
print(f"Model config {config.__dict__}")
3740

3841
# Load the json file containing weight mapping

0 commit comments

Comments
 (0)