Skip to content

can't load bin factory without pytorch #10559

Open
@jiangchengchengark

Description

@jiangchengchengark

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions