Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -65,14 +65,15 @@ Settings.llm = HuggingFaceInferenceAPI(model_name="mistralai/Mistral-Nemo-Instru
|
|
| 65 |
)
|
| 66 |
|
| 67 |
Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-m3")
|
| 68 |
-
documents = [Document(text="Indian parliament elections happened in April-May 2024. BJP Party won."),
|
| 69 |
-
Document(text="Indian parliament elections happened in April-May 2021. XYZ Party won."),
|
| 70 |
-
Document(text="Indian parliament elections happened in 2020. ABC Party won."),
|
| 71 |
-
]
|
| 72 |
-
index = VectorStoreIndex.from_documents(
|
| 73 |
-
documents,
|
| 74 |
-
)
|
| 75 |
-
|
|
|
|
| 76 |
query_engine = index.as_query_engine()
|
| 77 |
def rag(input_text, file):
|
| 78 |
return query_engine.query(
|
|
|
|
| 65 |
)
|
| 66 |
|
| 67 |
Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-m3")
|
| 68 |
+
#documents = [Document(text="Indian parliament elections happened in April-May 2024. BJP Party won."),
|
| 69 |
+
# Document(text="Indian parliament elections happened in April-May 2021. XYZ Party won."),
|
| 70 |
+
# Document(text="Indian parliament elections happened in 2020. ABC Party won."),
|
| 71 |
+
# ]
|
| 72 |
+
#index = VectorStoreIndex.from_documents(
|
| 73 |
+
# documents,
|
| 74 |
+
#)
|
| 75 |
+
vector_store = ChromaVectorStore(chroma_collection=collection)
|
| 76 |
+
index = VectorStoreIndex.from_vector_store(vector_store, embed_model=Settings.embed_model)
|
| 77 |
query_engine = index.as_query_engine()
|
| 78 |
def rag(input_text, file):
|
| 79 |
return query_engine.query(
|