Update
Browse files- setup_knowledge_base.py +2 -2
setup_knowledge_base.py
CHANGED
@@ -190,7 +190,7 @@ def insert_chunks_to_db(db_path, document_id, chunks):
|
|
190 |
conn.close()
|
191 |
print(f"Saved {len(chunks)} chunks into the database for file ID {document_id}.")
|
192 |
|
193 |
-
def generate_embeddings(texts, model_name="
|
194 |
"""
|
195 |
Generates text embeddings using Together AI's embedding model.
|
196 |
"""
|
@@ -287,7 +287,7 @@ if __name__ == "__main__":
|
|
287 |
db_path = os.path.join(db_directory, "processed_documents.db")
|
288 |
vector_db_dir = "data/vector_db_chroma"
|
289 |
collection_name = "my_instrument_manual_chunks"
|
290 |
-
embeddings_model_name = "
|
291 |
|
292 |
# Create necessary directories
|
293 |
os.makedirs(db_directory, exist_ok=True)
|
|
|
190 |
conn.close()
|
191 |
print(f"Saved {len(chunks)} chunks into the database for file ID {document_id}.")
|
192 |
|
193 |
+
def generate_embeddings(texts, model_name="BAAI/bge-base-en-v1.5"):
|
194 |
"""
|
195 |
Generates text embeddings using Together AI's embedding model.
|
196 |
"""
|
|
|
287 |
db_path = os.path.join(db_directory, "processed_documents.db")
|
288 |
vector_db_dir = "data/vector_db_chroma"
|
289 |
collection_name = "my_instrument_manual_chunks"
|
290 |
+
embeddings_model_name = "BAAI/bge-base-en-v1.5" # 確保與 main.py 中使用的一致
|
291 |
|
292 |
# Create necessary directories
|
293 |
os.makedirs(db_directory, exist_ok=True)
|