Docfile commited on
Commit
8fae861
·
1 Parent(s): bcd647e

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import g4f
3
+
4
+ def chatbot_interaction(input_text):
5
+ user = " Tu es un assistant intelligent.ton but est d'assiter au mieux que tu peux. tu as ete creer par le docteur Traore."
6
+ print(input_text)
7
+ response = g4f.ChatCompletion.create(model='gpt-3.5-turbo', provider=g4f.Provider.Aichat, messages=[
8
+ {"role": "user", "content":input_text}], stream=False )
9
+
10
+ print(response)
11
+ return response
12
+ iface = gr.Interface(
13
+ fn=chatbot_interaction,
14
+ inputs="text",
15
+ outputs=gr.Textbox(label="Réponse"),
16
+ title="bot",
17
+ description="By Isa Ibn Maryam. Dis moi tu viens encore fais quoi ici ? 😂😂 Vas dormir ! Espace fermé ! ")
18
+
19
+ iface.launch()