Skip to content

Commit

Permalink
Use container right now
Browse files Browse the repository at this point in the history
ramalama run/serve right now require the container, it has the version
of llama.cpp that works.

Long-term we may be able to remove this.

Signed-off-by: Eric Curtin <[email protected]>
  • Loading branch information
ericcurtin committed Jul 31, 2024
1 parent 3776c27 commit a6c69f6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ main() {
./ramalama list | grep tinyllama
./ramalama list | grep tiny-vicuna-1b
./ramalama list | grep NAME

if [ "$os" = "Linux" ]; then # no macos support for running/serving models yet
set +o pipefail
timeout -s9 16 ./ramalama serve tinyllama | grep -m1 -i listen
set -o pipefail
fi

# ramalama list | grep granite-code
# ramalama rm granite-code
}
Expand Down
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ main() {
local url="raw.githubusercontent.com/containers/ramalama/main/$from"
local from="$TMP/$from"
download
pip install "huggingface_hub[cli]==0.24.2"
install -D -m755 "$from" "$bindir/"

if false; then # to be done
Expand Down
6 changes: 6 additions & 0 deletions ramalama
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def list_cli(ramalama_store, args):


funcDict["list"] = list_cli
funcDict["ls"] = list_cli


def pull_huggingface(model, ramalama_store):
Expand Down Expand Up @@ -343,6 +344,11 @@ def main(args):
ramalama_store = get_ramalama_store()

try:
cmd = args[0]
if conman and (cmd == 'serve' or cmd == 'run'):
conman_args = [conman, "run", "--rm", "-it", "--security-opt=label=disable", f"-v{ramalama_store}:/var/lib/ramalama", f"-v{os.path.expanduser('~')}:{os.path.expanduser('~')}", "-v/tmp:/tmp",
f"-v{__file__}:{__file__}", "quay.io/ramalama/ramalama:latest", __file__] + args
os.execvp(conman, conman_args)
cmd = args.pop(0)
funcDict[cmd](ramalama_store, args)
except IndexError:
Expand Down

0 comments on commit a6c69f6

Please sign in to comment.