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

Commit 7ec018a

Browse files
committed
hack PTEModel to have same config hirearchy as Model
1 parent cc8b4d6 commit 7ec018a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

torchchat/model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,10 @@ def __init__(self, config, path) -> None:
779779
super().__init__()
780780
self.config = config
781781
self.model_ = exec_lib._load_for_executorch(str(path))
782+
783+
# A hacky way to get the model config from the self.model, making it consistent with Model class
784+
# TODO: remove the hacky way once get rid of model.model
785+
self.model = type('model', (), {'config': self.config})
782786

783787
def forward(self, x, input_pos):
784788
# model_.forward expects inputs to be wrapped in a tuple

0 commit comments

Comments
 (0)