LocalAI: Getting started example not working
This project got my interest and wanted to give it a shot. Was attempting the getting started docker example and ran into issues:
LocalAI version: Latest image
Environment, CPU architecture, OS, and Version: Running in an ubuntu 22.04 VM with docker. Got an Xeon E3 with 4 cores+8threads; All threads are available for this VM with 16gig ram.
Describe the bug/reproduce
Ran this command:
docker run -p 8888:8080 -ti --rm quay.io/go-skynet/local-ai:latest --models-path /home/wouter/docker/LocalAI/models --context-size 700 --threads 4
Was assuming this would get my container up and running but ran into bugs as seen below is the output of the files.
Also attempted to pre-download a model using this:
wget https://gpt4all.io/models/ggml-gpt4all-j.bin -O models/ggml-gpt4all-j
Expected behavior A running container π
Logs `CMake Error at tests/CMakeLists.txt:145 (set_target_properties): set_target_properties called with incorrect number of arguments.
β Configuring incomplete, errors occurred! See also β/build/go-ggml-transformers/build/CMakeFiles/CMakeOutput.logβ. See also β/build/go-ggml-transformers/build/CMakeFiles/CMakeError.logβ. make[1]: *** [Makefile:144: ggml.o] Error 1 make[1]: Leaving directory β/build/go-ggml-transformersβ make: *** [Makefile:181: go-ggml-transformers/libtransformers.a] Error 2`
Additional context Hope somebody knows the answer!
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 15 (4 by maintainers)
Yes, if you donβt rebuild the project, an error in the source/build code wonβt be a problem. For me it was a problem because I needed to rebuild the project.
And if you do rebuild it and the build process stop with the error
CMake Error at tests/CMakeLists.txt:145 (set_target_properties): set_target_properties called with incorrect number of arguments.the you can fix this by correcting line 145 in CMakeLists.txt.
Okay, I figured it out.
Mind you, OP and I stumbled across
CMake Error at tests/CMakeLists.txt:145 (set_target_properties): set_target_properties called with incorrect number of arguments.Which happens when you rebuild local-ai (either in docker or outside) and which is set as the default behaviour.
The solution presented here so far is to avoid rebuilding local-ai. Unfortunately, that didnβt work for me as I needed to rebuild local-ai without avx2 support (which is active per default).
So, without further ado, the solution:
There is a set of double quotes missing in go-ggllm/ggllm.cpp/CMakeLists.txt in line 145:
It reads in the repo
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} ${ACCELERATE_FRAMEWORK})but should read
set(LLAMA_EXTRA_LIBS "${LLAMA_EXTRA_LIBS} ${ACCELERATE_FRAMEWORK}")With this change, for me the build process goes through without the error.
Not being a software developer, unfortunately, I donβt know yet how to make a PR to correct this myself. I am going to learn that but I thought it would be better to provide the solution faster. @mudler will have this fixed in no time whereas I would probably need a couple of days to set up an IDE, git, etc. just to make the PR.
Thanks @mudler for this wonderful project! I really admire what you have created here.
The host path should be something like: /home/wouter/docker/LocalAI/models The path inside of the container should be /build/models
I get also these errors at the start of the container:
unexpected end of JSON inputBut I ignore it currently.@wouterverduin Can you post your complete docker command + the output ?
My current way to spin it up is:
You can play arrount with the -e options
Also to get the list of loaded models:
For those trying this out on the Windows OS and facing the above issue, I got it working by following the below steps:
Sample command while using the CUDA enabled image is shared below. Note that Iβve manually downloaded the models along with the config yaml file into the ./models folder within the cloned repo.
docker run -ti --gpus all -p 8080:8080 -e THREADS=1 -v "C:\Users\XXX\YYY\LocalAI\models":/build/models localai/localai:v2.6.0-cublas-cuda12-ffmpeg-coreβ οΈβ οΈβ οΈβ οΈβ οΈ
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 πΈ 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!
β οΈβ οΈβ οΈβ οΈβ οΈ
I am sorry but I do not know how to resolve this issue. The error message indicates that there is an issue with CMake configuration, specifically that there was an incorrect number of arguments passed to
set_target_properties. Additionally, it appears that there is an issue building the ggml-transformers library, with an error occurring when trying to build theggml.ofile and another error when creating thelibtransformers.afile. This could potentially be due to missing or incorrect dependencies. Without more information about the environment and any other steps taken, it is difficult to determine the cause of this issue. I suggest checking the logs for more information on the errors and possibly reviewing the installation guide and relevant documentation.Sources:
Thank you guysβ feedback.
The binary inside the image is rebuilt at the start of the container to enable CPU optimizations for the execution environment, you can set the environment variable REBUILD to false to prevent this behavior.
And about the model path @finger42 already given a clear answer.