Skip to content

Commit

Permalink
fix device type
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin committed Mar 5, 2024
1 parent bab680d commit d723ff7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bindings/python/py_src/safetensors/paddle.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def load_file(filename: Union[str, os.PathLike], device="cpu") -> Dict[str, padd
Args:
filename (`str`, or `os.PathLike`)):
The name of the file which contains the tensors
device (`Dict[str, any]`, *optional*, defaults to `cpu`):
device (`Union[Dict[str, any], str]`, *optional*, defaults to `cpu`):
The device where the tensors need to be located after load.
available options are all regular paddle device locations
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/py_src/safetensors/torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def load_model(model: torch.nn.Module, filename: Union[str, os.PathLike], strict
strict (`bool`, *optional*, defaults to True):
Whether to fail if you're missing keys or having unexpected ones.
When false, the function simply returns missing and unexpected names.
device (`Dict[str, any]`, *optional*, defaults to `cpu`):
device (`Union[Dict[str, any], str]`, *optional*, defaults to `cpu`):
The device where the tensors need to be located after load.
available options are all regular torch device locations.
Expand Down Expand Up @@ -291,7 +291,7 @@ def load_file(filename: Union[str, os.PathLike], device="cpu") -> Dict[str, torc
Args:
filename (`str`, or `os.PathLike`):
The name of the file which contains the tensors
device (`Dict[str, any]`, *optional*, defaults to `cpu`):
device (`Union[Dict[str, any], str]`, *optional*, defaults to `cpu`):
The device where the tensors need to be located after load.
available options are all regular torch device locations.
Expand Down

0 comments on commit d723ff7

Please sign in to comment.