Closed Soberia closed 1 year ago
https://github.com/go-skynet/LocalAI#build-with-image-generation-support
but i donj't know how to run this command.
I think you have to change BUILD_TYPE in .env but i'm not sure to what.
I just tried what you did originally and i canj't connect:
$ curl http://localhost:9220/v1/models
curl: (7) Failed to connect to localhost port 9220 after 0 ms: Couldn't connect to server
I think you have to change BUILD_TYPE in .env but i'm not sure to what.
I tried with BUILD_TYPE=openblas
before, no luck either.
This is a lack in our docs. Did you tried by setting GO_TAGS=stablediffusion
in the .env
file?
i still get {"error":{"code":500,"message":"This version of LocalAI was built without the stablediffusion tag","type":""}}
after add GO_TAGS to .env
i still get
{"error":{"code":500,"message":"This version of LocalAI was built without the stablediffusion tag","type":""}}
after add GO_TAGS to .env
How are you running LocalAI? Do you set also REBUILD=false by any chance? default binaries in the image don't have stable diffusion enabled, but I think it's safe to enable at this point.
no i have REBUILD=true
# THREADS=14
# CONTEXT_SIZE=512
MODELS_PATH=/models
DEBUG=true
#BUILD_TYPE=generic
REBUILD=true
PORT=9220
GO_TAGS=stablediffusion
I commented if statement in Makefile to make sure required packages are compiled at the build time. I think this error is not related to the presence of stablediffusion. I don't know the Go language but is this function throws this error for any failure?
Did you end up getting this working? Trying to figure out how to do this for kubernetes
Edit: Adding GO_TAGS: stablediffiusion to the container environment variables puts the container into a crash loop
Did you end up getting this working? Trying to figure out how to do this for kubernetes
Edit: Adding GO_TAGS: stablediffiusion to the container environment variables puts the container into a crash loop
can you take the logs and file a separate issue for this? I'm running this in Kubernetes and don't observe any crashloop here
no i have REBUILD=true
# THREADS=14 # CONTEXT_SIZE=512 MODELS_PATH=/models DEBUG=true #BUILD_TYPE=generic REBUILD=true PORT=9220 GO_TAGS=stablediffusion
Can you share how you start LocalAI and the full logs?
a make GO_TAGS=stablediffusion build
here yields:
base ❯ make GO_TAGS=stablediffusion build
[...]
I local-ai build info:
I BUILD_TYPE:
I GO_TAGS: stablediffusion
CGO_LDFLAGS="" C_INCLUDE_PATH=/home/mudler/_git/LocalAI/go-llama:/home/mudler/_git/LocalAI/go-stable-diffusion/:/home/mudler/_git/LocalAI/gpt4all/gpt4all-bindings/golang/:/home/mudler/_git/LocalAI/go-gpt2:/home/mudler/_git/LocalAI/go-rwk
v:/home/mudler/_git/LocalAI/whisper.cpp:/home/mudler/_git/LocalAI/go-bert:/home/mudler/_git/LocalAI/bloomz LIBRARY_PATH=/home/mudler/_git/LocalAI/go-llama:/home/mudler/_git/LocalAI/go-stable-diffusion/:/home/mudler/_git/LocalAI/gpt4all/g
pt4all-bindings/golang/:/home/mudler/_git/LocalAI/go-gpt2:/home/mudler/_git/LocalAI/go-rwkv:/home/mudler/_git/LocalAI/whisper.cpp:/home/mudler/_git/LocalAI/go-bert:/home/mudler/_git/LocalAI/bloomz go build -tags "stablediffusion" -x -o l
ocal-ai ./
WORK=/tmp/go-build1217960430
a
make GO_TAGS=stablediffusion build
here yields:base ❯ make GO_TAGS=stablediffusion build [...] I local-ai build info: I BUILD_TYPE: I GO_TAGS: stablediffusion CGO_LDFLAGS="" C_INCLUDE_PATH=/home/mudler/_git/LocalAI/go-llama:/home/mudler/_git/LocalAI/go-stable-diffusion/:/home/mudler/_git/LocalAI/gpt4all/gpt4all-bindings/golang/:/home/mudler/_git/LocalAI/go-gpt2:/home/mudler/_git/LocalAI/go-rwk v:/home/mudler/_git/LocalAI/whisper.cpp:/home/mudler/_git/LocalAI/go-bert:/home/mudler/_git/LocalAI/bloomz LIBRARY_PATH=/home/mudler/_git/LocalAI/go-llama:/home/mudler/_git/LocalAI/go-stable-diffusion/:/home/mudler/_git/LocalAI/gpt4all/g pt4all-bindings/golang/:/home/mudler/_git/LocalAI/go-gpt2:/home/mudler/_git/LocalAI/go-rwkv:/home/mudler/_git/LocalAI/whisper.cpp:/home/mudler/_git/LocalAI/go-bert:/home/mudler/_git/LocalAI/bloomz go build -tags "stablediffusion" -x -o l ocal-ai ./ WORK=/tmp/go-build1217960430
@mudler Thanks for the hint. I think I found the problem.
Here's the log when GO_TAGS=stablediffusion
is set in .env
:
When I change the Dockerfile.dev
make command to:
sed -i 's/make build/make GO_TAGS=stablediffusion build/' Dockerfile.dev
eventually, stablediffusion
will be compiled:
I also tried to modify the dockerfile manually before but I was looking for the wrong one. The Dockerfile.dev
is referenced in compose file and not the Dockerfile
. (why?)
So I think to fix this issue, in either Dockerfile
or Dockerfile.dev
, RUN make build
should be changed to RUN make $GO_TAGS build
to read the environment variable correctly for the build process.
a
make GO_TAGS=stablediffusion build
here yields:base ❯ make GO_TAGS=stablediffusion build [...] I local-ai build info: I BUILD_TYPE: I GO_TAGS: stablediffusion CGO_LDFLAGS="" C_INCLUDE_PATH=/home/mudler/_git/LocalAI/go-llama:/home/mudler/_git/LocalAI/go-stable-diffusion/:/home/mudler/_git/LocalAI/gpt4all/gpt4all-bindings/golang/:/home/mudler/_git/LocalAI/go-gpt2:/home/mudler/_git/LocalAI/go-rwk v:/home/mudler/_git/LocalAI/whisper.cpp:/home/mudler/_git/LocalAI/go-bert:/home/mudler/_git/LocalAI/bloomz LIBRARY_PATH=/home/mudler/_git/LocalAI/go-llama:/home/mudler/_git/LocalAI/go-stable-diffusion/:/home/mudler/_git/LocalAI/gpt4all/g pt4all-bindings/golang/:/home/mudler/_git/LocalAI/go-gpt2:/home/mudler/_git/LocalAI/go-rwkv:/home/mudler/_git/LocalAI/whisper.cpp:/home/mudler/_git/LocalAI/go-bert:/home/mudler/_git/LocalAI/bloomz go build -tags "stablediffusion" -x -o l ocal-ai ./ WORK=/tmp/go-build1217960430
@mudler Thanks for the hint. I think I found the problem. Here's the log when
GO_TAGS=stablediffusion
is set in.env
:When I change the
Dockerfile.dev
make command to:sed -i 's/make build/make GO_TAGS=stablediffusion build/' Dockerfile.dev
eventually,
stablediffusion
will be compiled:I also tried to modify the dockerfile manually before but I was looking for the wrong one. The
Dockerfile.dev
is referenced in compose file and not theDockerfile
. (why?)So I think to fix this issue, in either
Dockerfile
orDockerfile.dev
,RUN make build
should be changed toRUN make $GO_TAGS build
to read the environment variable correctly for the build process.
how are you running it in docker-compose? try to pull the image and specify --pull always
instead of --build
. --build
will use Dockerfile.dev
which is used for development and doesn't recompile on start.
how are you running it in docker-compose?
git clone https://github.com/go-skynet/LocalAI
cd LocalAI && docker compose build
how are you running it in docker-compose?
git clone https://github.com/go-skynet/LocalAI cd LocalAI && docker compose build
Try with:
git clone https://github.com/go-skynet/LocalAI
cd LocalAI && docker compose up --pull always
@mudler
The GO_TAGS
environment variable is set correctly when the image builds with docker compose up
instead of docker compose build
and there is no need to modify the dockerfile manually.
Thank you. I close this now.
LocalAI version: v1.13.0 commit ffaf3b1d362cc4d0045e1ed60bbcf0481d21f8ef
Describe the bug I changed
make build
tomake GO_TAGS=stablediffusion build
inDockerfile
and during the build process, I can see in the logs that thegithub.com/mudler/go-stable-diffusion
repository gets cloned but whenever I make an API call to the/v1/images/generations
endpoint, I always get this error:directory content: