llama: add clip dependencies

This commit is contained in:
jmorganca
2024-05-19 14:06:46 -07:00
committed by Daniel Hiltgen
parent 2a41ad5b1f
commit 5818e3b210
5 changed files with 11393 additions and 1 deletions

View File

@@ -44,6 +44,12 @@ mkdir -p $dst_dir/ggml-cuda
cp $src_dir/ggml-cuda/*.cu $dst_dir/ggml-cuda/
cp $src_dir/ggml-cuda/*.cuh $dst_dir/ggml-cuda/
# clip
cp $src_dir/examples/llava/clip.cpp $dst_dir/clip.cpp
cp $src_dir/examples/llava/clip.h $dst_dir/clip.h
cp $src_dir/common/log.h $dst_dir/log.h
cp $src_dir/common/stb_image.h $dst_dir/stb_image.h
# apply patches
for patch in $dst_dir/patches/*.patch; do
git apply "$patch"
@@ -77,7 +83,6 @@ for IN in $dst_dir/*.{c,h,cpp,m,metal,cu}; do
done
# ggml-metal
sed -i '' '1s;^;// go:build darwin && arm64\n\n;' $dst_dir/ggml-metal.m
sed -e '/#include "ggml-common.h"/r ggml-common.h' -e '/#include "ggml-common.h"/d' < $dst_dir/ggml-metal.metal > temp.metal
TEMP_ASSEMBLY=$(mktemp)
echo ".section __DATA, __ggml_metallib" > $TEMP_ASSEMBLY