Update app.py
Browse files
app.py
CHANGED
@@ -135,10 +135,16 @@ def split_biomodels(antimony_file_path):
|
|
135 |
def create_vector_db(final_items):
|
136 |
global db
|
137 |
client = chromadb.Client()
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
documents = []
|
143 |
|
144 |
from llama_cpp import Llama
|
|
|
135 |
def create_vector_db(final_items):
|
136 |
global db
|
137 |
client = chromadb.Client()
|
138 |
+
collection_name = "BioModelsRAG"
|
139 |
+
try:
|
140 |
+
db = client.create_collection(
|
141 |
+
name=collection_name,
|
142 |
+
metadata={"hnsw:space": "cosine"}
|
143 |
+
)
|
144 |
+
except UniqueConstraintError:
|
145 |
+
print(f"Collection '{collection_name}' already exists.")
|
146 |
+
collection = db.get_collection(name=collection_name)
|
147 |
+
|
148 |
documents = []
|
149 |
|
150 |
from llama_cpp import Llama
|