mitulagr2 commited on
Commit
bc8f854
1 Parent(s): 20f2e68

Update rag.py

Browse files
Files changed (1) hide show
  1. app/rag.py +6 -6
app/rag.py CHANGED
@@ -107,9 +107,9 @@ class ChatPDF:
107
  return streaming_response
108
 
109
  def clear(self):
110
- for id in self.doc_ids:
111
- self.vector_store.delete(id)
112
- self.pdf_count = 0
113
- self.text_chunks = []
114
- self.doc_ids = []
115
- self.nodes = []
 
107
  return streaming_response
108
 
109
  def clear(self):
110
+ if self.nodes:
111
+ self.vector_store.delete_nodes(self.nodes)
112
+ self.pdf_count = 0
113
+ self.text_chunks = []
114
+ self.doc_ids = []
115
+ self.nodes = []