mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-12 13:27:21 +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_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
|
||||||
target_compile_features(${TARGET} PRIVATE cxx_std_17)
|
target_compile_features(${TARGET} PRIVATE cxx_std_17)
|
||||||
|
|
||||||
|
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)
|
set(TEST_TARGET test-eval-callback)
|
||||||
add_test(NAME ${TEST_TARGET}
|
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)
|
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)
|
set_property(TEST ${TEST_TARGET} PROPERTY LABELS eval-callback curl)
|
||||||
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user