Skip to content

Commit

Permalink
On native macOS this was returning an incorrect path
Browse files Browse the repository at this point in the history
$ ramalama --dryrun run granite-code
llama-run -c 2048 --temp 0.8 /path/to/model

Signed-off-by: Eric Curtin <[email protected]>
  • Loading branch information
ericcurtin committed Feb 5, 2025
1 parent a08b166 commit 1a68aa1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 0 additions & 3 deletions ramalama/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,6 @@ def build_prompt(self, args):
return prompt

def get_model_path(self, args):
if args.dryrun:
return "/path/to/model"

model_path = self.exists(args)
if not model_path:
model_path = self.pull(args)
Expand Down
2 changes: 1 addition & 1 deletion test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ load helpers
is "$output" ".*${image}:1234 llama-run" "verify image name"
else
run_ramalama --dryrun run -c 4096 ${model}
is "$output" 'llama-run -c 4096 --temp 0.8.*/path/to/model.*' "dryrun correct"
is "$output" 'llama-run -c 4096 --temp 0.8 .*tinyllama:latest' "dryrun correct"
is "$output" ".*-c 4096" "verify model name"

run_ramalama 1 run --ctx-size=4096 --name foobar tiny
Expand Down
8 changes: 3 additions & 5 deletions test/system/040-serve.bats
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ verify_begin=".*run --rm -i --label RAMALAMA --security-opt=label=disable --name

if is_container; then
run_ramalama --dryrun serve ${model}
is "$output" "${verify_begin} ramalama_.*" "dryrun correct"
is "$output" ".*${model}" "verify model name"
is "$output" ".*${model} was not found in the Ollama registry" "dryrun correct"

run_ramalama --dryrun serve --name foobar ${model}
is "$output" "${verify_begin} foobar .*" "dryrun correct with --name"
Expand All @@ -36,10 +35,9 @@ verify_begin=".*run --rm -i --label RAMALAMA --security-opt=label=disable --name
run_ramalama stop --all
else
run_ramalama --dryrun serve ${model}
assert "$output" =~ ".*--host 0.0.0.0" "Outside container sets host to 0.0.0.0"
is "$output" ".*${model} was not found in the Ollama registry" "dryrun correct"
run_ramalama --dryrun serve --seed abcd --host 127.0.0.1 ${model}
assert "$output" =~ ".*--host 127.0.0.1" "Outside container overrides host to 127.0.0.1"
assert "$output" =~ ".*--seed abcd" "Verify seed is set"
is "$output" ".*${model} was not found in the Ollama registry" "dryrun correct"
run_ramalama 1 --nocontainer serve --name foobar tiny
is "${lines[0]}" "Error: --nocontainer and --name options conflict. --name requires a container." "conflict between nocontainer and --name line"
fi
Expand Down

0 comments on commit 1a68aa1

Please sign in to comment.