Skip to content

Commit

Permalink
ollama with model llama3.2 directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Wang committed Oct 16, 2024
1 parent f424d03 commit 62e0542
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_ollama.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
tar zxvf go-containerregistry_Linux_x86_64.tar.gz
chmod +x crane
export VERSION=($(docker run -i --rm ${{ steps.meta.outputs.tags }} --version||awk '$1=$1' |awk '/version/{print $NF}'))
export VERSION=($(docker run -i --rm ${{ steps.meta.outputs.tags }} --version|awk '$1=$1' |awk '/version/{print $NF}'))
echo $VERSION
./crane auth login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} index.docker.io
./crane copy ${{ steps.meta.outputs.tags }} ${{ env.IMAGE_NAME }}:latest
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile.llama3.2
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ COPY --from=ollama /usr/lib/ollama/runners/cpu /usr/lib/ollama/runners/cpu

# In this image, we download llama3.2 model directly
RUN /usr/bin/ollama serve & sleep 5 && \
/usr/bin/ollama pull llama3.2 && \
pkill ollama && \
sleep 3
/usr/bin/ollama pull llama3.2

# Environment variable setup
ENV OLLAMA_HOST=0.0.0.0
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ docker run -d -p 11434:11434 -v ~/.ollama/root/.ollama --name ollama alpine/olla
docker exec -ti ollama ollama pull llama3.2
```

If you don't want to download, you can choice to use `alpine/llama3.2` image directly. I create this for only llama3.2

* Run the service with API supported
If you don't want to download, you can choice to use `alpine/llama3.2` image directly. I create this with model "llama3.2" integrated already

```
docker run -d -p 11434:11434 -v ~/.ollama/root/.ollama alpine/ollama
docker run -d -p 11434:11434 --name llama3.2 alpine/llama3.2
```

* Test its API service with curl
Expand Down

0 comments on commit 62e0542

Please sign in to comment.