Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,7 +83,7 @@ Settings.llm = HuggingFaceInferenceAPI(model_name=LLM_NAME,
|
|
| 83 |
# task="None"
|
| 84 |
)
|
| 85 |
# "BAAI/bge-m3"
|
| 86 |
-
Settings.embed_model = HuggingFaceEmbedding(model_name="sentence-transformers/all-MiniLM-L6-v2"
|
| 87 |
#documents = [Document(text="Indian parliament elections happened in April-May 2024. BJP Party won."),
|
| 88 |
# ]
|
| 89 |
#index = VectorStoreIndex.from_documents(
|
|
@@ -133,17 +133,17 @@ def rag(input_text, history, jezik, file):
|
|
| 133 |
# )
|
| 134 |
## else:
|
| 135 |
### query_results = collection.query(
|
| 136 |
-
query_engine = index.as_query_engine(
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
)
|
| 147 |
#query_results = index.query(
|
| 148 |
# query_texts = [ input_text ],
|
| 149 |
# n_results = max_results,
|
|
|
|
| 83 |
# task="None"
|
| 84 |
)
|
| 85 |
# "BAAI/bge-m3"
|
| 86 |
+
Settings.embed_model = HuggingFaceEmbedding(model_name=EMBED_MODEL) # "sentence-transformers/all-MiniLM-L6-v2"
|
| 87 |
#documents = [Document(text="Indian parliament elections happened in April-May 2024. BJP Party won."),
|
| 88 |
# ]
|
| 89 |
#index = VectorStoreIndex.from_documents(
|
|
|
|
| 133 |
# )
|
| 134 |
## else:
|
| 135 |
### query_results = collection.query(
|
| 136 |
+
#query_engine = index.as_query_engine(
|
| 137 |
+
# similarity_top_k=3,
|
| 138 |
+
# vector_store_query_mode="default",
|
| 139 |
+
# filters=MetadataFilters(
|
| 140 |
+
# filters=[
|
| 141 |
+
# ExactMatchFilter(key="lang", value=jezik),
|
| 142 |
+
# ]
|
| 143 |
+
# ),
|
| 144 |
+
# alpha=None,
|
| 145 |
+
# doc_ids=None,
|
| 146 |
+
#)
|
| 147 |
#query_results = index.query(
|
| 148 |
# query_texts = [ input_text ],
|
| 149 |
# n_results = max_results,
|