@@ -41,7 +41,6 @@ def save_torch_model(
4141 max_shard_size : Union [int , str ] = MAX_SHARD_SIZE ,
4242 metadata : Optional [Dict [str , str ]] = None ,
4343 safe_serialization : bool = True ,
44- is_main_process : bool = True ,
4544 shared_tensors_to_discard : Optional [List [str ]] = None ,
4645):
4746 """
@@ -96,10 +95,6 @@ def save_torch_model(
9695 Whether to save as safetensors, which is the default behavior. If `False`, the shards are saved as pickle.
9796 Safe serialization is recommended for security reasons. Saving as pickle is deprecated and will be removed
9897 in a future version.
99- is_main_process (`bool`, *optional*):
100- Whether the process calling this is the main process or not. Useful when in distributed training like
101- TPUs and need to call this function from all processes. In this case, set `is_main_process=True` only on
102- the main process to avoid race conditions. Defaults to True.
10398 shared_tensors_to_discard (`List[str]`, *optional*):
10499 List of tensor names to drop when saving shared tensors. If not provided and shared tensors are
105100 detected, it will drop the first name alphabetically.
@@ -127,7 +122,6 @@ def save_torch_model(
127122 metadata = metadata ,
128123 safe_serialization = safe_serialization ,
129124 save_directory = save_directory ,
130- is_main_process = is_main_process ,
131125 shared_tensors_to_discard = shared_tensors_to_discard ,
132126 )
133127
@@ -141,7 +135,6 @@ def save_torch_state_dict(
141135 max_shard_size : Union [int , str ] = MAX_SHARD_SIZE ,
142136 metadata : Optional [Dict [str , str ]] = None ,
143137 safe_serialization : bool = True ,
144- is_main_process : bool = True ,
145138 shared_tensors_to_discard : Optional [List [str ]] = None ,
146139) -> None :
147140 """
@@ -196,10 +189,6 @@ def save_torch_state_dict(
196189 Whether to save as safetensors, which is the default behavior. If `False`, the shards are saved as pickle.
197190 Safe serialization is recommended for security reasons. Saving as pickle is deprecated and will be removed
198191 in a future version.
199- is_main_process (`bool`, *optional*):
200- Whether the process calling this is the main process or not. Useful when in distributed training like
201- TPUs and need to call this function from all processes. In this case, set `is_main_process=True` only on
202- the main process to avoid race conditions. Defaults to True.
203192 shared_tensors_to_discard (`List[str]`, *optional*):
204193 List of tensor names to drop when saving shared tensors. If not provided and shared tensors are
205194 detected, it will drop the first name alphabetically.
0 commit comments