Skip to content

Commit

Permalink
Add model download and header prep as part of Makefile.uk
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Jung <alex@unikraft.io>
  • Loading branch information
nderjung committed Oct 22, 2023
1 parent abae8a5 commit dbcde60
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ model.h
workdir/
build/
stories15M.bin
model.bin
12 changes: 12 additions & 0 deletions Makefile.uk
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,15 @@ L2E_SRCS-y += $(L2E_BASE)/run.c
L2E_SRCS-y += $(L2E_BASE)/model.h
L2E_SRCS-y += $(L2E_BASE)/tokenizer.h
L2E_CFLAGS-y += -DUNIK

$(L2E_BASE)/model.h: $(L2E_BASE)/strlit $(L2E_BASE)/model.bin
$(L2E_BASE)/strlit -i emb_Model_data $(L2E_BASE)/model.bin $@

$(L2E_BASE)/model.bin:
$(WGET) -O $@ https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin

$(L2E_BASE)/tokenizer.h: $(L2E_BASE)/strlit
$(L2E_BASE)/strlit -i emb_Model_data $(L2E_BASE)/tokenizer.bin $@

$(L2E_BASE)/strlit:
$(CC) -Ofast $(L2E_BASE)/strliteral.c -o $@

0 comments on commit dbcde60

Please sign in to comment.