Skip to content

Commit

Permalink
Fix issues in updating embedding & reranking model to bge-large-zh-v1…
Browse files Browse the repository at this point in the history
….5 (opea-project#410)

Signed-off-by: Tian, Feng <[email protected]>
  • Loading branch information
ftian1 authored and Yogesh committed Aug 9, 2024
1 parent 818d25f commit 5e20b0c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion comps/embeddings/langchain-mosec/embedding_mosec.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def embedding(input: TextDoc) -> EmbedDoc:
MOSEC_EMBEDDING_ENDPOINT = os.environ.get("MOSEC_EMBEDDING_ENDPOINT", "http://127.0.0.1:8080")
os.environ["OPENAI_API_BASE"] = MOSEC_EMBEDDING_ENDPOINT
os.environ["OPENAI_API_KEY"] = "Dummy key"
MODEL_ID = "/root/bge-large-zh"
MODEL_ID = "/root/bge-large-zh-v1.5"
embeddings = MosecEmbeddings(model=MODEL_ID)
print("Mosec Embedding initialized.")
opea_microservices["opea_service@embedding_mosec"].start()
6 changes: 3 additions & 3 deletions comps/embeddings/langchain-mosec/mosec-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This service has an OpenAI compatible restful API to extract text features.
It is dedicated to be used on Xeon to accelerate embedding model serving.
Currently the local model is BGE-large-zh.
Currently the local model is BGE-large-zh-v1.5.

## 2. Quick Start

Expand All @@ -25,13 +25,13 @@ docker run -itd -p 8000:8000 embedding:latest
- Restful API by curl

```shell
curl -X POST http://127.0.0.1:8000/v1/embeddings -H "Content-Type: application/json" -d '{ "model": "/root/bge-large-zh/", "input": "hello world"}'
curl -X POST http://127.0.0.1:8000/v1/embeddings -H "Content-Type: application/json" -d '{ "model": "/root/bge-large-zh-v1.5/", "input": "hello world"}'
```

- generate embedding from python

```python
DEFAULT_MODEL = "/root/bge-large-zh/"
DEFAULT_MODEL = "/root/bge-large-zh-v1.5/"
SERVICE_URL = "http://127.0.0.1:8000"
INPUT_STR = "Hello world!"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from llmspec import EmbeddingData, EmbeddingRequest, EmbeddingResponse, TokenUsage
from mosec import ClientError, Runtime, Server, Worker

DEFAULT_MODEL = "/root/bge-large-zh/"
DEFAULT_MODEL = "/root/bge-large-zh-v1.5/"


class Embedding(Worker):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from openai import Client

DEFAULT_MODEL = "/root/bge-large-zh/"
DEFAULT_MODEL = "/root/bge-large-zh-v1.5/"
SERVICE_URL = "http://127.0.0.1:8000"
INPUT_STR = "Hello world!"

Expand Down

0 comments on commit 5e20b0c

Please sign in to comment.