Skip to content

Commit

Permalink
Reorganize examples
Browse files Browse the repository at this point in the history
  • Loading branch information
bullno1 committed Dec 19, 2023
1 parent 1abbe33 commit 1036ebe
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 42 deletions.
43 changes: 4 additions & 39 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,7 @@ SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "\${ORIGIN}")

add_executable(hey_tokenize "tokenize.c")
target_link_libraries(
hey_tokenize PRIVATE
argparse
hey
llama
)
set_target_properties(hey_tokenize PROPERTIES OUTPUT_NAME "tokenize")

add_executable(hey_generate "generate.c")
target_link_libraries(
hey_generate PRIVATE
argparse
hey
llama
sokol
)
set_target_properties(hey_generate PROPERTIES OUTPUT_NAME "generate")

add_executable(hey_knockknock "knockknock.c")
target_link_libraries(
hey_knockknock PRIVATE
argparse
hey
llama
sokol
)
set_target_properties(hey_knockknock PROPERTIES OUTPUT_NAME "knockknock")

add_executable(hey_calculator "calculator.c")
target_link_libraries(
hey_calculator PRIVATE
argparse
hey
llama
sokol
expr
)
set_target_properties(hey_calculator PROPERTIES OUTPUT_NAME "calculator")
include(tokenize.cmake)
include(generate.cmake)
include(knocknock.cmake)
include(calculator.cmake)
File renamed without changes.
10 changes: 10 additions & 0 deletions examples/calculator.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
add_executable(hey_calculator "calculator.c")
target_link_libraries(
hey_calculator PRIVATE
argparse
hey
llama
sokol
expr
)
set_target_properties(hey_calculator PROPERTIES OUTPUT_NAME "calculator")
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
./build
bin/generate \
--model=${HEY_MODEL_DIR:-~/Downloads}/nous-hermes-llama2-13b.Q5_K_M.gguf \
--input=examples/nous-hermes-generate.txt
--input=examples/generate-nous-hermes.txt
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/test-generate → examples/generate-zephyr
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
./build
bin/generate \
--model=${HEY_MODEL_DIR:-~/Downloads}/zephyr-7b-beta.Q5_K_M.gguf \
--input=examples/zephyr-generate.txt
--input=examples/generate-zephyr.txt
File renamed without changes.
9 changes: 9 additions & 0 deletions examples/generate.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_executable(hey_generate "generate.c")
target_link_libraries(
hey_generate PRIVATE
argparse
hey
llama
sokol
)
set_target_properties(hey_generate PROPERTIES OUTPUT_NAME "generate")
2 changes: 1 addition & 1 deletion scripts/test-knockknock → examples/knockknock
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
./build
bin/knockknock \
--model=${HEY_MODEL_DIR:-~/Downloads}/nous-hermes-llama2-13b.Q5_K_M.gguf \
--input=examples/nous-hermes-generate.txt
--input=/dev/null
9 changes: 9 additions & 0 deletions examples/knocknock.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_executable(hey_knockknock "knockknock.c")
target_link_libraries(
hey_knockknock PRIVATE
argparse
hey
llama
sokol
)
set_target_properties(hey_knockknock PROPERTIES OUTPUT_NAME "knockknock")
8 changes: 8 additions & 0 deletions examples/tokenize.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
add_executable(hey_tokenize "tokenize.c")
target_link_libraries(
hey_tokenize PRIVATE
argparse
hey
llama
)
set_target_properties(hey_tokenize PROPERTIES OUTPUT_NAME "tokenize")

0 comments on commit 1036ebe

Please sign in to comment.