Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
from rag_utils import load_faiss_index, get_embedding_model, query_index, nettoyer_context, generate_answer
|
3 |
|
@@ -24,10 +25,18 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="yellow"))
|
|
24 |
gr.Markdown("👋 Bonjour ! Je suis **EduPilot**, ton conseiller IA.\n\nPose-moi une question sur ton avenir scolaire, les filières, les écoles ou les métiers qui t'intéressent.")
|
25 |
|
26 |
chatbot = gr.Chatbot(label="Conseiller IA")
|
27 |
-
msg = gr.Textbox(placeholder="Exemple : Que faire après un bac pro ?", show_label=False)
|
28 |
state = gr.State([]) # historique du chat
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
msg.submit(respond, [msg, state], [msg, chatbot, state])
|
31 |
|
32 |
demo.launch()
|
33 |
-
|
|
|
1 |
+
|
2 |
import gradio as gr
|
3 |
from rag_utils import load_faiss_index, get_embedding_model, query_index, nettoyer_context, generate_answer
|
4 |
|
|
|
25 |
gr.Markdown("👋 Bonjour ! Je suis **EduPilot**, ton conseiller IA.\n\nPose-moi une question sur ton avenir scolaire, les filières, les écoles ou les métiers qui t'intéressent.")
|
26 |
|
27 |
chatbot = gr.Chatbot(label="Conseiller IA")
|
|
|
28 |
state = gr.State([]) # historique du chat
|
29 |
|
30 |
+
with gr.Row():
|
31 |
+
msg = gr.Textbox(
|
32 |
+
placeholder="Exemple : Que faire après un bac pro ?",
|
33 |
+
show_label=False,
|
34 |
+
container=True,
|
35 |
+
scale=8
|
36 |
+
)
|
37 |
+
submit = gr.Button("Envoyer", scale=1)
|
38 |
+
|
39 |
+
submit.click(respond, [msg, state], [msg, chatbot, state])
|
40 |
msg.submit(respond, [msg, state], [msg, chatbot, state])
|
41 |
|
42 |
demo.launch()
|
|