Ollama: Use openAI compatible embeggings API
This commit is contained in:
parent
645bda38e3
commit
5d2d4e51f1
1 changed files with 3 additions and 3 deletions
6
.github/workflows/test_ollama.yml
vendored
6
.github/workflows/test_ollama.yml
vendored
|
|
@ -48,7 +48,7 @@ jobs:
|
||||||
- name: Wait for Ollama to be ready
|
- name: Wait for Ollama to be ready
|
||||||
run: |
|
run: |
|
||||||
for i in {1..30}; do
|
for i in {1..30}; do
|
||||||
if curl -s http://localhost:11434/api/tags > /dev/null; then
|
if curl -s http://localhost:11434/v1/models > /dev/null; then
|
||||||
echo "Ollama is ready"
|
echo "Ollama is ready"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
@ -75,7 +75,7 @@ jobs:
|
||||||
{ "role": "user", "content": "Whatever I say, answer with Yes." }
|
{ "role": "user", "content": "Whatever I say, answer with Yes." }
|
||||||
]
|
]
|
||||||
}'
|
}'
|
||||||
curl -X POST http://127.0.0.1:11434/api/embed \
|
curl -X POST http://127.0.0.1:11434/v1/embeddings \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{
|
-d '{
|
||||||
"model": "avr/sfr-embedding-mistral:latest",
|
"model": "avr/sfr-embedding-mistral:latest",
|
||||||
|
|
@ -98,7 +98,7 @@ jobs:
|
||||||
LLM_MODEL: "phi4"
|
LLM_MODEL: "phi4"
|
||||||
EMBEDDING_PROVIDER: "ollama"
|
EMBEDDING_PROVIDER: "ollama"
|
||||||
EMBEDDING_MODEL: "avr/sfr-embedding-mistral:latest"
|
EMBEDDING_MODEL: "avr/sfr-embedding-mistral:latest"
|
||||||
EMBEDDING_ENDPOINT: "http://localhost:11434/api/embed"
|
EMBEDDING_ENDPOINT: "http://localhost:11434/v1/embeddings"
|
||||||
EMBEDDING_DIMENSIONS: "4096"
|
EMBEDDING_DIMENSIONS: "4096"
|
||||||
HUGGINGFACE_TOKENIZER: "Salesforce/SFR-Embedding-Mistral"
|
HUGGINGFACE_TOKENIZER: "Salesforce/SFR-Embedding-Mistral"
|
||||||
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