mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-27 03:44:35 +00:00
Add main.cpp back and invoke "run" from it
Signed-off-by: Thiago Padilha <thiago@padilha.cc>
This commit is contained in:
parent
90175ee13f
commit
d7d53b84db
@ -239,7 +239,9 @@ target_link_libraries(llama PRIVATE utils ggml ${LLAMA_EXTRA_LIBS})
|
||||
# Executables
|
||||
#
|
||||
|
||||
add_executable(main run.cpp)
|
||||
add_executable(main
|
||||
main.cpp
|
||||
run.cpp)
|
||||
target_link_libraries(main PRIVATE llama ggml utils)
|
||||
|
||||
add_executable(quantize quantize.cpp)
|
||||
|
7
Makefile
7
Makefile
@ -226,11 +226,14 @@ llama.o: llama.cpp llama.h
|
||||
utils.o: utils.cpp utils.h
|
||||
$(CXX) $(CXXFLAGS) -c utils.cpp -o utils.o
|
||||
|
||||
run.o: run.cpp run.h
|
||||
$(CXX) $(CXXFLAGS) -c run.cpp -o run.o
|
||||
|
||||
clean:
|
||||
rm -f *.o main quantize
|
||||
|
||||
main: run.cpp ggml.o llama.o utils.o
|
||||
$(CXX) $(CXXFLAGS) run.cpp ggml.o llama.o utils.o -o main $(LDFLAGS)
|
||||
main: main.cpp ggml.o llama.o utils.o run.o
|
||||
$(CXX) $(CXXFLAGS) main.cpp ggml.o llama.o utils.o run.o -o main $(LDFLAGS)
|
||||
@echo "\x1b[36mrun ./main -h for help\x1b[0m"
|
||||
|
||||
quantize: quantize.cpp ggml.o llama.o utils.o
|
||||
|
5
main.cpp
Normal file
5
main.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
#include "run.h"
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
return run(argc, argv);
|
||||
}
|
2
run.cpp
2
run.cpp
@ -154,7 +154,7 @@ void sigint_handler(int signo) {
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
int run(int argc, char ** argv) {
|
||||
// has to be called once at the start of the program to init ggml stuff
|
||||
ggml_time_init();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user