Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
5156e48c
Commit
5156e48c
authored
Jul 19, 2023
by
Michael Yang
Browse files
add script to update llama.cpp
parent
924ce739
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
llama/update-llama-cpp.sh
llama/update-llama-cpp.sh
+61
-0
No files found.
llama/update-llama-cpp.sh
0 → 100644
View file @
5156e48c
#!/bin/sh
set
-eu
status
()
{
echo
>
&2
">>>
$*
"
;
}
error
()
{
status
"ERROR
$*
"
;
}
usage
()
{
echo
"usage:
$(
basename
$0
)
/path/to/repo"
exit
1
}
OUT
=
$(
dirname
$0
)
while
getopts
"hC:"
OPTION
;
do
case
$OPTION
in
C
)
OUT
=
$OPTARG
;;
*
)
usage
;;
esac
done
shift
$((
$OPTIND
-
1
))
[
$#
-eq
1
]
||
usage
status
"updating source..."
cp
-a
"
$1
"
/
*
.
{
c,h,cpp,m,metal,cu
}
"
$OUT
"
status
"removing incompatible files..."
rm
-f
"
$OUT
"
/build-info.h
rm
-f
"
$OUT
"
/ggml-
{
mpi,opencl
}
.
*
SHA1
=
$(
git
-C
$1
rev-parse @
)
LICENSE
=
$(
mktemp
)
cleanup
()
{
rm
-f
$LICENSE
}
trap
cleanup 0
cat
<<
EOF
| sed 's/ *
$/
/' >
$LICENSE
/**
* llama.cpp - git
$SHA1
*
$(
sed
's/^/ * /'
<
$1
/LICENSE
)
*/
EOF
for
f
in
$OUT
/
*
.
{
c,h,cpp,m,metal,cu
}
;
do
TMP
=
$(
mktemp
)
status
"updating license:
$f
"
cat
$LICENSE
$f
>
$TMP
mv
$TMP
$f
done
status
"touching up MacOS files..."
TMP
=
$(
mktemp
)
{
echo
"// +build darwin"
echo
}
|
cat
-
$OUT
/ggml-metal.m
>
$TMP
mv
$TMP
$OUT
/ggml-metal.m
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment