Spaces:
Paused
Paused
Upload Index.py
Browse files
Index.py
CHANGED
@@ -198,7 +198,7 @@ def _load_embeddings_from_db(
|
|
198 |
|
199 |
|
200 |
def _prompt(question):
|
201 |
-
return f"""Answer the following question using only the context below. Say '
|
202 |
Question: {question}
|
203 |
Context: """
|
204 |
|
@@ -227,7 +227,8 @@ def rag(domain: str, question: str):
|
|
227 |
embeddings = _load_embeddings_from_db(db_exists, domain)
|
228 |
# Create extractor instance
|
229 |
#extractor = Extractor(embeddings, "google/flan-t5-base")
|
230 |
-
extractor = Extractor(embeddings,
|
|
|
231 |
# llm = HuggingFaceHub(
|
232 |
# repo_id="google/flan-t5-xxl",
|
233 |
# model_kwargs={"temperature": 1, "max_length": 1000000},
|
|
|
198 |
|
199 |
|
200 |
def _prompt(question):
|
201 |
+
return f"""Answer the following question using only the context below. Say 'Could not find answer within the context' when the question can't be answered.
|
202 |
Question: {question}
|
203 |
Context: """
|
204 |
|
|
|
227 |
embeddings = _load_embeddings_from_db(db_exists, domain)
|
228 |
# Create extractor instance
|
229 |
#extractor = Extractor(embeddings, "google/flan-t5-base")
|
230 |
+
#extractor = Extractor(embeddings, "TheBloke/Llama-2-7B-GGUF")
|
231 |
+
extractor = Extractor(embeddings, "google/flan-t5-xl")
|
232 |
# llm = HuggingFaceHub(
|
233 |
# repo_id="google/flan-t5-xxl",
|
234 |
# model_kwargs={"temperature": 1, "max_length": 1000000},
|