Skip to content

Commit 159885a

Browse files
authored
correct hub_token exposition behaviour (thanks to @bghira). (#6918)
1 parent 7337eea commit 159885a

File tree

43 files changed

+262
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+262
-0
lines changed

examples/advanced_diffusion_training/train_dreambooth_lora_sd15_advanced.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,12 @@ def encode_prompt(text_encoders, tokenizers, prompt, text_input_ids_list=None):
10161016

10171017

10181018
def main(args):
1019+
if args.report_to == "wandb" and args.hub_token is not None:
1020+
raise ValueError(
1021+
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
1022+
" Please use `huggingface-cli login` to authenticate with the Hub."
1023+
)
1024+
10191025
logging_dir = Path(args.output_dir, args.logging_dir)
10201026

10211027
accelerator_project_config = ProjectConfiguration(project_dir=args.output_dir, logging_dir=logging_dir)

examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,12 @@ def encode_prompt(text_encoders, tokenizers, prompt, text_input_ids_list=None):
10781078

10791079

10801080
def main(args):
1081+
if args.report_to == "wandb" and args.hub_token is not None:
1082+
raise ValueError(
1083+
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
1084+
" Please use `huggingface-cli login` to authenticate with the Hub."
1085+
)
1086+
10811087
logging_dir = Path(args.output_dir, args.logging_dir)
10821088

10831089
accelerator_project_config = ProjectConfiguration(project_dir=args.output_dir, logging_dir=logging_dir)

examples/consistency_distillation/train_lcm_distill_lora_sd_wds.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,12 @@ def encode_prompt(prompt_batch, text_encoder, tokenizer, proportion_empty_prompt
869869

870870

871871
def main(args):
872+
if args.report_to == "wandb" and args.hub_token is not None:
873+
raise ValueError(
874+
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
875+
" Please use `huggingface-cli login` to authenticate with the Hub."
876+
)
877+
872878
logging_dir = Path(args.output_dir, args.logging_dir)
873879

874880
accelerator_project_config = ProjectConfiguration(project_dir=args.output_dir, logging_dir=logging_dir)

examples/consistency_distillation/train_lcm_distill_lora_sdxl.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,12 @@ def encode_prompt(prompt_batch, text_encoders, tokenizers, is_train=True):
700700

701701

702702
def main(args):
703+
if args.report_to == "wandb" and args.hub_token is not None:
704+
raise ValueError(
705+
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
706+
" Please use `huggingface-cli login` to authenticate with the Hub."
707+
)
708+
703709
logging_dir = Path(args.output_dir, args.logging_dir)
704710

705711
accelerator_project_config = ProjectConfiguration(project_dir=args.output_dir, logging_dir=logging_dir)

examples/consistency_distillation/train_lcm_distill_lora_sdxl_wds.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,12 @@ def encode_prompt(prompt_batch, text_encoders, tokenizers, proportion_empty_prom
864864

865865

866866
def main(args):
867+
if args.report_to == "wandb" and args.hub_token is not None:
868+
raise ValueError(
869+
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
870+
" Please use `huggingface-cli login` to authenticate with the Hub."
871+
)
872+
867873
logging_dir = Path(args.output_dir, args.logging_dir)
868874

869875
accelerator_project_config = ProjectConfiguration(project_dir=args.output_dir, logging_dir=logging_dir)

examples/consistency_distillation/train_lcm_distill_sd_wds.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,12 @@ def encode_prompt(prompt_batch, text_encoder, tokenizer, proportion_empty_prompt
833833

834834

835835
def main(args):
836+
if args.report_to == "wandb" and args.hub_token is not None:
837+
raise ValueError(
838+
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
839+
" Please use `huggingface-cli login` to authenticate with the Hub."
840+
)
841+
836842
logging_dir = Path(args.output_dir, args.logging_dir)
837843

838844
accelerator_project_config = ProjectConfiguration(project_dir=args.output_dir, logging_dir=logging_dir)

examples/consistency_distillation/train_lcm_distill_sdxl_wds.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,12 @@ def encode_prompt(prompt_batch, text_encoders, tokenizers, proportion_empty_prom
873873

874874

875875
def main(args):
876+
if args.report_to == "wandb" and args.hub_token is not None:
877+
raise ValueError(
878+
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
879+
" Please use `huggingface-cli login` to authenticate with the Hub."
880+
)
881+
876882
logging_dir = Path(args.output_dir, args.logging_dir)
877883

878884
accelerator_project_config = ProjectConfiguration(project_dir=args.output_dir, logging_dir=logging_dir)

examples/controlnet/train_controlnet.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,12 @@ def collate_fn(examples):
716716

717717

718718
def main(args):
719+
if args.report_to == "wandb" and args.hub_token is not None:
720+
raise ValueError(
721+
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
722+
" Please use `huggingface-cli login` to authenticate with the Hub."
723+
)
724+
719725
logging_dir = Path(args.output_dir, args.logging_dir)
720726

721727
accelerator_project_config = ProjectConfiguration(project_dir=args.output_dir, logging_dir=logging_dir)

examples/controlnet/train_controlnet_flax.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,12 @@ def get_params_to_save(params):
661661
def main():
662662
args = parse_args()
663663

664+
if args.report_to == "wandb" and args.hub_token is not None:
665+
raise ValueError(
666+
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
667+
" Please use `huggingface-cli login` to authenticate with the Hub."
668+
)
669+
664670
logging.basicConfig(
665671
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
666672
datefmt="%m/%d/%Y %H:%M:%S",

examples/controlnet/train_controlnet_sdxl.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,12 @@ def collate_fn(examples):
762762

763763

764764
def main(args):
765+
if args.report_to == "wandb" and args.hub_token is not None:
766+
raise ValueError(
767+
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
768+
" Please use `huggingface-cli login` to authenticate with the Hub."
769+
)
770+
765771
logging_dir = Path(args.output_dir, args.logging_dir)
766772

767773
accelerator_project_config = ProjectConfiguration(project_dir=args.output_dir, logging_dir=logging_dir)

0 commit comments

Comments
 (0)