-
Notifications
You must be signed in to change notification settings - Fork 155
Expand file tree
/
Copy pathMakefile
More file actions
21 lines (16 loc) · 807 Bytes
/
Makefile
File metadata and controls
21 lines (16 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
.PHONY: fmt test prepare _ensure_ollama_create _ensure_ollama_model
fmt:
cargo fmt
cargo clippy --fix --allow-dirty
test: prepare
cargo test
prepare:
@$(MAKE) _ensure_ollama_create NAME=mario MODELFILE=ollama-rs/tests/model/Modelfile.mario
@$(MAKE) _ensure_ollama_create NAME=test_model MODELFILE=ollama-rs/tests/model/Modelfile.test_model
@$(MAKE) _ensure_ollama_model MODEL=llama2:latest
@$(MAKE) _ensure_ollama_model MODEL=granite-code:3b
@$(MAKE) _ensure_ollama_model MODEL=llava:latest
_ensure_ollama_create:
@ollama list 2>/dev/null | awk 'NR>1 {print $$1}' | grep -qxF '$(if $(strip $(MODEL)),$(MODEL),$(NAME):latest)' || ollama create '$(NAME)' -f '$(MODELFILE)'
_ensure_ollama_model:
@ollama list 2>/dev/null | awk 'NR>1 {print $$1}' | grep -qxF '$(MODEL)' || ollama pull '$(MODEL)'