Created
December 16, 2023 13:24
-
-
Save makispl/fdcc31a701a4108d58ec62e14cfc6346 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a test library and load it with llmware samples | |
test_library = Library().create_new_library("Agreements") | |
samples_path = Setup().load_sample_files() | |
test_library.add_files(os.path.join(samples_path,"Agreements")) | |
# Create vector embeddings for the library and store them in Milvus | |
test_library.install_new_embedding(embedding_model_name="industry-bert-contracts", vector_db="milvus") | |
# Perform a semantic search in the test library | |
os.environ["TOKENIZERS_PARALLELISM"] = "false" # HuggingFace tokenizer warning to be avoided | |
# Construct and perform a test query | |
test_query = 'Resignation' | |
query_res = Query(test_library).semantic_query(test_query, result_count=20) | |
print(query_res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment