Adapt repository creation to latest hf_hub (#21158)
* Adapt repository creation to latest hf_hub * Update all examples * Fix other tests, add Flax examples * Address review comments
This commit is contained in:
@@ -39,7 +39,7 @@ from flax import struct, traverse_util
|
||||
from flax.jax_utils import pad_shard_unpad, replicate, unreplicate
|
||||
from flax.training import train_state
|
||||
from flax.training.common_utils import get_metrics, onehot, shard
|
||||
from huggingface_hub import Repository
|
||||
from huggingface_hub import Repository, create_repo
|
||||
from transformers import (
|
||||
AutoConfig,
|
||||
AutoTokenizer,
|
||||
@@ -350,7 +350,8 @@ def main():
|
||||
)
|
||||
else:
|
||||
repo_name = training_args.hub_model_id
|
||||
repo = Repository(training_args.output_dir, clone_from=repo_name)
|
||||
create_repo(repo_name, exist_ok=True, token=training_args.hub_token)
|
||||
repo = Repository(training_args.output_dir, clone_from=repo_name, token=training_args.hub_token)
|
||||
|
||||
# Get the datasets: you can either provide your own CSV/JSON training and evaluation files (see below)
|
||||
# or specify a GLUE benchmark task (the dataset will be downloaded automatically from the datasets Hub).
|
||||
|
||||
Reference in New Issue
Block a user