Unverified Commit 0763a7ed authored by Lucain's avatar Lucain Committed by GitHub
Browse files

Let server decide default repo visibility (#10047)

parent 963ffca4
...@@ -75,7 +75,7 @@ For convenience, create a `TrainingConfig` class containing the training hyperpa ...@@ -75,7 +75,7 @@ For convenience, create a `TrainingConfig` class containing the training hyperpa
... push_to_hub = True # whether to upload the saved model to the HF Hub ... push_to_hub = True # whether to upload the saved model to the HF Hub
... hub_model_id = "<your-username>/<my-awesome-model>" # the name of the repository to create on the HF Hub ... hub_model_id = "<your-username>/<my-awesome-model>" # the name of the repository to create on the HF Hub
... hub_private_repo = False ... hub_private_repo = None
... overwrite_output_dir = True # overwrite the old model when re-running the notebook ... overwrite_output_dir = True # overwrite the old model when re-running the notebook
... seed = 0 ... seed = 0
......
...@@ -76,7 +76,7 @@ huggingface-cli login ...@@ -76,7 +76,7 @@ huggingface-cli login
... output_dir = "ddpm-butterflies-128" # 로컬 및 HF Hub에 저장되는 모델명 ... output_dir = "ddpm-butterflies-128" # 로컬 및 HF Hub에 저장되는 모델명
... push_to_hub = True # 저장된 모델을 HF Hub에 업로드할지 여부 ... push_to_hub = True # 저장된 모델을 HF Hub에 업로드할지 여부
... hub_private_repo = False ... hub_private_repo = None
... overwrite_output_dir = True # 노트북을 다시 실행할 때 이전 모델에 덮어씌울지 ... overwrite_output_dir = True # 노트북을 다시 실행할 때 이전 모델에 덮어씌울지
... seed = 0 ... seed = 0
......
...@@ -170,7 +170,7 @@ class ConfigMixin: ...@@ -170,7 +170,7 @@ class ConfigMixin:
if push_to_hub: if push_to_hub:
commit_message = kwargs.pop("commit_message", None) commit_message = kwargs.pop("commit_message", None)
private = kwargs.pop("private", False) private = kwargs.pop("private", None)
create_pr = kwargs.pop("create_pr", False) create_pr = kwargs.pop("create_pr", False)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
repo_id = kwargs.pop("repo_id", save_directory.split(os.path.sep)[-1]) repo_id = kwargs.pop("repo_id", save_directory.split(os.path.sep)[-1])
......
...@@ -530,7 +530,7 @@ class FlaxModelMixin(PushToHubMixin): ...@@ -530,7 +530,7 @@ class FlaxModelMixin(PushToHubMixin):
if push_to_hub: if push_to_hub:
commit_message = kwargs.pop("commit_message", None) commit_message = kwargs.pop("commit_message", None)
private = kwargs.pop("private", False) private = kwargs.pop("private", None)
create_pr = kwargs.pop("create_pr", False) create_pr = kwargs.pop("create_pr", False)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
repo_id = kwargs.pop("repo_id", save_directory.split(os.path.sep)[-1]) repo_id = kwargs.pop("repo_id", save_directory.split(os.path.sep)[-1])
......
...@@ -338,7 +338,7 @@ class ModelMixin(torch.nn.Module, PushToHubMixin): ...@@ -338,7 +338,7 @@ class ModelMixin(torch.nn.Module, PushToHubMixin):
if push_to_hub: if push_to_hub:
commit_message = kwargs.pop("commit_message", None) commit_message = kwargs.pop("commit_message", None)
private = kwargs.pop("private", False) private = kwargs.pop("private", None)
create_pr = kwargs.pop("create_pr", False) create_pr = kwargs.pop("create_pr", False)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
repo_id = kwargs.pop("repo_id", save_directory.split(os.path.sep)[-1]) repo_id = kwargs.pop("repo_id", save_directory.split(os.path.sep)[-1])
......
...@@ -180,7 +180,7 @@ class FlaxDiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -180,7 +180,7 @@ class FlaxDiffusionPipeline(ConfigMixin, PushToHubMixin):
if push_to_hub: if push_to_hub:
commit_message = kwargs.pop("commit_message", None) commit_message = kwargs.pop("commit_message", None)
private = kwargs.pop("private", False) private = kwargs.pop("private", None)
create_pr = kwargs.pop("create_pr", False) create_pr = kwargs.pop("create_pr", False)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
repo_id = kwargs.pop("repo_id", save_directory.split(os.path.sep)[-1]) repo_id = kwargs.pop("repo_id", save_directory.split(os.path.sep)[-1])
......
...@@ -229,7 +229,7 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -229,7 +229,7 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
if push_to_hub: if push_to_hub:
commit_message = kwargs.pop("commit_message", None) commit_message = kwargs.pop("commit_message", None)
private = kwargs.pop("private", False) private = kwargs.pop("private", None)
create_pr = kwargs.pop("create_pr", False) create_pr = kwargs.pop("create_pr", False)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
repo_id = kwargs.pop("repo_id", save_directory.split(os.path.sep)[-1]) repo_id = kwargs.pop("repo_id", save_directory.split(os.path.sep)[-1])
......
...@@ -564,7 +564,8 @@ class PushToHubMixin: ...@@ -564,7 +564,8 @@ class PushToHubMixin:
commit_message (`str`, *optional*): commit_message (`str`, *optional*):
Message to commit while pushing. Default to `"Upload {object}"`. Message to commit while pushing. Default to `"Upload {object}"`.
private (`bool`, *optional*): private (`bool`, *optional*):
Whether or not the repository created should be private. Whether to make the repo private. If `None` (default), the repo will be public unless the
organization's default is private. This value is ignored if the repo already exists.
token (`str`, *optional*): token (`str`, *optional*):
The token to use as HTTP bearer authorization for remote files. The token generated when running The token to use as HTTP bearer authorization for remote files. The token generated when running
`huggingface-cli login` (stored in `~/.huggingface`). `huggingface-cli login` (stored in `~/.huggingface`).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment