Ollama openvino integration #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ollama_openvino_build_and_test | |
on: | |
pull_request: | |
paths: | |
- 'modules/ollama_openvino/**' | |
- '.github/workflows/ollama_openvino_build_and_test' | |
permissions: read-all | |
jobs: | |
test_ubuntu20: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Download repo | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
repository: FionaZZ92/openvino_contrib | |
path: openvino_contrib | |
- name: Setup python env | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install go | |
run: | | |
wget https://go.dev/dl/go1.24.1.linux-amd64.tar.gz | |
mkdir -p go | |
tar xvzf go1.24.1.linux-amd64.tar.gz | |
- name: Install openvino_genai | |
run: | | |
wget https://storage.openvinotoolkit.org/repositories/openvino_genai/packages/nightly/2025.2.0.0.dev20250320/openvino_genai_ubuntu20_2025.2.0.0.dev20250320_x86_64.tar.gz | |
tar -xzf openvino_genai_ubuntu20_2025.2.0.0.dev20250320_x86_64.tar.gz | |
source openvino_genai_ubuntu20_2025.2.0.0.dev20250320_x86_64/setupvars.sh | |
- name: Prepare compile | |
run: | | |
chmod +x ./ | |
export LD_LIBRARY_PATH=${{ github.workspace }}/go/bin:$LD_LIBRARY_PATH | |
go env -w CGO_ENABLED=1 | |
export GODEBUG=cgocheck=0 | |
export CGO_LDFLAGS=-L$OpenVINO_DIR/../lib/intel64/ | |
export CGO_CFLAGS=-I$OpenVINO_DIR/../include | |
- name: Build ollama-ov | |
run: | | |
echo $PWD | |
cd ${{ github.workspace }}/openvino_contrib | |
git checkout ollama_openvino | |
cd ${{ github.workspace }}/openvino_contrib/modules/ollama_openvino | |
go build -o ollama | |
- name: Download model | |
run: | | |
python3 -m pip install modelscope | |
modelscope download --model zhaohb/DeepSeek-R1-Distill-Qwen-7B-int4-ov --local_dir ./DeepSeek-R1-Distill-Qwen-7B-int4-ov | |
tar -zcvf DeepSeek-R1-Distill-Qwen-7B-int4-ov.tar.gz DeepSeek-R1-Distill-Qwen-7B-int4-ov | |
- name: Create ollama model | |
run: | | |
ollama serve && ollama create DeepSeek-R1-Distill-Qwen-7B-int4-ov:v1 -f examples/modelfile/deepseek_r1_distill_qwen/Modelfile | |
ollama run DeepSeek-R1-Distill-Qwen-7B-int4-ov:v1 | |