Skip to content

Commit

Permalink
add : select embedding_model
Browse files Browse the repository at this point in the history
  • Loading branch information
seohyunjun committed Mar 10, 2024
1 parent 5cbfa9a commit 73448cd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions utils/chromadb.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def preprocess_doc(document):
))
return docs

def chromadb_embed(collection_name: str, docs: list, model: str='text-embedding-ada-002', embed_batch_size: int=100):
def chromadb_embed(collection_name: str, docs: list, model: str='text-embedding-3-small', embed_batch_size: int=100):
# # create the index if it does not exist already
# collection = createOrget_collection(collection_name)

Expand All @@ -43,7 +43,6 @@ def chromadb_embed(collection_name: str, docs: list, model: str='text-embedding-
# storage_context = StorageContext.from_defaults(
# vector_store=vector_store
# )

# load vector db
collection = chroma_client.get_or_create_collection(collection_name)

Expand All @@ -54,7 +53,6 @@ def chromadb_embed(collection_name: str, docs: list, model: str='text-embedding-

service_context = ServiceContext.from_defaults(embed_model=embed_model)


index = GPTVectorStoreIndex.from_documents(
preprocess_doc(docs), storage_context=storage_context,
service_context=service_context
Expand Down

0 comments on commit 73448cd

Please sign in to comment.