Skip to content

Instantly share code, notes, and snippets.

@zilto
Last active July 10, 2023 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zilto/66804bd7bf3bf7cbb50a7320852f8024 to your computer and use it in GitHub Desktop.
Save zilto/66804bd7bf3bf7cbb50a7320852f8024 to your computer and use it in GitHub Desktop.
config = dict(
vector_db_config=json.loads(vector_db_config),
embedding_service=embedding_service, # this triggers config.when() in embedding_module
api_key=embedding_service_api_key,
model_name=model_name,
)
dr = driver.Driver(
config,
data_module,
vector_db_module, # pinecone_module, weaviate_module or lancedb_module
embedding_module, # contains cohere, openai, and sentence_transformer implementations
adapter=base.SimplePythonGraphAdapter(base.DictResult()),
)
dr.execute(
final_vars=["initialize_vector_db_indices", "push_to_vector_db"],
inputs=dict(
class_name="SQuADEntry",
),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment