LocalAI icon indicating copy to clipboard operation
LocalAI copied to clipboard

diffusers: missing omegaconf

Open 35develr opened this issue 2 years ago • 4 comments

I loaded a local safetensors SD Model, but when i try to query i get an 500 error at the backend.

models/stablediffusion.yaml: name: stablediffusion parameters: model: realvis6.safetensors backend: diffusers step: 30 f16: false cuda: false diffusers: pipeline_type: StableDiffusionPipeline enable_parameters: "negative_prompt,num_inference_steps,clip_skip" scheduler_type: "k_dpmpp_sde" cfg_scale: 6 step: 30 clip_skip: 2

` curl http://localhost:8080/v1/images/generations -H "Content-Type: application/json" -d '{"prompt": "a photo of a black cat on a table","size": "256x256"}'

{"error":{"code":500,"message":"could not load model (no success): Unexpected err=ValueError('\n{0} requires the omegaconf library but it was not found in your environment. You can install it with pip: pip\\ninstall omegaconf\n'), type(err)=\u003cclass 'ValueError'\u003e","type":""}}

I tried to install OmegaConf inside the docker container, but no success either:

pip install OmegaConf Collecting OmegaConf Downloading omegaconf-2.3.0-py3-none-any.whl (79 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.5/79.5 kB 8.6 MB/s eta 0:00:00 Collecting antlr4-python3-runtime==4.9.* (from OmegaConf) Downloading antlr4-python3-runtime-4.9.3.tar.gz (117 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.0/117.0 kB 8.0 MB/s eta 0:00:00 Preparing metadata (setup.py) ... done Collecting PyYAML>=5.1.0 (from OmegaConf) Downloading PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB) Downloading PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (738 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 738.9/738.9 kB 6.2 MB/s eta 0:00:00 Building wheels for collected packages: antlr4-python3-runtime Building wheel for antlr4-python3-runtime (setup.py) ... done Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144573 sha256=393e217e6a62c109c198b3b6a50db21a506d1664b20577a9e1afb5ce70f9b82c Stored in directory: /root/.cache/pip/wheels/23/cf/80/f3efa822e6ab23277902ee9165fe772eeb1dfb8014f359020a Successfully built antlr4-python3-runtime Installing collected packages: antlr4-python3-runtime, PyYAML, OmegaConf Successfully installed OmegaConf-2.3.0 PyYAML-6.0.1 antlr4-python3-runtime-4.9.3 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

:/build# pip list Package Version


antlr4-python3-runtime 4.9.3 mercurial 5.6.1 omegaconf 2.3.0 pip 23.3.2 PyYAML 6.0.1 `

35develr avatar Jan 03 '24 10:01 35develr

introduced by https://github.com/mudler/LocalAI/pull/1144 - wondering how this made it through from the CI tests

mudler avatar Jan 03 '24 11:01 mudler

i pulled the new repo git clone https://github.com/mudler/LocalAI/

in diffusers.yaml there is the new line: 56 - omegaconf then i started the docker container and tried image generation with diffusers

this is the result:

{"error":{"code":500,"message":"could not load model (no success): Unexpected err=ValueError('\n{0} requires the omegaconf library but it was not found in your environment. You can install it with pip: pip\\ninstall omegaconf\n'), type(err)=\

please help, any suggestions?

35develr avatar Jan 04 '24 09:01 35develr

have to try to reproduce it here then, where I'm using stablediffusion I'm running it from source I don't have that issue. Can you tell which image did you use in your tests? I've just tagged 2.4.0, so if you have a bit of patience new images will be available soon to test it out

mudler avatar Jan 04 '24 16:01 mudler

I pulled the new docker images and it is working now for me. Thank you for fixing so fast!

35develr avatar Jan 08 '24 09:01 35develr