Skip to content

Commit

Permalink
[hotfix] Fix examples/awel default loading model text2vec-large-chine…
Browse files Browse the repository at this point in the history
…se issue (#1095)

Co-authored-by: xiuzhu <[email protected]>
  • Loading branch information
xiuzhu9527 and xiuzhu authored Jan 20, 2024
1 parent 425f4ab commit ba7248a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion examples/awel/simple_dbschema_retriever_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@

def _create_vector_connector():
"""Create vector connector."""
model_name = os.getenv("EMBEDDING_MODEL", "text2vec")
return VectorStoreConnector.from_default(
"Chroma",
vector_store_config=ChromaVectorConfig(
name="vector_name",
persist_path=os.path.join(PILOT_PATH, "data"),
),
embedding_fn=DefaultEmbeddingFactory(
default_model_name=os.path.join(MODEL_PATH, "text2vec-large-chinese"),
default_model_name=os.path.join(MODEL_PATH, model_name),
).create(),
)

Expand Down
3 changes: 2 additions & 1 deletion examples/awel/simple_rag_embedding_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@

def _create_vector_connector() -> VectorStoreConnector:
"""Create vector connector."""
model_name = os.getenv("EMBEDDING_MODEL", "text2vec")
return VectorStoreConnector.from_default(
"Chroma",
vector_store_config=ChromaVectorConfig(
name="vector_name",
persist_path=os.path.join(PILOT_PATH, "data"),
),
embedding_fn=DefaultEmbeddingFactory(
default_model_name=os.path.join(MODEL_PATH, "text2vec-large-chinese"),
default_model_name=os.path.join(MODEL_PATH, model_name),
).create(),
)

Expand Down
3 changes: 2 additions & 1 deletion examples/awel/simple_rag_retriever_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,15 @@ def _context_join_fn(context_dict: Dict, chunks: List[Chunk]) -> Dict:

def _create_vector_connector():
"""Create vector connector."""
model_name = os.getenv("EMBEDDING_MODEL", "text2vec")
return VectorStoreConnector.from_default(
"Chroma",
vector_store_config=ChromaVectorConfig(
name="vector_name",
persist_path=os.path.join(PILOT_PATH, "data"),
),
embedding_fn=DefaultEmbeddingFactory(
default_model_name=os.path.join(MODEL_PATH, "text2vec-large-chinese"),
default_model_name=os.path.join(MODEL_PATH, model_name),
).create(),
)

Expand Down

0 comments on commit ba7248a

Please sign in to comment.