Spaces:
Sleeping
Sleeping
Update rag_utils.py
Browse files- rag_utils.py +4 -4
rag_utils.py
CHANGED
@@ -7,11 +7,11 @@ from sentence_transformers import SentenceTransformer
|
|
7 |
from transformers import AutoTokenizer # Ajouté pour la gestion des tokens
|
8 |
from huggingface_hub import InferenceClient
|
9 |
|
10 |
-
# Chargement du modèle
|
11 |
-
client = InferenceClient("
|
12 |
|
13 |
# Chargement du tokenizer (même base que Falcon)
|
14 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
15 |
|
16 |
def load_faiss_index(index_path="faiss_index/faiss_index.faiss", doc_path="faiss_index/documents.pkl"):
|
17 |
index = faiss.read_index(index_path)
|
@@ -73,5 +73,5 @@ Réponse :"""
|
|
73 |
print("===== RÉPONSE REÇUE =====")
|
74 |
print(response)
|
75 |
|
76 |
-
return response
|
77 |
|
|
|
7 |
from transformers import AutoTokenizer # Ajouté pour la gestion des tokens
|
8 |
from huggingface_hub import InferenceClient
|
9 |
|
10 |
+
# Chargement du modèle
|
11 |
+
client = InferenceClient("mistralai/Mistral-7B-Instruct-v0.1", token=os.environ.get("edup2"))
|
12 |
|
13 |
# Chargement du tokenizer (même base que Falcon)
|
14 |
+
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1")
|
15 |
|
16 |
def load_faiss_index(index_path="faiss_index/faiss_index.faiss", doc_path="faiss_index/documents.pkl"):
|
17 |
index = faiss.read_index(index_path)
|
|
|
73 |
print("===== RÉPONSE REÇUE =====")
|
74 |
print(response)
|
75 |
|
76 |
+
return response # selon format du retour
|
77 |
|