Skip to content

Commit

Permalink
add str hub token to repository when provided else fallback to default (
Browse files Browse the repository at this point in the history
huggingface#14682)

* add str hub token to repository when provided else fallback to default True

* make style
  • Loading branch information
philschmid authored Dec 9, 2021
1 parent 7375758 commit da7aabf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/transformers/keras_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ def __init__(
hub_model_id = output_dir.absolute().name
if "/" not in hub_model_id:
hub_model_id = get_full_repo_name(hub_model_id, token=hub_token)

self.output_dir = output_dir
self.repo = Repository(str(output_dir), clone_from=hub_model_id)
self.repo = Repository(
str(output_dir), clone_from=hub_model_id, use_auth_token=hub_token if hub_token else True
)
self.tokenizer = tokenizer
self.last_job = None
self.checkpoint = checkpoint
Expand Down

0 comments on commit da7aabf

Please sign in to comment.