bghira/SimpleTuner

training the model and problem with connecting to huggingface

Closed this issue · 5 comments

Hello, thanks for sharing the code. I am trying to follow up the steps here but I am getting this problem even though I login into wandb and huggingface-cli.
thanks for any quidance.

black-forest-labs/FLUX.1-dev is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models' If this is a private repository, make sure to pass a token having permission to this repo with tokenor log in withhuggingface-cli login`.
Traceback (most recent call last):
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/utils/_http.py", line 406, in hf_raise_for_status
response.raise_for_status()
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/scheduler/scheduler_config.json

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/diffusers/configuration_utils.py", line 379, in load_config
config_file = hf_hub_download(
^^^^^^^^^^^^^^^^
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 862, in hf_hub_download
return _hf_hub_download_to_cache_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 969, in _hf_hub_download_to_cache_dir
_raise_on_head_call_error(head_call_error, force_download, local_files_only)
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 1484, in _raise_on_head_call_error
raise head_call_error
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 1376, in _get_metadata_or_catch_error
metadata = get_hf_file_metadata(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 1296, in get_hf_file_metadata
r = _request_wrapper(
^^^^^^^^^^^^^^^^^
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 277, in _request_wrapper
response = _request_wrapper(
^^^^^^^^^^^^^^^^^
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 301, in _request_wrapper
hf_raise_for_status(response)
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/utils/_http.py", line 423, in hf_raise_for_status
raise _format(GatedRepoError, message, response) from e
huggingface_hub.errors.GatedRepoError: 403 Client Error. (Request ID: Root=1-672ce79f-25371f931ed9d1fc67c0bea8;a3baf1dd-e365-48cb-a7ef-d352dc9460a7)

Cannot access gated repo for url https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/scheduler/scheduler_config.json.
Access to model black-forest-labs/FLUX.1-dev is restricted and you are not in the authorized list. Visit https://huggingface.co/black-forest-labs/FLUX.1-dev to ask for access.

During handling of the above exception, another exception occurred:
wandb
Traceback (most recent call last):
File "/usr/SimpleTuner/train.py", line 22, in
trainer = Trainer()
^^^^^^^^^
File "/usr/SimpleTuner/helpers/training/trainer.py", line 164, in init
self.parse_arguments(args=config, disable_accelerator=disable_accelerator)
File "/usr/SimpleTuner/helpers/training/trainer.py", line 218, in parse_arguments
self.init_noise_schedule()
File "/usr/SimpleTuner/helpers/training/trainer.py", line 290, in init_noise_schedule
self.config, _flow_matching, self.noise_scheduler = load_scheduler_from_args(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/SimpleTuner/helpers/training/schedulers.py", line 20, in load_scheduler_from_args
noise_scheduler = FlowMatchEulerDiscreteScheduler.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/diffusers/schedulers/scheduling_utils.py", line 150, in from_pretrained
config, kwargs, commit_hash = cls.load_config(
^^^^^^^^^^^^^^^^
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/usr/SimpleTuner/.venv/lib/python3.11/site-packages/diffusers/configuration_utils.py", line 394, in load_config
raise EnvironmentError(
OSError: black-forest-labs/FLUX.1-dev is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with token or log in with huggingface-cli login.

`

see in the console output early-ish on where it says what account you are logged in as and make sure that account has access to the gated repository

thanks for your response. Sorry, I am new with this and I did not understand what do you mean. When I log in I got this

`(.venv) xxxxxx:/usr/SimpleTuner$ huggingface-cli login

_|    _|  _|    _|    _|_|_|    _|_|_|  _|_|_|  _|      _|    _|_|_|      _|_|_|_|    _|_|      _|_|_|  _|_|_|_|
_|    _|  _|    _|  _|        _|          _|    _|_|    _|  _|            _|        _|    _|  _|        _|
_|_|_|_|  _|    _|  _|  _|_|  _|  _|_|    _|    _|  _|  _|  _|  _|_|      _|_|_|    _|_|_|_|  _|        _|_|_|
_|    _|  _|    _|  _|    _|  _|    _|    _|    _|    _|_|  _|    _|      _|        _|    _|  _|        _|
_|    _|    _|_|      _|_|_|    _|_|_|  _|_|_|  _|      _|    _|_|_|      _|        _|    _|    _|_|_|  _|_|_|_|

A token is already saved on your machine. Run `huggingface-cli whoami` to get more information or `huggingface-cli logout` if you want to log out.
Setting a new token will erase the existing one.
To log in, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .

Enter your token (input will not be visible):
Add token as git credential? (Y/n) n
Token is valid (permission: write).
The token flux has been saved to /home/usr/.cache/huggingface/stored_tokens
Your token has been saved to /home/usr/.cache/huggingface/token
Login successful.`

check in the simpletuner debug.log file in its directory where you ran it from and toward the top where it is initialising it tells you whether you are logged into hugging face hub or not - i think it might not show this if you are not pushing checkpoints to the hub, however.

Thanks, I checked it, seems I am not pushing checkpoint

you will have to identify why your huggingface token is not working or detected by the trainer, there isn't much special going on there