InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[bug]: Unable to run invoke AI without HuggingFace token

Open worldveil opened this issue 3 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS

macOS

GPU

cuda

VRAM

64GB

What happened?

I installed using the conda method on Mac OS M1 machine.

Tried to setup invokeAI and it consistently fails without a HuggingFace token. I do not wish to sign up with HuggingFace to use this code.

python scripts/invoke.py --web --root "/path/to/my/runtime-dir/" --no-nsfw_checker

<...some other stuff here...>

Authenticating to Huggingface
Huggingface token not found in cache.
Token was not found in the environment variable HUGGING_FACE_HUB_TOKEN.
Token was not found in the environment variable HUGGINGFACE_TOKEN.

You may optionally enter your Huggingface token now. InvokeAI *will* work without it, but some functionality may be limited.
See https://invoke-ai.github.io/InvokeAI/features/CONCEPTS/#using-a-hugging-face-concept for more information.

Visit https://huggingface.co/settings/tokens to generate a token. (Sign up for an account if needed).

Paste the token below using Ctrl-Shift-V (macOS/Linux) or right-click (Windows), and/or 'Enter' to continue.
You may re-run the configuration script again in the future if you do not wish to set the token right now.
        
HF Token ⮞ None provided - continuing
=============================================================================================================================================================

** DOWNLOADING WEIGHTS **
* v1-5-pruned-emaonly.ckpt: Downloading...
v1-5-pruned-emaonly.ckpt: 100%|████████████████████████████████████████████████████████████████████████████████████████| 4.27G/4.27G [02:57<00:00, 24.0MiB/s]
* sd-v1-5-inpainting.ckpt: Downloading...
sd-v1-5-inpainting.ckpt: 100%|█████████████████████████████████████████████████████████████████████████████████████████| 4.27G/4.27G [02:51<00:00, 24.8MiB/s]
* vae-ft-mse-840000-ema-pruned.ckpt: Downloading...
vae-ft-mse-840000-ema-pruned.ckpt: 100%|█████████████████████████████████████████████████████████████████████████████████| 335M/335M [00:13<00:00, 25.1MiB/s]

A problem occurred during initialization.
The error was: "write() argument must be str, not None"
Traceback (most recent call last):
  File "/path/to/my/ldm/invoke/CLI.py", line 98, in main
    gen = Generate(
  File "/path/to/my/ldm/generate.py", line 159, in __init__
    mconfig             = OmegaConf.load(conf)
  File "/opt/miniconda3/envs/invokeai/lib/python3.10/site-packages/omegaconf/omegaconf.py", line 183, in load
    with io.open(os.path.abspath(file_), "r", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/path/to/my/runtime-dir/configs/models.yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/path/to/my/scripts/configure_invokeai.py", line 783, in main
    errors.add(download_weights(opt))
  File "/path/to/my/scripts/configure_invokeai.py", line 617, in download_weights
    successfully_downloaded = download_weight_datasets(models, access_token)
  File "/path/to/my/scripts/configure_invokeai.py", line 339, in download_weight_datasets
    HfFolder.save_token(access_token)
  File "/opt/miniconda3/envs/invokeai/lib/python3.10/site-packages/huggingface_hub/utils/_hf_folder.py", line 35, in save_token
    f.write(token)
TypeError: write() argument must be str, not None

Please let me know what is the best path for me to submit a PR to remove this dependency!

Screenshots

No response

Additional context

No response

Contact Details

No response

worldveil avatar Dec 20 '22 07:12 worldveil

The failure appears to be at f.write(token)

worldveil avatar Dec 20 '22 07:12 worldveil

The Problem is this strange path you enter as runtime dir, does this rly exist?

python scripts/invoke.py --web --root "/path/to/my/runtime-dir/" --no-nsfw_checker

...

FileNotFoundError: [Errno 2] No such file or directory: '/path/to/my/runtime-dir/configs/models.yaml

mauwii avatar Dec 23 '22 18:12 mauwii