Update rag.py
This commit is contained in:
parent
9c6c857f28
commit
747c56f252
6
rag.py
6
rag.py
@ -10,11 +10,11 @@ rag.py — recherche + génération (version robuste, chapitres)
|
||||
– top‑k configurable (déf. 20 pour index détaillé, 5 pour index chapitres).
|
||||
– trie ensuite les hits mettant en avant ceux contenant un mot‑clé fourni
|
||||
(ex. « seuil » pour ICS).
|
||||
• Génération : appelle Mistral‑7B (Ollama) avec temperature 0.1 et consigne :
|
||||
• Génération : appelle llama3-8b-fast (Ollama) avec temperature 0.1 et consigne :
|
||||
« Réponds uniquement à partir du contexte. Si l’info manque : Je ne sais pas. »
|
||||
|
||||
Usage :
|
||||
python rag.py [--k 25] [--kw seuil] [--model mistral7b-fast]
|
||||
python rag.py [--k 25] [--kw seuil] [--model llama3-8b-fast]
|
||||
"""
|
||||
from __future__ import annotations
|
||||
import argparse, json, re, sys
|
||||
@ -33,7 +33,7 @@ p.add_argument("--meta", nargs="*", default=["rapport.meta.json"],
|
||||
help="Liste des méta JSON assortis (même ordre que --index)")
|
||||
p.add_argument("--k", type=int, default=15, help="top‑k cumulés (déf. 15)")
|
||||
p.add_argument("--kw", default="seuil", help="mot‑clé boosté (déf. seuil)")
|
||||
p.add_argument("--model", default="mistral7b-fast", help="modèle Ollama")
|
||||
p.add_argument("--model", default="llama3-8b-fast", help="modèle Ollama")
|
||||
args = p.parse_args()
|
||||
|
||||
if len(args.index) != len(args.meta):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user