mudler / LocalAI

:robot: The free, Open Source OpenAI alternative. Self-hosted, community-driven and local-first. Drop-in replacement for OpenAI running on consumer-grade hardware. No GPU required. Runs gguf, transformers, diffusers and many more models architectures. It allows to generate Text, Audio, Video, Images. Also with voice cloning capabilities.
https://localai.io
MIT License
21.66k stars 1.66k forks source link

Docker Build failed on Stablediffusion step #614

Open stereotypy opened 1 year ago

stereotypy commented 1 year ago

Hi, I was able to build LocalAI locally on my server and run the executable without issues but when I build with docker I keep getting failures during this step. This was on the master branch

Is it possible to turn off this part, I only want to play with the LLM and don't need stable diffusion.

#0 1.201 I GO_TAGS: stablediffusion
#0 1.208 CGO_LDFLAGS="" C_INCLUDE_PATH=/build/go-llama:/build/go-stable-diffusion/:/build/gpt4all/gpt4all-bindings/golang/:/build/go-ggml-transformers:/build/go-rwkv:/build/whisper.cpp:/build/go-bert:/build/bloomz LIBRARY_PATH=/build/go-llama:/build/go-stable-diffusion/:/build/gpt4all/gpt4all-bindings/golang/:/build/go-ggml-transformers:/build/go-rwkv:/build/whisper.cpp:/build/go-bert:/build/bloomz go build -ldflags "?=" -tags "stablediffusion" -o local-ai ./
#0 15.76 # github.com/mudler/go-stable-diffusion
#0 15.76 stablediffusion.cpp: In function 'int generate_image(int, int, int, int, int, const char*, const char*, const char*, const char*, const char*)':
#0 15.76 stablediffusion.cpp:38:46: error: no matching function for call to 'PromptSlover::PromptSlover(const char*&)'
#0 15.76    38 |         PromptSlover prompt_slover(assets_dir);
#0 15.76       |                                              ^
#0 15.76 In file included from stablediffusion.cpp:17:
#0 15.76 go-stable-diffusion/stable-diffusion/x86/vs2019_opencv-mobile_ncnn-dll_demo/vs2019_opencv-mobile_ncnn-dll_demo/prompt_slover.cpp:3:1: note: candidate: 'PromptSlover::PromptSlover()'
#0 15.76     3 | PromptSlover::PromptSlover()
#0 15.76       | ^~~~~~~~~~~~
#0 15.76 go-stable-diffusion/stable-diffusion/x86/vs2019_opencv-mobile_ncnn-dll_demo/vs2019_opencv-mobile_ncnn-dll_demo/prompt_slover.cpp:3:1: note:   candidate expects 0 arguments, 1 provided
#0 15.76 stablediffusion.cpp:39:73: error: no matching function for call to 'DiffusionSlover::DiffusionSlover(int&, int&, int&, const char*&)'
#0 15.76    39 |         DiffusionSlover diffusion_slover(height, width, mode, assets_dir);
#0 15.76       |                                                                         ^
#0 15.76 In file included from stablediffusion.cpp:14:
#0 15.76 go-stable-diffusion/stable-diffusion/x86/vs2019_opencv-mobile_ncnn-dll_demo/vs2019_opencv-mobile_ncnn-dll_demo/diffusion_slover.cpp:3:1: note: candidate: 'DiffusionSlover::DiffusionSlover(int, int, int)'
#0 15.76     3 | DiffusionSlover::DiffusionSlover(int h, int w, int mode)
#0 15.76       | ^~~~~~~~~~~~~~~
#0 15.76 go-stable-diffusion/stable-diffusion/x86/vs2019_opencv-mobile_ncnn-dll_demo/vs2019_opencv-mobile_ncnn-dll_demo/diffusion_slover.cpp:3:1: note:   candidate expects 3 arguments, 4 provided
#0 15.76 stablediffusion.cpp:40:61: error: no matching function for call to 'DecodeSlover::DecodeSlover(int&, int&, const char*&)'
#0 15.76    40 |         DecodeSlover decode_slover(height, width, assets_dir);
#0 15.76       |                                                             ^
#0 15.76 In file included from stablediffusion.cpp:15:
#0 15.76 go-stable-diffusion/stable-diffusion/x86/vs2019_opencv-mobile_ncnn-dll_demo/vs2019_opencv-mobile_ncnn-dll_demo/decoder_slover.cpp:3:1: note: candidate: 'DecodeSlover::DecodeSlover(int, int)'
#0 15.76     3 | DecodeSlover::DecodeSlover(int h, int w)
#0 15.76       | ^~~~~~~~~~~~
#0 15.76 go-stable-diffusion/stable-diffusion/x86/vs2019_opencv-mobile_ncnn-dll_demo/vs2019_opencv-mobile_ncnn-dll_demo/decoder_slover.cpp:3:1: note:   candidate expects 2 arguments, 3 provided
#0 15.76 stablediffusion.cpp:41:57: error: no matching function for call to 'EncodeSlover::EncodeSlover(int&, int&, const char*&)'
#0 15.76    41 |     EncodeSlover encode_slover(height, width, assets_dir);
#0 15.76       |                                                         ^
#0 15.76 In file included from stablediffusion.cpp:16:
#0 15.76 go-stable-diffusion/stable-diffusion/x86/vs2019_opencv-mobile_ncnn-dll_demo/vs2019_opencv-mobile_ncnn-dll_demo/encoder_slover.cpp:3:1: note: candidate: 'EncodeSlover::EncodeSlover(int, int)'
#0 15.76     3 | EncodeSlover::EncodeSlover(int h, int w)
#0 15.76       | ^~~~~~~~~~~~
#0 15.76 go-stable-diffusion/stable-diffusion/x86/vs2019_opencv-mobile_ncnn-dll_demo/vs2019_opencv-mobile_ncnn-dll_demo/encoder_slover.cpp:3:1: note:   candidate expects 2 arguments, 3 provided
#0 43.18 make: *** [Makefile:226: build] Error 1
------
Dockerfile:49
--------------------
  47 |     RUN make prepare
  48 |     COPY . .
  49 | >>> RUN make build
  50 |     
  51 |     FROM requirements
--------------------
Aisuko commented 1 year ago

Thanks for your feedback, we are working on it.

mudler commented 1 year ago

You should be able to disable stable diffusion by setting GO_TAGS to an empty string https://localai.io/advanced/index.html#environment-variables

however, I think your issue is quite odd as it compiles fine over here. Were you trying master builds or tagged releases?

localai-bot commented 11 months ago

:warning::warning::warning::warning::warning:

Hi! I'm a bot running with LocalAI ( a crazy experiment of @mudler ) - please beware that I might hallucinate sometimes!

_but.... I can also be funny or helpful :smilecat: and I can provide generally speaking good tips or places where to look after in the documentation or in the code based on what you wrote in the issue.

Don't engage in conversation with me, I don't support (yet) replying!

:warning::warning::warning::warning::warning:

The issue seems to be related to the number of arguments provided for the constructor of the PromptSlover, DiffusionSlover, and EncodeSlover classes. The code is trying to create instances of these classes with 4 arguments, but the constructors only expect 3 or 2 arguments respectively. To fix this issue, you can modify the constructor calls in the stablediffusion.cpp file to match the number and types of arguments expected by each class constructor. For example:

DiffusionSlover diffusion_slover(height, width, mode);
DecodeSlover decode_slover(height, width);
EncodeSlover encode_slover(height, width);

This should fix the issues with the constructor calls and allow the code to compile successfully.

Sources: