mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 05:48:47 +01:00
fix for building with no internet connection
This commit is contained in:
parent
c2a16c0bdb
commit
d277fdcf43
@ -4,7 +4,25 @@ install(TARGETS ${TARGET} RUNTIME)
|
||||
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_compile_features(${TARGET} PRIVATE cxx_std_17)
|
||||
|
||||
set(TEST_TARGET test-eval-callback)
|
||||
add_test(NAME ${TEST_TARGET}
|
||||
COMMAND llama-eval-callback --hf-repo ggml-org/models --hf-file tinyllamas/stories260K.gguf --model stories260K.gguf --prompt hello --seed 42 -ngl 0)
|
||||
set_property(TEST ${TEST_TARGET} PROPERTY LABELS eval-callback curl)
|
||||
if(MSVC)
|
||||
execute_process(
|
||||
COMMAND ping www.google.com -n 2
|
||||
ERROR_QUIET
|
||||
RESULT_VARIABLE NO_CONNECTION
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND ping www.google.com -c 2
|
||||
ERROR_QUIET
|
||||
RESULT_VARIABLE NO_CONNECTION
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT NO_CONNECTION EQUAL 0)
|
||||
message(WARNING "Offline mode!")
|
||||
else()
|
||||
set(TEST_TARGET test-eval-callback)
|
||||
add_test(NAME ${TEST_TARGET}
|
||||
COMMAND llama-eval-callback --hf-repo ggml-org/models --hf-file tinyllamas/stories260K.gguf --model stories260K.gguf --prompt hello --seed 42 -ngl 0)
|
||||
set_property(TEST ${TEST_TARGET} PROPERTY LABELS eval-callback curl)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user