Skip to content

Commit 48d4e53

Browse files
authored
unify default reranking model with BAAI/bge-reranker-base (#623)
Signed-off-by: chensuyue <[email protected]> Signed-off-by: ZePan110 <[email protected]>
1 parent 8a11413 commit 48d4e53

File tree

15 files changed

+22
-22
lines changed

15 files changed

+22
-22
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The initially supported `Microservices` are described in the below table. More `
5555
<tr>
5656
<td rowspan="2"><a href="./comps/embeddings/README.md">Embedding</a></td>
5757
<td rowspan="2"><a href="https://www.langchain.com">LangChain</a>/<a href="https://www.llamaindex.ai">LlamaIndex</a></td>
58-
<td rowspan="2"><a href="https://huggingface.co/BAAI/bge-large-en-v1.5">BAAI/bge-large-en-v1.5</a></td>
58+
<td rowspan="2"><a href="https://huggingface.co/BAAI/bge-base-en-v1.5">BAAI/bge-base-en-v1.5</a></td>
5959
<td><a href="https://github.com/huggingface/tei-gaudi">TEI-Gaudi</a></td>
6060
<td>Gaudi2</td>
6161
<td>Embedding on Gaudi2</td>
@@ -76,7 +76,7 @@ The initially supported `Microservices` are described in the below table. More `
7676
<tr>
7777
<td rowspan="2"><a href="./comps/reranks/README.md">Reranking</a></td>
7878
<td rowspan="2"><a href="https://www.langchain.com">LangChain</a>/<a href="https://www.llamaindex.ai">LlamaIndex</a></td>
79-
<td ><a href="https://huggingface.co/BAAI/bge-reranker-large">BAAI/bge-reranker-large</a></td>
79+
<td ><a href="https://huggingface.co/BAAI/bge-reranker-base">BAAI/bge-reranker-base</a></td>
8080
<td><a href="https://github.com/huggingface/tei-gaudi">TEI-Gaudi</a></td>
8181
<td>Gaudi2</td>
8282
<td>Reranking on Gaudi2</td>

comps/dataprep/redis/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ First, you need to start a TEI service.
4949

5050
```bash
5151
your_port=6006
52-
model="BAAI/bge-large-en-v1.5"
52+
model="BAAI/bge-base-en-v1.5"
5353
revision="refs/pr/5"
5454
docker run -p $your_port:80 -v ./data:/data --name tei_server -e http_proxy=$http_proxy -e https_proxy=$https_proxy --pull always ghcr.io/huggingface/text-embeddings-inference:cpu-1.2 --model-id $model --revision $revision
5555
```

comps/dataprep/redis/langchain/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Embedding model
77

8-
EMBED_MODEL = os.getenv("EMBED_MODEL", "BAAI/bge-large-en-v1.5")
8+
EMBED_MODEL = os.getenv("EMBED_MODEL", "BAAI/bge-base-en-v1.5")
99

1010
# Redis Connection Information
1111
REDIS_HOST = os.getenv("REDIS_HOST", "localhost")

comps/embeddings/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ First, you need to start a TEI service.
4343

4444
```bash
4545
your_port=8090
46-
model="BAAI/bge-large-en-v1.5"
46+
model="BAAI/bge-base-en-v1.5"
4747
docker run -p $your_port:80 -v ./data:/data --name tei_server -e http_proxy=$http_proxy -e https_proxy=$https_proxy --pull always ghcr.io/huggingface/text-embeddings-inference:cpu-1.5 --model-id $model
4848
```
4949

@@ -64,7 +64,7 @@ cd langchain
6464
# run with llama_index
6565
cd llama_index
6666
export TEI_EMBEDDING_ENDPOINT="http://localhost:$yourport"
67-
export TEI_EMBEDDING_MODEL_NAME="BAAI/bge-large-en-v1.5"
67+
export TEI_EMBEDDING_MODEL_NAME="BAAI/bge-base-en-v1.5"
6868
python embedding_tei.py
6969
```
7070

@@ -86,7 +86,7 @@ First, you need to start a TEI service.
8686

8787
```bash
8888
your_port=8090
89-
model="BAAI/bge-large-en-v1.5"
89+
model="BAAI/bge-base-en-v1.5"
9090
docker run -p $your_port:80 -v ./data:/data --name tei_server -e http_proxy=$http_proxy -e https_proxy=$https_proxy --pull always ghcr.io/huggingface/text-embeddings-inference:cpu-1.5 --model-id $model
9191
```
9292

@@ -103,7 +103,7 @@ Export the `TEI_EMBEDDING_ENDPOINT` for later usage:
103103

104104
```bash
105105
export TEI_EMBEDDING_ENDPOINT="http://localhost:$yourport"
106-
export TEI_EMBEDDING_MODEL_NAME="BAAI/bge-large-en-v1.5"
106+
export TEI_EMBEDDING_MODEL_NAME="BAAI/bge-base-en-v1.5"
107107
```
108108

109109
### 2.2 Build Docker Image

comps/embeddings/langchain/local_embedding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ def embedding(input: TextDoc) -> EmbedDoc:
4040

4141

4242
if __name__ == "__main__":
43-
embeddings = HuggingFaceEmbeddings(model_name="BAAI/bge-large-en-v1.5")
43+
embeddings = HuggingFaceEmbeddings(model_name="BAAI/bge-base-en-v1.5")
4444
opea_microservices["opea_service@local_embedding"].start()

comps/embeddings/llama_index/embedding_tei.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def embedding(input: TextDoc) -> EmbedDoc:
3131

3232

3333
if __name__ == "__main__":
34-
tei_embedding_model_name = os.getenv("TEI_EMBEDDING_MODEL_NAME", "BAAI/bge-large-en-v1.5")
34+
tei_embedding_model_name = os.getenv("TEI_EMBEDDING_MODEL_NAME", "BAAI/bge-base-en-v1.5")
3535
tei_embedding_endpoint = os.getenv("TEI_EMBEDDING_ENDPOINT", "http://localhost:8090")
3636
embeddings = TextEmbeddingsInference(model_name=tei_embedding_model_name, base_url=tei_embedding_endpoint)
3737
logger.info("TEI Gaudi Embedding initialized.")

comps/embeddings/llama_index/local_embedding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ def embedding(input: TextDoc) -> EmbedDoc:
3131

3232

3333
if __name__ == "__main__":
34-
embeddings = HuggingFaceInferenceAPIEmbedding(model_name="BAAI/bge-large-en-v1.5")
34+
embeddings = HuggingFaceInferenceAPIEmbedding(model_name="BAAI/bge-base-en-v1.5")
3535
opea_microservices["opea_service@local_embedding"].start()

comps/reranks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export HF_TOKEN=${your_hf_api_token}
1919
export LANGCHAIN_TRACING_V2=true
2020
export LANGCHAIN_API_KEY=${your_langchain_api_key}
2121
export LANGCHAIN_PROJECT="opea/reranks"
22-
export RERANK_MODEL_ID="BAAI/bge-reranker-large"
22+
export RERANK_MODEL_ID="BAAI/bge-reranker-base"
2323
revision=refs/pr/4
2424
volume=$PWD/data
2525
docker run -d -p 6060:80 -v $volume:/data -e http_proxy=$http_proxy -e https_proxy=$https_proxy --pull always ghcr.io/huggingface/text-embeddings-inference:cpu-1.2 --model-id $RERANK_MODEL_ID --revision $revision --hf-api-token $HF_TOKEN

comps/reranks/langchain-mosec/mosec-docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pip3 install intel-extension-for-pytorch==2.2.0
1818
RUN pip3 install transformers sentence-transformers
1919
RUN pip3 install llmspec mosec
2020

21-
RUN cd /home/user/ && export HF_ENDPOINT=https://hf-mirror.com && huggingface-cli download --resume-download BAAI/bge-reranker-large --local-dir /home/user/bge-reranker-large
21+
RUN cd /home/user/ && export HF_ENDPOINT=https://hf-mirror.com && huggingface-cli download --resume-download BAAI/bge-reranker-base --local-dir /home/user/bge-reranker-large
2222
USER user
2323
ENV EMB_MODEL="/home/user/bge-reranker-large/"
2424

comps/reranks/tei/local_reranking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ def reranking(input: SearchedDoc) -> RerankedDoc:
4141

4242

4343
if __name__ == "__main__":
44-
reranker_model = CrossEncoder(model_name="BAAI/bge-reranker-large", max_length=512)
44+
reranker_model = CrossEncoder(model_name="BAAI/bge-reranker-base", max_length=512)
4545
opea_microservices["opea_service@local_reranking"].start()

0 commit comments

Comments
 (0)