Update app.py
Browse files
app.py
CHANGED
@@ -207,12 +207,12 @@ mistral_api_key = os.getenv("mistral_api_key")
|
|
207 |
llm = ChatMistralAI(
|
208 |
model="mistral-large-latest",
|
209 |
mistral_api_key=mistral_api_key,
|
210 |
-
temperature=0.
|
211 |
streaming=True,
|
212 |
)
|
213 |
|
214 |
rag_loader = OptimizedRAGLoader()
|
215 |
-
retriever = rag_loader.get_retriever(k=
|
216 |
|
217 |
# Cache for processed questions
|
218 |
question_cache = {}
|
@@ -223,11 +223,11 @@ prompt_template = ChatPromptTemplate.from_messages([
|
|
223 |
|
224 |
{context}
|
225 |
|
226 |
-
إذا لم تكن المعلومات كافية للإجابة على السؤال بشكل كامل،
|
227 |
أجب بشكل موجز ودقيق.
|
228 |
/n
|
229 |
-
أذكر رقم المادة
|
230 |
-
أذكر اسم ورقم
|
231 |
"""),
|
232 |
("human", "{question}")
|
233 |
])
|
@@ -247,7 +247,7 @@ css = """
|
|
247 |
body {
|
248 |
font-family: 'Amiri', sans-serif; /* Utilisation de la police Arabe andalouse */
|
249 |
background-color: white; /* Fond blanc */
|
250 |
-
color: black; /* Texte noir */
|
251 |
direction: rtl !important; /* Texte en arabe aligné à droite */
|
252 |
}
|
253 |
|
|
|
207 |
llm = ChatMistralAI(
|
208 |
model="mistral-large-latest",
|
209 |
mistral_api_key=mistral_api_key,
|
210 |
+
temperature=0.01,
|
211 |
streaming=True,
|
212 |
)
|
213 |
|
214 |
rag_loader = OptimizedRAGLoader()
|
215 |
+
retriever = rag_loader.get_retriever(k=4) # Reduced k for faster retrieval
|
216 |
|
217 |
# Cache for processed questions
|
218 |
question_cache = {}
|
|
|
223 |
|
224 |
{context}
|
225 |
|
226 |
+
إذا لم تكن المعلومات كافية للإجابة على السؤال بشكل كامل، قل لا أعرف.
|
227 |
أجب بشكل موجز ودقيق.
|
228 |
/n
|
229 |
+
أذكر رقم المادة أو الفصل حسب الحالة.
|
230 |
+
أذكر اسم ورقم القانون ان كان متوفرا وان لم يكن لا تذكر شيئا.
|
231 |
"""),
|
232 |
("human", "{question}")
|
233 |
])
|
|
|
247 |
body {
|
248 |
font-family: 'Amiri', sans-serif; /* Utilisation de la police Arabe andalouse */
|
249 |
background-color: white; /* Fond blanc */
|
250 |
+
color: black !important; /* Texte noir */
|
251 |
direction: rtl !important; /* Texte en arabe aligné à droite */
|
252 |
}
|
253 |
|