Spaces:
Sleeping
Sleeping
Commit
·
5790c07
1
Parent(s):
f184c54
Better path handling
Browse files- app.py +3 -5
- articles.pkl +2 -2
- faiss_code_education/index.faiss +1 -1
- faiss_code_education/index.pkl +2 -2
app.py
CHANGED
@@ -51,7 +51,7 @@ def query_rag(query, model, system_prompt):
|
|
51 |
context_list = []
|
52 |
for doc in docs:
|
53 |
article = doc.metadata
|
54 |
-
context_list.append(article['chemin']+'\n'+article['texte']+'\n---\n')
|
55 |
article_dict[article['article']] = article
|
56 |
|
57 |
user = 'Question de l\'utilisateur : ' + query + '\nContexte législatif :\n' + '\n'.join(context_list)
|
@@ -73,7 +73,7 @@ def create_context_response(response, article_dict):
|
|
73 |
context = '\n'
|
74 |
for i, article in enumerate(article_dict):
|
75 |
art = article_dict[article]
|
76 |
-
context += '* **' + art['chemin'] + '** : '+ art['texte'].replace('\n', '\n ')+'\n'
|
77 |
return context
|
78 |
|
79 |
def chat_interface(query, model, system_prompt):
|
@@ -99,9 +99,7 @@ with gr.Blocks(title="Assistant Juridique pour le Code de l'éducation (Beta)")
|
|
99 |
|
100 |
**Créé par Marc de Falco**
|
101 |
|
102 |
-
**Avertissement :** Les informations fournies sont à titre indicatif et ne constituent pas un avis juridique. Les serveurs étant publics, veuillez ne pas inclure de données sensibles.
|
103 |
-
|
104 |
-
**Conseil :** Survolez les numéros d'article dans les réponses pour voir le texte complet de l'article.
|
105 |
"""
|
106 |
)
|
107 |
|
|
|
51 |
context_list = []
|
52 |
for doc in docs:
|
53 |
article = doc.metadata
|
54 |
+
context_list.append(' > '.join(article['chemin'])+'\n'+article['texte']+'\n---\n')
|
55 |
article_dict[article['article']] = article
|
56 |
|
57 |
user = 'Question de l\'utilisateur : ' + query + '\nContexte législatif :\n' + '\n'.join(context_list)
|
|
|
73 |
context = '\n'
|
74 |
for i, article in enumerate(article_dict):
|
75 |
art = article_dict[article]
|
76 |
+
context += '* **' + ' > '.join(art['chemin']) + '** : '+ art['texte'].replace('\n', '\n ')+'\n'
|
77 |
return context
|
78 |
|
79 |
def chat_interface(query, model, system_prompt):
|
|
|
99 |
|
100 |
**Créé par Marc de Falco**
|
101 |
|
102 |
+
**Avertissement :** Les informations fournies sont données à titre indicatif et ne constituent pas un avis juridique. Les serveurs étant publics, veuillez ne pas inclure de données sensibles.
|
|
|
|
|
103 |
"""
|
104 |
)
|
105 |
|
articles.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2f049670fb50d8f570356892ba92ea0d09e80e91b276b47968ef499e9e27821b
|
3 |
+
size 4703423
|
faiss_code_education/index.faiss
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 21831725
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5f3ad6e2ffa6375323e18d49d114edcc33decb30e0a9b8a1c03b8951282f3eec
|
3 |
size 21831725
|
faiss_code_education/index.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b1ebdc031966653a31d7110c6c9fa113eddbf6fabe41d21361d334c656ff7ee0
|
3 |
+
size 10616991
|