summaryrefslogtreecommitdiff
path: root/rag/generator/ollama.py
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2024-04-24 01:10:43 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2024-04-24 01:10:43 +0200
commit95305f59df84caded50286b1a57b6075e48725a8 (patch)
treec0f0157a99da6332a3c96462b0aba2bd02dfcb33 /rag/generator/ollama.py
parent75be0914f6bd2cdeda1539f83b38fcbc854d5cfa (diff)
Rerank working
llama3 sucks at rag
Diffstat (limited to 'rag/generator/ollama.py')
-rw-r--r--rag/generator/ollama.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/rag/generator/ollama.py b/rag/generator/ollama.py
index b72d763..9118906 100644
--- a/rag/generator/ollama.py
+++ b/rag/generator/ollama.py
@@ -1,5 +1,5 @@
import os
-from typing import Any, Dict, Generator, List
+from typing import Any, Generator, List
import ollama
from loguru import logger as log
@@ -24,12 +24,12 @@ class Ollama(metaclass=AbstractGenerator):
def __metaprompt(self, prompt: Prompt) -> str:
metaprompt = (
- "Answer the question based only on the following context:\n"
- "<context>\n"
- f"{self.__context(prompt.documents)}\n\n"
- "</context>\n"
f"{ANSWER_INSTRUCTION}"
+ "Only the information between <results>...</results> should be used to answer the question.\n"
f"Question: {prompt.query.strip()}\n\n"
+ "<results>\n"
+ f"{self.__context(prompt.documents)}\n\n"
+ "</results>\n"
"Answer:"
)
return metaprompt