Skip to content

Commit

Permalink
Update offline ann
Browse files Browse the repository at this point in the history
  • Loading branch information
w5688414 committed Apr 30, 2024
1 parent a37f53d commit 23a9cd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pipelines/utils/offline_ann.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import argparse
import time

from pipelines.document_stores import (
BaiduElasticsearchDocumentStore,
Expand Down Expand Up @@ -139,7 +140,8 @@ def offline_ann(index_name, doc_dir):
use_gpu=use_gpu,
embed_title=args.embed_title,
)

# Writing docs may take a while. so waitting for 3 seconds for writing docs to be completed.
time.sleep(3)
# 建立索引库
document_store.update_embeddings(retriever)

Expand Down
4 changes: 3 additions & 1 deletion pipelines/utils/offline_ann_mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import argparse
import os
import time

from pipelines.document_stores import ElasticsearchDocumentStore, MilvusDocumentStore
from pipelines.nodes import MultiModalRetriever
Expand Down Expand Up @@ -93,7 +94,8 @@ def offline_ann(index_name, doc_dir):
query_type="image",
document_embedding_models={"text": args.document_embedding_model},
)

# Writing docs may take a while. so waitting for 3 seconds for writing docs to be completed.
time.sleep(3)
# 建立索引库
document_store.update_embeddings(retriever_mm)

Expand Down

0 comments on commit 23a9cd7

Please sign in to comment.