Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ chatbot = pipeline("text-generation", model="gpt2")
5
+
6
+ def repondre(question):
7
+ reponse = chatbot(question, max_length=50)
8
+ return reponse[0]["generated_text"]
9
+
10
+ interface = gr.Interface(
11
+ fn=repondre,
12
+ inputs="text",
13
+ outputs="text",
14
+ title="Mon site IA"
15
+ )
16
+
17
+ interface.launch()