Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't load bin factory without pytorch #10559

Open
jiangchengchengark opened this issue Oct 20, 2024 · 0 comments
Open

can't load bin factory without pytorch #10559

jiangchengchengark opened this issue Oct 20, 2024 · 0 comments

Comments

@jiangchengchengark
Copy link

Description


ModuleNotFoundError Traceback (most recent call last)
Cell In[5], line 1
----> 1 state_dict_1=flow.load('/home/aistudio/chinese-llama-2-7b/pytorch_model-00001-of-00002.bin')

File ~/external-libraries/oneflow/framework/check_point_v2.py:444, in load(path, global_src_rank, map_location, support_pytorch_format)
441 i = _broadcast_py_object(None, global_src_rank)
442 load = load_methods[i][1]
--> 444 return load(path, global_src_rank, map_location)
File ~/external-libraries/oneflow/framework/check_point_v2.py:345, in load_from_pytorch_file(path, global_src_rank, map_location)
338 @load_if(is_file_and_support_pytorch_format)
339 def load_from_pytorch_file(
340 path: Path,
341 global_src_rank=None,
342 map_location: Optional[Union[str, flow.device]] = None,
343 ):
344 with flow.mock_torch.disable():
--> 345 import torch
347 if global_src_rank is None or global_src_rank == flow.env.get_rank():
348 torch_obj = torch.load(path, map_location="cpu")

ModuleNotFoundError: No module named 'torch'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant