Update app.py
Browse files
app.py
CHANGED
@@ -171,7 +171,7 @@ class OptimizedRAGLoader:
|
|
171 |
"""Vérifie si l'index et les documents associés existent"""
|
172 |
return self.index_path.exists() and self.documents_path.exists()
|
173 |
|
174 |
-
def get_retriever(self, k: int =
|
175 |
if self.index is None:
|
176 |
if not self.load_index():
|
177 |
if not self.create_index():
|
@@ -225,8 +225,9 @@ prompt_template = ChatPromptTemplate.from_messages([
|
|
225 |
|
226 |
إذا لم تكن المعلومات كافية للإجابة على السؤال بشكل كامل، قم بتوضيح ذلك.
|
227 |
أجب بشكل موجز ودقيق.
|
|
|
228 |
أذكر رقم المادة المصدر.
|
229 |
-
أذكر اسم ورقم
|
230 |
"""),
|
231 |
("human", "{question}")
|
232 |
])
|
@@ -379,7 +380,7 @@ def gradio_stream(question: str, chat_history: list) -> Iterator[list]:
|
|
379 |
# Gradio interface
|
380 |
with gr.Blocks(css=css) as demo:
|
381 |
|
382 |
-
gr.Markdown("<h2 style='text-align: center !important;'
|
383 |
|
384 |
# Organisation en 3 lignes
|
385 |
with gr.Row(): # Première ligne: Question
|
|
|
171 |
"""Vérifie si l'index et les documents associés existent"""
|
172 |
return self.index_path.exists() and self.documents_path.exists()
|
173 |
|
174 |
+
def get_retriever(self, k: int = 10):
|
175 |
if self.index is None:
|
176 |
if not self.load_index():
|
177 |
if not self.create_index():
|
|
|
225 |
|
226 |
إذا لم تكن المعلومات كافية للإجابة على السؤال بشكل كامل، قم بتوضيح ذلك.
|
227 |
أجب بشكل موجز ودقيق.
|
228 |
+
/n
|
229 |
أذكر رقم المادة المصدر.
|
230 |
+
أذكر اسم ورقم القانون.
|
231 |
"""),
|
232 |
("human", "{question}")
|
233 |
])
|
|
|
380 |
# Gradio interface
|
381 |
with gr.Blocks(css=css) as demo:
|
382 |
|
383 |
+
gr.Markdown("<h2 style='text-align: center !important;'>هذا تطبيق للاجابة على الأسئلة المتعلقة يالقوانين المغربية</h2>")
|
384 |
|
385 |
# Organisation en 3 lignes
|
386 |
with gr.Row(): # Première ligne: Question
|