Skip to content

Commit da7aabf

Browse files
authored
add str hub token to repository when provided else fallback to default (huggingface#14682)
* add str hub token to repository when provided else fallback to default True * make style
1 parent 7375758 commit da7aabf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/transformers/keras_callbacks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ def __init__(
6868
hub_model_id = output_dir.absolute().name
6969
if "/" not in hub_model_id:
7070
hub_model_id = get_full_repo_name(hub_model_id, token=hub_token)
71+
7172
self.output_dir = output_dir
72-
self.repo = Repository(str(output_dir), clone_from=hub_model_id)
73+
self.repo = Repository(
74+
str(output_dir), clone_from=hub_model_id, use_auth_token=hub_token if hub_token else True
75+
)
7376
self.tokenizer = tokenizer
7477
self.last_job = None
7578
self.checkpoint = checkpoint

0 commit comments

Comments
 (0)