Hugging Face
Models
Datasets
Spaces
Community
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
VEDAGI1
/
Medica_DecisionSupportAI
like
0
Sleeping
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
Rajan Sharma
commited on
Sep 24
Commit
3c323be
·
verified
·
1 Parent(s):
4d43747
Create rag.py
Browse files
Files changed (1)
hide
show
rag.py
+9
-0
rag.py
ADDED
Viewed
@@ -0,0 +1,9 @@
1
+
class RAGIndex:
2
+
def __init__(self):
3
+
self.docs=[]
4
+
5
+
def add(self,chunks):
6
+
self.docs.extend(chunks)
7
+
8
+
def retrieve(self,q,k=5):
9
+
return [(d,1.0) for d in self.docs[:k]]