Skip to content

Commit 749d758

Browse files
committed
Convert llama2.so to fetch_content
1 parent 1e2064a commit 749d758

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@
44
[submodule "cpp/third-party/llama2.c"]
55
path = cpp/third-party/llama2.c
66
url = https://github.com/karpathy/llama2.c
7-
[submodule "cpp/third-party/llama2.so"]
8-
path = cpp/third-party/llama2.so
9-
url = https://github.com/mreso/llama2.so.git

cpp/third-party/llama2.so

-1
This file was deleted.

examples/cpp/aot_inductor/llama2/CMakeLists.txt

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11

2+
FetchContent_Declare(
3+
llama2_so
4+
GIT_REPOSITORY https://github.com/mreso/llama2.so.git
5+
GIT_TAG 370154d
6+
)
7+
8+
if(NOT llama2_so_POPULATED)
9+
message(STATUS "Fetching llama2.so...")
10+
FetchContent_Populate(llama2_so)
11+
endif()
12+
213
FetchContent_Declare(
314
stories15M_pt
415
URL https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.pt?download=true
@@ -16,7 +27,7 @@ add_custom_command(
1627
)
1728

1829

19-
add_library(llama2_so STATIC ../../../../cpp/third-party/llama2.so/run.cpp)
30+
add_library(llama2_so STATIC ${llama2_so_SOURCE_DIR}/run.cpp)
2031
target_compile_options(llama2_so PRIVATE -Wall -Wextra -Ofast -fpermissive)
2132

2233
add_library(llama_so_handler SHARED src/llama_handler.cc stories15M.so)

0 commit comments

Comments
 (0)