Update rag.py
This commit is contained in:
parent
be9c3709db
commit
8c99fd2da3
4
rag.py
4
rag.py
@ -83,7 +83,7 @@ try:
|
|||||||
|
|
||||||
context = "\n\n".join(docs[int(i)] for i in hits)
|
context = "\n\n".join(docs[int(i)] for i in hits)
|
||||||
prompt = (
|
prompt = (
|
||||||
"<system>Réponds en français, précis et factuel.</system>\n"
|
"<system>Réponds en français, de façon précise, et uniquement à partir du contexte fourni. Si l'information n'est pas dans le contexte, réponds : 'Je ne sais pas'.</system>\n"
|
||||||
f"<context>{context}</context>\n<user>{q}</user>"
|
f"<context>{context}</context>\n<user>{q}</user>"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ try:
|
|||||||
"model": "mistral7b-fast",
|
"model": "mistral7b-fast",
|
||||||
"prompt": p,
|
"prompt": p,
|
||||||
"stream": False,
|
"stream": False,
|
||||||
"options": {"temperature": 0.2, "num_predict": 512}
|
"options": {"temperature": 0.0, "num_predict": 512}
|
||||||
}, timeout=300)
|
}, timeout=300)
|
||||||
return r.json()["response"]
|
return r.json()["response"]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user