Hi,
I made llama64.lib using .bat file suggested by Antonio. Windows 10 64 bit.
Also created test1.exe (test1.prg) and test2.exe (test2.prg), again using .bat file suggested by Antonio.
I used model file phi-2_Q4_K_M.gguf.
With test1.exe it takes about 70 seconds to start answering. But it was just start, writing only few words then stops, waiting to continue … very slow.
With test2.exe it takes about 50 seconds to start answering. Again it was just start writing few words then also stops, waiting to continue … very slow.
Then I used Alexander examples, with same model file phi-2_Q4_K_M.gguf.
First used test_exllm.exe (GUI). It starts answering instantly after clicking on Ask button, fast and clean.
Second used llama_exsrv.exe (command line). Also starts answering instantly, fast and clean.
I did not used Alexander HWBuilder nor its .bat files, as Antonio's .bat files was simplier for me.
Regards,
Simo.
Hi Antonio,
Just to report.
I have started llama from beginning. Reason is that my first versions of llama64.lib and test1,exe somehow worked. Then after some changes in .bat files error appeared.
My computer is 64 bit Windows 10, 4 GB RAM.
I have made fresh new go64lib.bat and go64tst1.bat, first for making lib and second for building example test1.prg. Also, used my first clone of llama_prg, created on 26 march.
These fresh new go*.bat I made copying them from your first .bat suggestions, in mail on 26 march. I got llama64.lib (size about 17 MB) and test1.exe (size about 3 MB). After starting test1.exe I wait about 40 sec, and response appears now with decent speed. Same was with default GT and with gtwvt. Used phi-2_Q4_K_M.gguf model.
Then I updated go64tst1.bat with one from you mail on 29 march. Again test1.exe works good.
Then I made new go*.bat based on your suggestions in mail on 30 march. New llama64.lib was about 24.5 MB and test1.exe was about 2 MB. Unfortenatly on my computer test1.exe dies, when calling function LLM_OPEN_MODEL(), as I explained. I changed gguf to TinyLlama.gguf but no success. After that I have tried with cloned new llama.cpp, also no success, same error. No other suggested changes helped me. Always same error on LLM_OPEN_MODEL().
Regards,
Simo.
Hi.
Can some Linux expert help me ?
I wanted to try llama_prg with Harbour on Linux. Windows is my main development environment, my knowledge on Linux and Harbour on Linux is near newbie level.
I have installed Kubuntu 22.04.4 LTS, as dual boot with Windows 10. Home folder is gama.
Also installed Harbour on Kubuntu with no errors, in /home/gama/harbour. Made some hello.prg and compiled with success.
Then I cloned llama_prg,
git clone https://gitflic.ru/project/alkresin/llama_prg.git
and got /home/gama/llama_prg. In directory llama_prg I created two subdirectories, lib and obj/gcc.
After that I have created two sh files, go64lib.sh for building libllama.a and go64tst1.sh for building test1 Linux executable.
Content for these .sh files is what Alexander suggested in its llama readme file.
go64lib.sh :
#!/bin/bash
# Set your Harbour path here
export HRB_DIR=/home/gama/harbour
export CFLAGS="-c -Wall -std=c++11 -fPIC -O3 -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wmissing-declarations -Wmissing-noreturn -pthread -march=native -mtune=native -Wno-array-bounds -Wno-format-truncation -Illama.cpp -Illama.cpp/common -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -DNDEBUG -DLOG_DISABLE_LOGS=1 -c -I$HRB_DIR/include"
export CXXFLAGS="-c -Wall -std=c++11 -fPIC -O3 -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wmissing-declarations -Wmissing-noreturn -pthread -march=native -mtune=native -Wno-array-bounds -Wno-format-truncation -Illama.cpp -Illama.cpp/common -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -DNDEBUG -DLOG_DISABLE_LOGS=1 -c -xc++ -I$HRB_DIR/include"
gcc $CXXFLAGS -oobj/gcc/hllama.o source/hllama.cpp
gcc $CXXFLAGS -oobj/gcc/llama.o llama.cpp/llama.cpp
gcc $CFLAGS -oobj/gcc/ggml.o llama.cpp/ggml.c
gcc $CFLAGS -oobj/gcc/ggml-alloc.o llama.cpp/ggml-alloc.c
gcc $CFLAGS -oobj/gcc/ggml-backend.o llama.cpp/ggml-backend.c
gcc $CFLAGS -oobj/gcc/ggml-quants.o llama.cpp/ggml-quants.c
gcc $CXXFLAGS -oobj/gcc/common.o llama.cpp/common/common.cpp
gcc $CXXFLAGS -oobj/gcc/sampling.o llama.cpp/common/sampling.cpp
gcc $CXXFLAGS -oobj/gcc/grammar-parser.o llama.cpp/common/grammar-parser.cpp
gcc $CXXFLAGS -oobj/gcc/build-info.o llama.cpp/common/build-info.cpp
ar rc lib/libllama.a obj/gcc/hllama.o obj/gcc/llama.o
obj/gcc/ggml.o obj/gcc/ggml-alloc.o obj/gcc/ggml-backend.o
obj/gcc/ggml-quants.o obj/gcc/common.o obj/gcc/sampling.o
obj/gcc/grammar-parser.o obj/gcc/build-info.o
go64tst1.sh :
#!/bin/bash
# Set your Harbour path here
export HRB_DIR=/home/gama/harbour
$HRB_DIR/bin/harbour -n -q -i$HRB_DIR/include test1.prg
gcc -c -Wall -I$HRB_DIR/include -otest1.o test1.c
gcc test1.o -otest1 -L$HRB_DIR/lib/linux/gcc -Llib -Wl,--start-group -lgttrm -lhbvm -lhbrtl -lgtcgi -lgttrm -lhbcpage -lhblang -lhbrdd -lhbmacro -lhbpp -lrddntx -lrddcdx -lrddfpt -lhbsix -lhbcommon -lhbct -lhbcplr -lhbpcre -lhbzlib -lllama -lpthread -lm -lz -lpcre -ldl -Wl,--end-group -fPIC -O3 -Wall -lstdc++ -shared-libgcc
Starting ./go64lib.sh I have created libllama.a in /home/gama/llama_prg/lib directory.
With go64tst1.sh got error you can see in attachment. Line 5 is: $HRB_DIR/bin/harbour -n -q -i$HRB_DIR/include test1.prg .
In directory /gama/harbour/bin I do not have subdirectory with name harbour. Do I need to create it ? Also can not understand other error messages.
Can somebody help me what to do ?
Regards,
Simo.
--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/4b8a270a-603d-4fc5-a984-5e6adcf34471n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/6e96b942-dd59-4a38-8131-84891c0ce851n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/6dee06a3-1ed0-46bb-a9e9-60b235f9968fn%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/de2982d9-ad5b-4812-a1ed-68514362e178n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/04263d1a-9c90-43fc-b619-11654dced4b4n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/c06730c8-c7fd-4679-91e7-cd931821e09bn%40googlegroups.com.



