Skip to content

Commit

Permalink
Try to download the model after the installation
Browse files Browse the repository at this point in the history
  • Loading branch information
pperezredborder committed Jul 24, 2024
1 parent 76a65b8 commit ce5ca6a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ all: rpm
rpm:
mkdir -p resources/model
@printf "$(MKL_YELLOW)Downloading the model $(BIN)$(MKL_CLR_RESET)\n"
curl -L https://huggingface.co/Mozilla/llava-v1.5-7b-llamafile/resolve/main/llava-v1.5-7b-q4.llamafile?download=true -o resources/model/llava-v1.5-7b-q4.llamafile
@if [ ! -f resources/model/llava-v1.5-7b-q4.llamafile ]; then printf "$(MKL_RED)Model dont downloaded$(MKL_CLR_RESET)\n"; exit 1; fi
# curl -L https://huggingface.co/Mozilla/llava-v1.5-7b-llamafile/resolve/main/llava-v1.5-7b-q4.llamafile?download=true -o resources/model/llava-v1.5-7b-q4.llamafile
# @if [ ! -f resources/model/llava-v1.5-7b-q4.llamafile ]; then printf "$(MKL_RED)Model dont downloaded$(MKL_CLR_RESET)\n"; exit 1; fi
@printf "$(MKL_GREEN)Model downloaded successfully$(MKL_CLR_RESET)\n"
$(MAKE) -C packaging/rpm

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This service is part of the RedBorder Incident Response. Its task is to us an AI
For specific details use:

```sh
/usr/lib/redborder/bin/llava-v1.5-7b-q4.llamafile --help
rb_ai.sh --help
```

The service executes in port 50505.
Expand Down
3 changes: 1 addition & 2 deletions packaging/rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ SOURCES:
mkdir -p SOURCES

archive: SOURCES
cp ../../resources/model/* SOURCES/
# cp ../../resources/model/* SOURCES/
cd ../../ && \
git archive --prefix=$(PACKAGE_NAME)-$(VERSION)/ \
--add-file resources/model/* \
-o packaging/rpm/SOURCES/$(PACKAGE_NAME)-$(VERSION).tar.gz HEAD


Expand Down
4 changes: 3 additions & 1 deletion packaging/rpm/redborder-ai.spec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Requires: bash
mkdir -p %{buildroot}/etc/redborder
mkdir -p %{buildroot}/usr/lib/redborder/bin
cp resources/bin/* %{buildroot}/usr/lib/redborder/bin
cp llava* %{buildroot}/usr/lib/redborder/bin
# cp llava* %{buildroot}/usr/lib/redborder/bin
chmod 0755 %{buildroot}/usr/lib/redborder/bin/*
install -D -m 0644 resources/systemd/llamafile.service %{buildroot}/usr/lib/systemd/system/llamafile.service

Expand All @@ -31,6 +31,8 @@ install -D -m 0644 resources/systemd/llamafile.service %{buildroot}/usr/lib/syst
%post
firewall-cmd --zone=home --add-port=50505/tcp --permanent
firewall-cmd --reload
curl -L https://huggingface.co/Mozilla/llava-v1.5-7b-llamafile/resolve/main/llava-v1.5-7b-q4.llamafile?download=true -o %{buildroot}/usr/lib/redborder/bin
chmod 0755 %{buildroot}/usr/lib/redborder/bin/*
systemctl daemon-reload
systemctl enable llamafile.service
systemctl restart llamafile.service
Expand Down

0 comments on commit ce5ca6a

Please sign in to comment.