shoom013 commited on
Commit
950aabc
1 Parent(s): 73e6552

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -87,11 +87,12 @@ def rag(input_text, file):
87
  for f in file:
88
  documents += SimpleDirectoryReader(f).load_data()
89
  index = VectorStoreIndex.from_documents(documents)
90
- collection.add(
91
- documents=documents,
92
- ids=[f"id{last+i}" for i in range(len(documents))],
93
- metadatas=[{"state": "s0", "next": "s0", "used": False, "source": 'None', "page": -1, "lang": jezik } for i in range(len(documents)) ]
94
- )
 
95
  return query_engine.query(
96
  input_text
97
  )
 
87
  for f in file:
88
  documents += SimpleDirectoryReader(f).load_data()
89
  index = VectorStoreIndex.from_documents(documents)
90
+ # collection.add(
91
+ # documents=documents,
92
+ # ids=[f"id{last+i}" for i in range(len(documents))],
93
+ # metadatas=[{"state": "s0", "next": "s0", "used": False, "source": 'None', "page": -1, "lang": jezik } for i in range(len(documents)) ]
94
+ # )
95
+ query_engine = index.as_query_engine()
96
  return query_engine.query(
97
  input_text
98
  )