CI: Smaller embedding model for Ollama test
This commit is contained in:
parent
508165e883
commit
7c9a78abea
1 changed files with 9 additions and 22 deletions
31
.github/workflows/test_ollama.yml
vendored
31
.github/workflows/test_ollama.yml
vendored
|
|
@ -7,13 +7,8 @@ jobs:
|
||||||
|
|
||||||
run_ollama_test:
|
run_ollama_test:
|
||||||
|
|
||||||
# needs 16 Gb RAM for phi4
|
|
||||||
runs-on: buildjet-4vcpu-ubuntu-2204
|
runs-on: buildjet-4vcpu-ubuntu-2204
|
||||||
# services:
|
|
||||||
# ollama:
|
|
||||||
# image: ollama/ollama
|
|
||||||
# ports:
|
|
||||||
# - 11434:11434
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
|
@ -28,14 +23,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
uv add torch
|
uv add torch
|
||||||
|
|
||||||
# - name: Install ollama
|
|
||||||
# run: curl -fsSL https://ollama.com/install.sh | sh
|
|
||||||
# - name: Run ollama
|
|
||||||
# run: |
|
|
||||||
# ollama serve --openai &
|
|
||||||
# ollama pull llama3.2 &
|
|
||||||
# ollama pull avr/sfr-embedding-mistral:latest
|
|
||||||
|
|
||||||
- name: Start Ollama container
|
- name: Start Ollama container
|
||||||
run: |
|
run: |
|
||||||
docker run -d --name ollama -p 11434:11434 ollama/ollama
|
docker run -d --name ollama -p 11434:11434 ollama/ollama
|
||||||
|
|
@ -60,15 +47,15 @@ jobs:
|
||||||
|
|
||||||
- name: Pull required Ollama models
|
- name: Pull required Ollama models
|
||||||
run: |
|
run: |
|
||||||
curl -X POST http://localhost:11434/api/pull -d '{"name": "phi4"}'
|
curl -X POST http://localhost:11434/api/pull -d '{"name": "phi3:mini"}'
|
||||||
curl -X POST http://localhost:11434/api/pull -d '{"name": "avr/sfr-embedding-mistral:latest"}'
|
curl -X POST http://localhost:11434/api/pull -d '{"name": "nomic-embed-text"}'
|
||||||
|
|
||||||
- name: Call ollama API
|
- name: Call ollama API
|
||||||
run: |
|
run: |
|
||||||
curl -X POST http://localhost:11434/v1/chat/completions \
|
curl -X POST http://localhost:11434/v1/chat/completions \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{
|
-d '{
|
||||||
"model": "phi4",
|
"model": "phi3:mini",
|
||||||
"stream": false,
|
"stream": false,
|
||||||
"messages": [
|
"messages": [
|
||||||
{ "role": "system", "content": "You are a helpful assistant." },
|
{ "role": "system", "content": "You are a helpful assistant." },
|
||||||
|
|
@ -78,7 +65,7 @@ jobs:
|
||||||
curl -X POST http://127.0.0.1:11434/api/embed \
|
curl -X POST http://127.0.0.1:11434/api/embed \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{
|
-d '{
|
||||||
"model": "avr/sfr-embedding-mistral:latest",
|
"model": "nomic-embed-text",
|
||||||
"input": "This is a test sentence to generate an embedding."
|
"input": "This is a test sentence to generate an embedding."
|
||||||
}'
|
}'
|
||||||
|
|
||||||
|
|
@ -95,10 +82,10 @@ jobs:
|
||||||
LLM_PROVIDER: "ollama"
|
LLM_PROVIDER: "ollama"
|
||||||
LLM_API_KEY: "ollama"
|
LLM_API_KEY: "ollama"
|
||||||
LLM_ENDPOINT: "http://localhost:11434/v1/"
|
LLM_ENDPOINT: "http://localhost:11434/v1/"
|
||||||
LLM_MODEL: "phi4"
|
LLM_MODEL: "phi3:mini"
|
||||||
EMBEDDING_PROVIDER: "ollama"
|
EMBEDDING_PROVIDER: "ollama"
|
||||||
EMBEDDING_MODEL: "avr/sfr-embedding-mistral:latest"
|
EMBEDDING_MODEL: "nomic-embed-text"
|
||||||
EMBEDDING_ENDPOINT: "http://localhost:11434/api/embed"
|
EMBEDDING_ENDPOINT: "http://localhost:11434/api/embed"
|
||||||
EMBEDDING_DIMENSIONS: "4096"
|
EMBEDDING_DIMENSIONS: "768"
|
||||||
HUGGINGFACE_TOKENIZER: "Salesforce/SFR-Embedding-Mistral"
|
HUGGINGFACE_TOKENIZER: "nomic-ai/nomic-embed-text-v1"
|
||||||
run: uv run python ./examples/python/simple_example.py
|
run: uv run python ./examples/python/simple_example.py
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue