LocalAI icon indicating copy to clipboard operation
LocalAI copied to clipboard

error building go-gpt4all-j

Open luc-vocab opened this issue 1 year ago • 11 comments

I ran into the following error while following the instructions for GPT4ALL-J. Is this a transient issue with the GPT4ALL-J code repo maybe ?

15.84 cd build && cmake ../gpt4all-j/ggml && make VERBOSE=1 ggml && cp -rf src/CMakeFiles/ggml.dir/ggml.c.o ../ggml.o 15.92 -- The C compiler identification is GNU 10.2.1 15.99 -- The CXX compiler identification is GNU 10.2.1 16.00 -- Detecting C compiler ABI info 16.07 -- Detecting C compiler ABI info - done 16.09 -- Check for working C compiler: /usr/bin/cc - skipped 16.09 -- Detecting C compile features 16.09 -- Detecting C compile features - done 16.10 -- Detecting CXX compiler ABI info 16.18 -- Detecting CXX compiler ABI info - done 16.20 -- Check for working CXX compiler: /usr/bin/c++ - skipped 16.20 -- Detecting CXX compile features 16.21 -- Detecting CXX compile features - done 16.21 -- Found Git: /usr/bin/git (found version "2.30.2") 16.22 -- Looking for pthread.h 16.29 -- Looking for pthread.h - found 16.29 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD 16.37 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed 16.37 -- Looking for pthread_create in pthreads 16.43 -- Looking for pthread_create in pthreads - not found 16.43 -- Looking for pthread_create in pthread 16.51 -- Looking for pthread_create in pthread - found 16.51 -- Found Threads: TRUE 16.51 -- CMAKE_SYSTEM_PROCESSOR: x86_64 16.51 -- x86 detected 16.51 -- Linux detected 16.53 -- x86 detected 16.53 -- Linux detected 16.54 CMake Error at tests/CMakeLists.txt:145 (set_target_properties): 16.54 set_target_properties called with incorrect number of arguments. 16.54 16.54 16.54 -- Configuring incomplete, errors occurred! 16.54 See also "/build/go-gpt4all-j/build/CMakeFiles/CMakeOutput.log". 16.54 See also "/build/go-gpt4all-j/build/CMakeFiles/CMakeError.log". 16.55 make[1]: Leaving directory '/build/go-gpt4all-j' 16.55 make[1]: *** [Makefile:144: ggml.o] Error 1 16.55 make: *** [Makefile:61: go-gpt4all-j/libgptj.a] Error 2

failed to solve: process "/bin/sh -c make build" did not complete successfully: exit code: 2

luc-vocab avatar Apr 26 '23 13:04 luc-vocab

I just followed the instructions from https://github.com/go-skynet/LocalAI#example-use-gpt4all-j-model and it worked exactly as expected.

deadprogram avatar Apr 26 '23 18:04 deadprogram

Can't reproduce here, @luc-languagetools can you give more insights on environment/how you are building it, and the steps used?

mudler avatar Apr 27 '23 06:04 mudler

I'm running on an Ubuntu 22.04 VM, and I followed the steps here: https://github.com/go-skynet/LocalAI#example-use-gpt4all-j-model

git clone https://github.com/go-skynet/LocalAI cd LocalAI wget https://gpt4all.io/models/ggml-gpt4all-j.bin -O models/ggml-gpt4all-j cp -rf prompt-templates/ggml-gpt4all-j.tmpl models/ docker compose up -d --build

luc-vocab avatar Apr 27 '23 14:04 luc-vocab

Aha! that is typo

docker compose up -d --build

should be

docker-compose up -d --build

deadprogram avatar Apr 27 '23 14:04 deadprogram

Here is a PR to correct docs https://github.com/go-skynet/LocalAI/pull/103

deadprogram avatar Apr 27 '23 14:04 deadprogram

I thought they were equivalent. I don't have docker-compose on my system but I thought docker compose was exactly the same thing.

luc-vocab avatar Apr 27 '23 22:04 luc-vocab

They are entirely different commands, although the newer subcommand compose tries to do mostly the same sort of thing in an entirely different way. docker-compose is written in python.

deadprogram avatar Apr 28 '23 05:04 deadprogram

Was having this same issue. It seems that the tests in go-gpt2 and gp-gpt4all-j used for ggml.cpp have some invalid steps in their CMakeLists.txt file. Steps taken to solve:

  • cd into go-gpt2/ggml.cpp
  • remove tests from CMakeLists.txt (near bottom of file)
  • remove the tests folder
  • repeat steps for go-gpt4all-j

After this, rebuild the docker container using their docker-compose or docker compose. I've found no differences between the two far.

Feel free to shoot me a PM if you keep running into issues

AlecDusheck avatar Apr 30 '23 20:04 AlecDusheck

I also had this issue but reading #263 I realized my vm did not have avx support, since it was running with the default kvm64 in proxmox. I verified it was missing and confirmed its presence with lscpu | grep avx after editing the processor type to host. This fixed this issue for me.

I can also confirm that using newer docker compose also works fine.

However, following the gpt4all-j guide, I now have issue #181

kaitallaoua avatar May 20 '23 00:05 kaitallaoua

I also had this issue but reading #263 I realized my vm did not have avx support, since it was running with the default kvm64 in proxmox. I verified it was missing and confirmed its presence with lscpu | grep avx after editing the processor type to host. This fixed this issue for me.

I'm experiencing the same issue, and like you I have a vm running on proxmox. When you say you edited the processor type to host what exactly did you do? Edit where? Docker? Proxmox?

Narcolapser avatar Jun 10 '23 15:06 Narcolapser

I also had this issue but reading #263 I realized my vm did not have avx support, since it was running with the default kvm64 in proxmox. I verified it was missing and confirmed its presence with lscpu | grep avx after editing the processor type to host. This fixed this issue for me.

I'm experiencing the same issue, and like you I have a vm running on proxmox. When you say you edited the processor type to host what exactly did you do? Edit where? Docker? Proxmox?

In proxmox you can set the CPU type of the VMs when creating it. See for instance the image in https://www.techaddressed.com/tutorials/proxmox-improve-vm-cpu-perf/

mudler avatar Jun 10 '23 16:06 mudler

Not relevant anymore. gpt4all went under several changes, and CI has tests covering gpt4all as well by now. Closing

mudler avatar Jun 15 '23 07:06 mudler