Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Update modeling_auto.py
Browse files Browse the repository at this point in the history
Signed-off-by: Wang, Chang <[email protected]>
  • Loading branch information
changwangss authored Jun 27, 2024
1 parent 4ce5cf7 commit f1dc6b8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,10 @@ def forward(self, input: torch.Tensor) -> tuple[torch.Tensor, None]:
or device_map == "cpu"
or device_map == torch.device("cpu")
) and model.config.model_type == "mpt":
config = AutoConfig.from_pretrained("mosaicml_mpt-7b_config.json",
torchscript=True)
config = AutoConfig.from_pretrained(
os.path.join(os.path.dirname(__file__), "mosaicml_mpt-7b_config.json"),
torchscript=True
)
model.config = config
model.eval()
model_type = model.config.model_type.replace("_", "-")
Expand Down

0 comments on commit f1dc6b8

Please sign in to comment.