Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,23 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
#
|
5 |
-
chatbot = pipeline("text-generation", model="
|
6 |
-
|
7 |
|
8 |
def respond(message, history):
|
9 |
prompt = f"""
|
10 |
Tu es un assistant incisif, direct, empathique mais sans pitié.
|
11 |
-
Tu réponds
|
12 |
Utilisateur : {message}
|
13 |
Assistant :
|
14 |
"""
|
15 |
resp = chatbot(prompt, max_new_tokens=150, do_sample=True, temperature=0.7)[0]['generated_text']
|
16 |
return resp.split("Assistant :")[-1].strip()
|
17 |
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
20 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
# Utilisation du modèle français public
|
5 |
+
chatbot = pipeline("text-generation", model="dbddv01/gpt2-french-small")
|
|
|
6 |
|
7 |
def respond(message, history):
|
8 |
prompt = f"""
|
9 |
Tu es un assistant incisif, direct, empathique mais sans pitié.
|
10 |
+
Tu réponds uniquement en français, sans adoucir les choses.
|
11 |
Utilisateur : {message}
|
12 |
Assistant :
|
13 |
"""
|
14 |
resp = chatbot(prompt, max_new_tokens=150, do_sample=True, temperature=0.7)[0]['generated_text']
|
15 |
return resp.split("Assistant :")[-1].strip()
|
16 |
|
17 |
+
iface = gr.ChatInterface(
|
18 |
+
fn=respond,
|
19 |
+
title="🧠 TÊTE À L’ENVERS – Assistant Psychologique Incisif",
|
20 |
+
description="Pose ta question, je te répondrai sans détour, en français."
|
21 |
+
)
|
22 |
+
|
23 |
iface.launch()
|