Skip to content

Commit

Permalink
adding huggingface text embeddings interface as docker service for co…
Browse files Browse the repository at this point in the history
…nvienience
  • Loading branch information
pattonjp committed Nov 30, 2023
1 parent bfb0d75 commit 11eb1fb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
18 changes: 13 additions & 5 deletions examples/huggingface-milvus-vectorstore-example/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# Milvus vector store with local embeddings via huggingface TEI.

Dependencies:
- [Text Embeddings Inference](https://github.com/huggingface/text-embeddings-inference)
- [Ollama](https://ollama.ai/)
- [Text Embeddings Inference](https://github.com/huggingface/text-embeddings-inference) (optional)

```shell
# start milvus
# start milvus and text embeddings interface
docker-compose up -d

#start embedding server
text-embeddings-router --model-id thenlper/gte-large --port 5500

```

## For faster embeddings

```shell
# stop txt-inference container
docker compose stop txt-inference

# start embedding server
text-embeddings-router --model-id thenlper/gte-large --port 5500
```
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ services:
- "etcd"
- "minio"

txt-inference:
platform: linux/x86_64
image: ghcr.io/huggingface/text-embeddings-inference:${TEI_TAG:-cpu-latest}
command: --model-id thenlper/gte-base
ports:
- 5500:80
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/txt-inference:/data

networks:
default:
name: milvus
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ func main() {
log.Fatalf("new: %v\n", err)
}
citiesExample(store)

}

func newEmbedder() (embeddings.Embedder, error) {
Expand Down Expand Up @@ -114,12 +113,6 @@ func citiesExample(store vectorstores.VectorStore) {
numDocuments: 100,
options: []vectorstores.Option{
vectorstores.WithScoreThreshold(.4),
// vectorstores.WithFilters(filter{
// "$and": []filter{
// {"area": filter{"$gte": 1000}},
// {"population": filter{"$gte": 13}},
// },
// }),
},
},
}
Expand Down

0 comments on commit 11eb1fb

Please sign in to comment.