Skip to content

Commit

Permalink
:s/llama.cpp/whisper.cpp/g
Browse files Browse the repository at this point in the history
  • Loading branch information
cjpais committed Jun 11, 2024
1 parent b31a46f commit 5b09314
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 24 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ include whisper.cpp/BUILD.mk
# the root package is `o//` by default
# building a package also builds its sub-packages
.PHONY: o/$(MODE)/
#o/$(MODE)/: o/$(MODE)/llama.cpp o/$(MODE)/llamafile
o/$(MODE)/: o/$(MODE)/llama.cpp o/$(MODE)/whisper.cpp o/$(MODE)/llamafile
o/$(MODE)/: o/$(MODE)/whisper.cpp o/$(MODE)/llamafile

# for installing to `make PREFIX=/usr/local`
.PHONY: install
Expand Down
16 changes: 8 additions & 8 deletions llamafile/copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ set -x
HOST=${1:?HOST}

ssh $HOST mkdir -p lfbuild
scp llama.cpp/ggml-cuda.cu \
llama.cpp/ggml-cuda.h \
llama.cpp/ggml-impl.h \
llama.cpp/ggml-alloc.h \
llama.cpp/ggml-common.h \
llama.cpp/ggml-backend.h \
llama.cpp/ggml-backend-impl.h \
llama.cpp/ggml.h \
scp whisper.cpp/ggml-cuda.cu \
whisper.cpp/ggml-cuda.h \
whisper.cpp/ggml-impl.h \
whisper.cpp/ggml-alloc.h \
whisper.cpp/ggml-common.h \
whisper.cpp/ggml-backend.h \
whisper.cpp/ggml-backend-impl.h \
whisper.cpp/ggml.h \
llamafile/tinyblas.h \
llamafile/tinyblas.cu \
llamafile/llamafile.h \
Expand Down
16 changes: 8 additions & 8 deletions llamafile/cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

TMP=$(mktemp -d) || exit

cp llama.cpp/ggml-cuda.cu \
llama.cpp/ggml-cuda.h \
llama.cpp/ggml-impl.h \
llama.cpp/ggml-alloc.h \
llama.cpp/ggml-common.h \
llama.cpp/ggml-backend.h \
llama.cpp/ggml-backend-impl.h \
llama.cpp/ggml.h \
cp whisper.cpp/ggml-cuda.cu \
whisper.cpp/ggml-cuda.h \
whisper.cpp/ggml-impl.h \
whisper.cpp/ggml-alloc.h \
whisper.cpp/ggml-common.h \
whisper.cpp/ggml-backend.h \
whisper.cpp/ggml-backend-impl.h \
whisper.cpp/ggml.h \
llamafile/tinyblas.h \
llamafile/tinyblas.cu \
llamafile/llamafile.h \
Expand Down
6 changes: 3 additions & 3 deletions whisper.cpp/ggml-quants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re

with open('llama.cpp/ggml-quants.h') as f:
with open('whisper.cpp/ggml-quants.h') as f:
prototypes = f.read()
prototypes = [line.replace(';', '') for line in prototypes.split('\n')
if line.endswith(';') and not line.startswith('//')]
Expand All @@ -19,15 +19,15 @@
)

for arch, mac, needs in ARCHS:
path = 'llama.cpp/ggml-quants-%s.c' % (arch.replace('_', '-'))
path = 'whisper.cpp/ggml-quants-%s.c' % (arch.replace('_', '-'))
with open(path, 'w') as f:
f.write('#ifdef %s\n' % (mac))
for func, proto in FUNCS:
f.write('#define %s %s_%s\n' % (func, func, arch))
f.write('#include "ggml-quants.inc"\n')
f.write('#endif // %s\n' % (mac))

with open('llama.cpp/ggml-quants.cpp', 'w') as f:
with open('whisper.cpp/ggml-quants.cpp', 'w') as f:
f.write('#include <cosmo.h>\n')
f.write('#include <sys/auxv.h>\n')
f.write('#include <libc/sysv/consts/hwcap.h>\n')
Expand Down
6 changes: 3 additions & 3 deletions whisper.cpp/ggml-vector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re

with open('llama.cpp/ggml-vector.h') as f:
with open('whisper.cpp/ggml-vector.h') as f:
prototypes = f.read()
prototypes = [line.replace(';', '') for line in prototypes.split('\n')
if line.endswith(';') and not line.startswith('//') and '(' in line]
Expand All @@ -23,7 +23,7 @@
)

for arch, mac, needs in ARCHS:
path = 'llama.cpp/ggml-vector-%s.c' % (arch.replace('_', '-'))
path = 'whisper.cpp/ggml-vector-%s.c' % (arch.replace('_', '-'))
with open(path, 'w') as f:
f.write('#ifdef %s\n' % (mac))
for func, proto in FUNCS:
Expand All @@ -32,7 +32,7 @@
f.write('#include "ggml-vector.inc"\n')
f.write('#endif // %s\n' % (mac))

with open('llama.cpp/ggml-vector.cpp', 'w') as f:
with open('whisper.cpp/ggml-vector.cpp', 'w') as f:
f.write('#include <cosmo.h>\n')
f.write('#include <sys/auxv.h>\n')
f.write('#include <libc/sysv/consts/hwcap.h>\n')
Expand Down

0 comments on commit 5b09314

Please sign in to comment.