Mode
Browse files
app.py
CHANGED
|
@@ -2,19 +2,18 @@ import gradio as gr
|
|
| 2 |
import g4f
|
| 3 |
|
| 4 |
def chatbot_interaction(input_text):
|
| 5 |
-
|
| 6 |
-
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
print(response)
|
| 11 |
return response
|
| 12 |
iface = gr.Interface(
|
| 13 |
fn=chatbot_interaction,
|
| 14 |
inputs="text",
|
| 15 |
outputs="text",
|
| 16 |
layout="vertical",
|
| 17 |
-
title="
|
| 18 |
description="Isa Ibn Maryam. Dis moi tu viens encore fais quoi ici ? 😂😂 Vas dormir ! Espace fermé ! ")
|
| 19 |
|
| 20 |
iface.launch()
|
|
|
|
| 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(f"Question : {input_text}")
|
| 7 |
+
response = g4f.ChatCompletion.create(model='gpt-4', provider=g4f.Provider.ChatgptAi, messages=[{"role":user, "content":input_text }], stream=False )
|
| 8 |
|
| 9 |
+
print(f"Reponse : {response}")
|
|
|
|
|
|
|
| 10 |
return response
|
| 11 |
iface = gr.Interface(
|
| 12 |
fn=chatbot_interaction,
|
| 13 |
inputs="text",
|
| 14 |
outputs="text",
|
| 15 |
layout="vertical",
|
| 16 |
+
title="bot",
|
| 17 |
description="Isa Ibn Maryam. Dis moi tu viens encore fais quoi ici ? 😂😂 Vas dormir ! Espace fermé ! ")
|
| 18 |
|
| 19 |
iface.launch()
|