Delete main.py
Browse files
main.py
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
from createVectorDB import createVectorDB
|
2 |
-
from splitBioModels import splitBioModels
|
3 |
-
from createDocuments import createDocuments
|
4 |
-
from generateResponse import generateResponse
|
5 |
-
from selectBioModels import search_biomodels
|
6 |
-
from selectBioModels import copy_matching_files
|
7 |
-
|
8 |
-
DATA_PATH = r"C:\Users\navan\Downloads\BioModelsRAG\BioModelsRAG\2data"
|
9 |
-
CHROMA_DATA_PATH = r"C:\Users\navan\Downloads\BioModelsRAG\CHROMA_EMBEDDINGS_PATH"
|
10 |
-
directory = r'C:\Users\navan\Downloads\BioModelsRAG\BioModelsRAG\data'
|
11 |
-
output_file = r'C:\Users\navan\Downloads\BioModelsRAG\biomodels_output.csv'
|
12 |
-
final_models_folder = r'C:\Users\navan\Downloads\BioModelsRAG\final_models'
|
13 |
-
user_keywords = input("Keyword you would like to search for: ").split()
|
14 |
-
|
15 |
-
|
16 |
-
def main(report:bool = True, directory = DATA_PATH, chroma_data_path = CHROMA_DATA_PATH):
|
17 |
-
data = []
|
18 |
-
search_biomodels(directory, user_keywords, output_file)
|
19 |
-
copy_matching_files(output_file, directory, final_models_folder)
|
20 |
-
|
21 |
-
splitBioModels(directory=DATA_PATH, final_items=data)
|
22 |
-
|
23 |
-
collection = createVectorDB(
|
24 |
-
collection_name="123456789101112131415",
|
25 |
-
chroma_data_path=chroma_data_path,
|
26 |
-
embed_model="all-MiniLM-L6-v2",
|
27 |
-
metadata={"hnsw:space": "cosine"}
|
28 |
-
)
|
29 |
-
|
30 |
-
if report:
|
31 |
-
print("Collection created:", collection)
|
32 |
-
|
33 |
-
createDocuments(final_items=data, collection=collection)
|
34 |
-
|
35 |
-
if report:
|
36 |
-
print("Documents added to collection.")
|
37 |
-
|
38 |
-
query = "What protein interacts with DesensitizedAch2?"
|
39 |
-
result = generateResponse(query_text=query, collection=collection)
|
40 |
-
return result
|
41 |
-
#name of the program running v
|
42 |
-
if __name__ == "__main__":
|
43 |
-
result = main()
|
44 |
-
print(result)
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|