Spaces:
Runtime error
Runtime error
Commit ·
36b893f
1
Parent(s): ace5cd4
Change populate_db.py
Browse files- populate_db.py +5 -1
populate_db.py
CHANGED
|
@@ -1,12 +1,16 @@
|
|
| 1 |
import time
|
|
|
|
| 2 |
from pathlib import Path
|
| 3 |
from unstructured.cleaners.core import clean_extra_whitespace, replace_unicode_quotes, clean_dashes, group_broken_paragraphs
|
| 4 |
from langchain_unstructured import UnstructuredLoader
|
| 5 |
from sentence_transformers import SentenceTransformer
|
| 6 |
from pymilvus import MilvusClient, DataType
|
| 7 |
|
|
|
|
|
|
|
| 8 |
# Initialize Milvus client and collection setup
|
| 9 |
-
|
|
|
|
| 10 |
collection_name = "my_rag_collection"
|
| 11 |
|
| 12 |
# Drop existing collection if it exists
|
|
|
|
| 1 |
import time
|
| 2 |
+
import os
|
| 3 |
from pathlib import Path
|
| 4 |
from unstructured.cleaners.core import clean_extra_whitespace, replace_unicode_quotes, clean_dashes, group_broken_paragraphs
|
| 5 |
from langchain_unstructured import UnstructuredLoader
|
| 6 |
from sentence_transformers import SentenceTransformer
|
| 7 |
from pymilvus import MilvusClient, DataType
|
| 8 |
|
| 9 |
+
import os
|
| 10 |
+
|
| 11 |
# Initialize Milvus client and collection setup
|
| 12 |
+
MILVUS_URI = os.getenv("MILVUS_URI", "http://localhost:19530")
|
| 13 |
+
milvus_client = MilvusClient(uri=MILVUS_URI)
|
| 14 |
collection_name = "my_rag_collection"
|
| 15 |
|
| 16 |
# Drop existing collection if it exists
|