Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 6, 2024
1 parent 045a056 commit acf4cb5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions comps/dataprep/milvus/langchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Update Knowledge Base via Local File nke-10k-2023.pdf. Get the file on a termina
```
wget https://raw.githubusercontent.com/opea-project/GenAIComps/main/comps/retrievers/redis/data/nke-10k-2023.pdf
```

- Single file upload

```bash
Expand Down
6 changes: 3 additions & 3 deletions comps/dataprep/milvus/langchain/prepare_doc_milvus.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def ingest_chunks_to_milvus(file_name: str, chunks: List):
batch_docs,
embeddings,
collection_name=COLLECTION_NAME,
connection_args={"host": MILVUS_HOST, "port": MILVUS_PORT, "uri":url},
connection_args={"host": MILVUS_HOST, "port": MILVUS_PORT, "uri": url},
partition_key_field=partition_field_name,
)
except Exception as e:
Expand Down Expand Up @@ -212,7 +212,7 @@ async def ingest_documents(
my_milvus = Milvus(
embedding_function=embeddings,
collection_name=COLLECTION_NAME,
connection_args={"host": MILVUS_HOST, "port": MILVUS_PORT, "uri":url},
connection_args={"host": MILVUS_HOST, "port": MILVUS_PORT, "uri": url},
index_params=index_params,
auto_id=True,
)
Expand Down Expand Up @@ -408,7 +408,7 @@ async def delete_single_file(file_path: str = Body(..., embed=True)):
my_milvus = Milvus(
embedding_function=embeddings,
collection_name=COLLECTION_NAME,
connection_args={"host": MILVUS_HOST, "port": MILVUS_PORT, "uri":url},
connection_args={"host": MILVUS_HOST, "port": MILVUS_PORT, "uri": url},
index_params=index_params,
auto_id=True,
)
Expand Down
3 changes: 3 additions & 0 deletions comps/dataprep/milvus/langchain/set_env.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

export DOCKER_VOLUME_DIRECTORY="../../../vectorstores/milvus"
export host_ip=$(hostname -i)
export no_proxy=${no_proxy},tei-embedding-service
Expand Down
5 changes: 3 additions & 2 deletions comps/retrievers/milvus/langchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can start retriever Microservice either by Python script or docker composer.

```bash
git clone https://github.com/opea-project/GenAIComps.git
cd GenAIComps/comps/retrievers/milvus/langchain
cd GenAIComps/comps/retrievers/milvus/langchain
pip install -r requirements.txt
```

Expand All @@ -22,6 +22,7 @@ Please refer to this [readme](../../../vectorstores/milvus/README.md).
export HUGGINGFACEHUB_API_TOKEN="YOUR_HUGGINGFACEHUB_API_TOKEN"
#source set_env.sh
```

### Start Retriever Service

```bash
Expand All @@ -35,7 +36,7 @@ python retriever_redis.py

```bash
git clone https://github.com/opea-project/GenAIComps.git
cd GenAIComps/comps/retrievers/milvus/langchain
cd GenAIComps/comps/retrievers/milvus/langchain
# build dataprep milvus docker image
docker compose build --no-cache
```
Expand Down
4 changes: 3 additions & 1 deletion comps/retrievers/milvus/langchain/set_env.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

export host_ip=$(hostname -i)
export DOCKER_VOLUME_DIRECTORY="../../../vectorstores/milvus"
export no_proxy=${no_proxy},tei-embedding-service
Expand All @@ -6,4 +9,3 @@ export MILVUS_HOST=${host_ip}
export MILVUS_PORT=19530
# Optional COLLECTION_NAME
export COLLECTION_NAME=${your_collection_name}

0 comments on commit acf4cb5

Please sign in to comment.