Simo,
> With go64tst1.sh got error you can see in attachment. Line 5 is: $HRB_DIR/bin/harbour -n -q -i$HRB_DIR/include test1.prg .
> In directory /gama/harbour/bin I do not have subdirectory with name harbour.
Hi Alexander.
Just to report what I did with llama_prg on Windows.
I have managed to build llama.lib and test1.exe using your .bat files, according to your suggestions.
As I have installed Visual Studio Community 2022, a tried to set paths in your .bat files to my situation, but did not succeeded.
So I did what you suggested: I simplified bat files replacing four lines ( SET PATH, SET INCLUDE, SET LIB, SET LIBPATH ) with this one:
call "c:\Program Files (x86)\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
After that I built llama.lib and test1.exe.
I made test1.exe with default GT. After I start test1.exe I must wait about 45-50 seconds to see response. But response works this way: On the screen is written first sentence of response. Then same sentence continues to repeat, until screen is filled with that repeating text.
Same happened with test1.exe using gtvwt.
I worked with llama_prg version before April 10.
This does not happened on Linux. There is no wait time, and response is normal, all correct response is displayed. No repeating any part of text.
Regards,
Simo.Hi Alexander.
On Windows could not make llama.lib with clip.cpp and llava.cpp.
Then I built llama.lib without this two .cpp files.
After that I made test1.exe. It works OK, now response displayed with no repeating text (used phi-2_Q4_K_M.gguf).
If you have time please suggest how to solve problem with clipp.cpp. I am sending bat file (renamed to txt) I used to build lib. Also I am sending file with output of that bat file with error for clip.cpp (and llava.cpp).
Thank you and Regards,
Simo.
Hi Alexander.
I tried new version of llama_prg on Linux.
When building library I have errors that it cannot find some header files, clip.h and llava.h .
Then I added -Illama.cpp/llava to next lines:
gcc $CXXFLAGS -oobj/gcc/hllama.o -Illama.cpp/llava source/hllama.cpp
gcc $CXXFLAGS -oobj/gcc/hllava.o -Illama.cpp/llava source/hllava.cpp
…
…
gcc $CXXFLAGS -oobj/gcc/clip.o -Illama.cpp/llava llama.cpp/llava/clip.cpp
gcc $CXXFLAGS -oobj/gcc/llava.o -Illama.cpp/llava llama.cpp/llava/llava.cpp
After that I succeeded to build library.
Did not have problems with building examples. Executable test1 works OK. No wait time, response start immediately.
With executable test3 ggml-model-q5_k.gguf mmproj-model-f16.gguf myimg.jpg I got answer "Loading ..", then nothing in next one minute, and finally it finished without any comment on image. I used small JPG image, same as on Windows.
Regards,
Simo.
Hi Alexander.
New test on Windows:
On Sunday afternoon I made fresh new llama_prg .
Windows commands from your README.md for creating library works OK.
Windows commands from your README.md for creating examples works OK.
I have only simplified bat files replacing four lines ( SET PATH, SET INCLUDE, SET LIB, SET LIBPATH ) with call "c:\Program Files (x86)\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64, as you suggested.
Test1.exe and test2.exe works OK. Wait time to respond was about 30 seconds. Before this version it was about 50 seconds. This time better.
Test3 works this way:
First I see "Loading …". Then after 60 seconds appears "Image processing …" (this message do not exist on Linux). Then I must wait about 10 minutes to see start of response. Response is very, very slow, but it describes image.
As you explained this is normal behavior for my computer.
Test done on desktop PC with 4 GB RAM, old Intel i5, 120 GB free on non SSD disk, Windows 10.
Regards,
Simo.
Hi Alexander.
Most new test on Windows 64 bit. I have installed all on computer with better configuration.
Test was on laptop with 16 GB RAM, Intel i7, with 100 GB free on SSD disk.
I have cloned Llama_prg on monday morning.
I have created library and examples without any problems.
Test1.exe and test2.exe works OK. No wait time, response started immediately. Clean ans fast.
Test3 also works very good:
First I see "Loading …". Message "Image processing …" appears immediately.
Then I must wait about 60 seconds to see start of response. Response was at normal speed, describing image. No pauses in response.
Regards,
Simo.
Hi Alexander.
Test on Kubuntu Linux:
Laptop with 16 GB RAM, Intel i7, with 40 GB free on SSD disk.
I have cloned Llama_prg on Tuesday morning.
I have created library and examples without any problems.
Test1.exe and test2.exe works OK. No wait time, response started immediately. Clean and fast.
Test3 also works OK:
First I see "Loading …". Message "Image processing …" appears immediately.
Then I must wait about 35 seconds to see start of response. Response is at normal speed. It describes image. At the end it displays some statistics about image processing.
Regards,
Simo.
For building whisper.lib on Windows i had to change line:
cl.exe %CXXFLAGS% /Fo%OBJ%\hwhisper.obj llama.cpp\source\hwhisper.cpp
to this line:
cl.exe %CXXFLAGS% /I%HB_PATH%\include /Fo%OBJ%\hwhisper.obj source\hwhisper.cpp
Regards,
Simo.
audi_setcallback
audi_record
audi_abort
Regards,
Simo.