Spaces:
Sleeping
Sleeping
Saiteja Solleti
commited on
Commit
·
2779cfc
1
Parent(s):
95bfa0d
milvas connection
Browse files- crudmilvus.py +12 -0
- loaddataset.py +1 -0
crudmilvus.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from pymilvus import connections, FieldSchema, CollectionSchema, DataType, Collection
|
3 |
+
from sentence_transformers import SentenceTransformer
|
4 |
+
|
5 |
+
milvus_token = os.getenv("MILVUS_TOKEN")
|
6 |
+
|
7 |
+
COLLECTION_NAME = "final_ragbench_document_embeddings"
|
8 |
+
MILVUS_CLOUD_URI = "https://in03-7b4da1b7b588a88.serverless.gcp-us-west1.cloud.zilliz.com"
|
9 |
+
connections.connect("default", uri=MILVUS_CLOUD_URI, token=milvus_token)
|
10 |
+
|
11 |
+
# Verify connection
|
12 |
+
print(connections.get_connection_addr("default"))
|
loaddataset.py
CHANGED
@@ -86,5 +86,6 @@ def ExtractData(ragbench: Dict[str, dict], split: str = "train") -> pd.DataFrame
|
|
86 |
def ExtractRagBenchData():
|
87 |
ragbench = load_rag_bench_dataset(DATASET_CONFIGS)
|
88 |
rag_extracted_data = ExtractData(ragbench, split="train")
|
|
|
89 |
|
90 |
return rag_extracted_data
|
|
|
86 |
def ExtractRagBenchData():
|
87 |
ragbench = load_rag_bench_dataset(DATASET_CONFIGS)
|
88 |
rag_extracted_data = ExtractData(ragbench, split="train")
|
89 |
+
rag_extracted_data["dataset_name"].fillna("covidqa", inplace=True)
|
90 |
|
91 |
return rag_extracted_data
|