Update save.py
This commit is contained in:
parent
1663248c35
commit
0d80335998
1 changed files with 9 additions and 6 deletions
|
|
@ -528,13 +528,16 @@ def unsloth_save_model(
|
|||
|
||||
# First check if we're pushing to an organization!
|
||||
save_directory = save_pretrained_settings["save_directory"]
|
||||
new_save_directory, new_username = _determine_username(save_directory, username, token)
|
||||
|
||||
if token is not None:
|
||||
from huggingface_hub import whoami
|
||||
actual_username = whoami(token = token)["name"]
|
||||
else:
|
||||
actual_username = username
|
||||
if save_pretrained_settings["push_to_hub"]:
|
||||
new_save_directory, new_username = _determine_username(save_directory, username, token)
|
||||
|
||||
if token is not None:
|
||||
from huggingface_hub import whoami
|
||||
actual_username = whoami(token = token)["name"]
|
||||
else:
|
||||
actual_username = username
|
||||
pass
|
||||
|
||||
# Check if pushing to an organization
|
||||
if save_pretrained_settings["push_to_hub"] and (username != actual_username):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue