Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
159885ad
Unverified
Commit
159885ad
authored
Feb 09, 2024
by
Sayak Paul
Committed by
GitHub
Feb 08, 2024
Browse files
correct hub_token exposition behaviour (thanks to @bghira). (#6918)
parent
7337eea5
Changes
43
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
121 additions
and
0 deletions
+121
-0
examples/research_projects/consistency_training/train_cm_ct_unconditional.py
...rojects/consistency_training/train_cm_ct_unconditional.py
+6
-0
examples/research_projects/controlnet/train_controlnet_webdataset.py
...search_projects/controlnet/train_controlnet_webdataset.py
+6
-0
examples/research_projects/diffusion_dpo/train_diffusion_dpo.py
...es/research_projects/diffusion_dpo/train_diffusion_dpo.py
+6
-0
examples/research_projects/diffusion_dpo/train_diffusion_dpo_sdxl.py
...search_projects/diffusion_dpo/train_diffusion_dpo_sdxl.py
+6
-0
examples/research_projects/instructpix2pix_lora/train_instruct_pix2pix_lora.py
...jects/instructpix2pix_lora/train_instruct_pix2pix_lora.py
+6
-0
examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py
...ts/intel_opts/textual_inversion/textual_inversion_bf16.py
+7
-0
examples/research_projects/lora/train_text_to_image_lora.py
examples/research_projects/lora/train_text_to_image_lora.py
+6
-0
examples/research_projects/multi_subject_dreambooth/train_multi_subject_dreambooth.py
...ulti_subject_dreambooth/train_multi_subject_dreambooth.py
+6
-0
examples/research_projects/multi_token_textual_inversion/textual_inversion.py
...ojects/multi_token_textual_inversion/textual_inversion.py
+6
-0
examples/research_projects/onnxruntime/text_to_image/train_text_to_image.py
...projects/onnxruntime/text_to_image/train_text_to_image.py
+6
-0
examples/research_projects/onnxruntime/textual_inversion/textual_inversion.py
...ojects/onnxruntime/textual_inversion/textual_inversion.py
+6
-0
examples/research_projects/onnxruntime/unconditional_image_generation/train_unconditional.py
...ime/unconditional_image_generation/train_unconditional.py
+6
-0
examples/research_projects/realfill/train_realfill.py
examples/research_projects/realfill/train_realfill.py
+6
-0
examples/t2i_adapter/train_t2i_adapter_sdxl.py
examples/t2i_adapter/train_t2i_adapter_sdxl.py
+6
-0
examples/text_to_image/train_text_to_image.py
examples/text_to_image/train_text_to_image.py
+6
-0
examples/text_to_image/train_text_to_image_flax.py
examples/text_to_image/train_text_to_image_flax.py
+6
-0
examples/text_to_image/train_text_to_image_lora.py
examples/text_to_image/train_text_to_image_lora.py
+6
-0
examples/text_to_image/train_text_to_image_lora_sdxl.py
examples/text_to_image/train_text_to_image_lora_sdxl.py
+6
-0
examples/text_to_image/train_text_to_image_sdxl.py
examples/text_to_image/train_text_to_image_sdxl.py
+6
-0
examples/textual_inversion/textual_inversion.py
examples/textual_inversion/textual_inversion.py
+6
-0
No files found.
examples/research_projects/consistency_training/train_cm_ct_unconditional.py
View file @
159885ad
...
@@ -786,6 +786,12 @@ def parse_args():
...
@@ -786,6 +786,12 @@ def parse_args():
def
main
(
args
):
def
main
(
args
):
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
kwargs
=
InitProcessGroupKwargs
(
timeout
=
timedelta
(
seconds
=
7200
))
# a big number for high resolution or big dataset
kwargs
=
InitProcessGroupKwargs
(
timeout
=
timedelta
(
seconds
=
7200
))
# a big number for high resolution or big dataset
...
...
examples/research_projects/controlnet/train_controlnet_webdataset.py
View file @
159885ad
...
@@ -897,6 +897,12 @@ def encode_prompt(prompt_batch, text_encoders, tokenizers, proportion_empty_prom
...
@@ -897,6 +897,12 @@ def encode_prompt(prompt_batch, text_encoders, tokenizers, proportion_empty_prom
def
main
(
args
):
def
main
(
args
):
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
...
...
examples/research_projects/diffusion_dpo/train_diffusion_dpo.py
View file @
159885ad
...
@@ -467,6 +467,12 @@ def encode_prompt(text_encoder, input_ids):
...
@@ -467,6 +467,12 @@ def encode_prompt(text_encoder, input_ids):
def
main
(
args
):
def
main
(
args
):
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
...
...
examples/research_projects/diffusion_dpo/train_diffusion_dpo_sdxl.py
View file @
159885ad
...
@@ -491,6 +491,12 @@ def encode_prompt(text_encoders, text_input_ids_list):
...
@@ -491,6 +491,12 @@ def encode_prompt(text_encoders, text_input_ids_list):
def
main
(
args
):
def
main
(
args
):
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
...
...
examples/research_projects/instructpix2pix_lora/train_instruct_pix2pix_lora.py
View file @
159885ad
...
@@ -386,6 +386,12 @@ def download_image(url):
...
@@ -386,6 +386,12 @@ def download_image(url):
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
if
args
.
non_ema_revision
is
not
None
:
if
args
.
non_ema_revision
is
not
None
:
deprecate
(
deprecate
(
"non_ema_revision!=None"
,
"non_ema_revision!=None"
,
...
...
examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py
View file @
159885ad
...
@@ -362,6 +362,13 @@ def freeze_params(params):
...
@@ -362,6 +362,13 @@ def freeze_params(params):
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
accelerator
=
Accelerator
(
accelerator
=
Accelerator
(
...
...
examples/research_projects/lora/train_text_to_image_lora.py
View file @
159885ad
...
@@ -392,6 +392,12 @@ DATASET_NAME_MAPPING = {
...
@@ -392,6 +392,12 @@ DATASET_NAME_MAPPING = {
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
accelerator_project_config
=
ProjectConfiguration
(
...
...
examples/research_projects/multi_subject_dreambooth/train_multi_subject_dreambooth.py
View file @
159885ad
...
@@ -681,6 +681,12 @@ class PromptDataset(Dataset):
...
@@ -681,6 +681,12 @@ class PromptDataset(Dataset):
def
main
(
args
):
def
main
(
args
):
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
accelerator_project_config
=
ProjectConfiguration
(
total_limit
=
args
.
checkpoints_total_limit
,
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
total_limit
=
args
.
checkpoints_total_limit
,
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
...
...
examples/research_projects/multi_token_textual_inversion/textual_inversion.py
View file @
159885ad
...
@@ -548,6 +548,12 @@ class TextualInversionDataset(Dataset):
...
@@ -548,6 +548,12 @@ class TextualInversionDataset(Dataset):
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
accelerator_project_config
=
ProjectConfiguration
(
total_limit
=
args
.
checkpoints_total_limit
,
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
total_limit
=
args
.
checkpoints_total_limit
,
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
...
...
examples/research_projects/onnxruntime/text_to_image/train_text_to_image.py
View file @
159885ad
...
@@ -412,6 +412,12 @@ def parse_args():
...
@@ -412,6 +412,12 @@ def parse_args():
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
if
args
.
non_ema_revision
is
not
None
:
if
args
.
non_ema_revision
is
not
None
:
deprecate
(
deprecate
(
"non_ema_revision!=None"
,
"non_ema_revision!=None"
,
...
...
examples/research_projects/onnxruntime/textual_inversion/textual_inversion.py
View file @
159885ad
...
@@ -561,6 +561,12 @@ class TextualInversionDataset(Dataset):
...
@@ -561,6 +561,12 @@ class TextualInversionDataset(Dataset):
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
accelerator_project_config
=
ProjectConfiguration
(
total_limit
=
args
.
checkpoints_total_limit
,
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
total_limit
=
args
.
checkpoints_total_limit
,
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
...
...
examples/research_projects/onnxruntime/unconditional_image_generation/train_unconditional.py
View file @
159885ad
...
@@ -277,6 +277,12 @@ def parse_args():
...
@@ -277,6 +277,12 @@ def parse_args():
def
main
(
args
):
def
main
(
args
):
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
accelerator_project_config
=
ProjectConfiguration
(
total_limit
=
args
.
checkpoints_total_limit
,
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
total_limit
=
args
.
checkpoints_total_limit
,
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
...
...
examples/research_projects/realfill/train_realfill.py
View file @
159885ad
...
@@ -531,6 +531,12 @@ def collate_fn(examples):
...
@@ -531,6 +531,12 @@ def collate_fn(examples):
def
main
(
args
):
def
main
(
args
):
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator
=
Accelerator
(
accelerator
=
Accelerator
(
...
...
examples/t2i_adapter/train_t2i_adapter_sdxl.py
View file @
159885ad
...
@@ -776,6 +776,12 @@ def collate_fn(examples):
...
@@ -776,6 +776,12 @@ def collate_fn(examples):
def
main
(
args
):
def
main
(
args
):
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
...
...
examples/text_to_image/train_text_to_image.py
View file @
159885ad
...
@@ -498,6 +498,12 @@ def parse_args():
...
@@ -498,6 +498,12 @@ def parse_args():
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
if
args
.
non_ema_revision
is
not
None
:
if
args
.
non_ema_revision
is
not
None
:
deprecate
(
deprecate
(
"non_ema_revision!=None"
,
"non_ema_revision!=None"
,
...
...
examples/text_to_image/train_text_to_image_flax.py
View file @
159885ad
...
@@ -245,6 +245,12 @@ def get_params_to_save(params):
...
@@ -245,6 +245,12 @@ def get_params_to_save(params):
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging
.
basicConfig
(
logging
.
basicConfig
(
format
=
"%(asctime)s - %(levelname)s - %(name)s - %(message)s"
,
format
=
"%(asctime)s - %(levelname)s - %(name)s - %(message)s"
,
datefmt
=
"%m/%d/%Y %H:%M:%S"
,
datefmt
=
"%m/%d/%Y %H:%M:%S"
,
...
...
examples/text_to_image/train_text_to_image_lora.py
View file @
159885ad
...
@@ -377,6 +377,12 @@ DATASET_NAME_MAPPING = {
...
@@ -377,6 +377,12 @@ DATASET_NAME_MAPPING = {
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
...
...
examples/text_to_image/train_text_to_image_lora_sdxl.py
View file @
159885ad
...
@@ -482,6 +482,12 @@ def encode_prompt(text_encoders, tokenizers, prompt, text_input_ids_list=None):
...
@@ -482,6 +482,12 @@ def encode_prompt(text_encoders, tokenizers, prompt, text_input_ids_list=None):
def
main
(
args
):
def
main
(
args
):
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
...
...
examples/text_to_image/train_text_to_image_sdxl.py
View file @
159885ad
...
@@ -573,6 +573,12 @@ def generate_timestep_weights(args, num_timesteps):
...
@@ -573,6 +573,12 @@ def generate_timestep_weights(args, num_timesteps):
def
main
(
args
):
def
main
(
args
):
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
Path
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
...
...
examples/textual_inversion/textual_inversion.py
View file @
159885ad
...
@@ -579,6 +579,12 @@ class TextualInversionDataset(Dataset):
...
@@ -579,6 +579,12 @@ class TextualInversionDataset(Dataset):
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
if
args
.
report_to
==
"wandb"
and
args
.
hub_token
is
not
None
:
raise
ValueError
(
"You cannot use both --report_to=wandb and --hub_token due to a security risk of exposing your token."
" Please use `huggingface-cli login` to authenticate with the Hub."
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
logging_dir
=
os
.
path
.
join
(
args
.
output_dir
,
args
.
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
accelerator_project_config
=
ProjectConfiguration
(
project_dir
=
args
.
output_dir
,
logging_dir
=
logging_dir
)
accelerator
=
Accelerator
(
accelerator
=
Accelerator
(
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment