Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import g4f
|
3 |
+
|
4 |
+
def chatbot_interaction(messages):
|
5 |
+
response = g4f.ChatCompletion.create(model='gpt-4', provider=g4f.Provider.ChatgptAi, messages=messages, stream=False)
|
6 |
+
return response
|
7 |
+
|
8 |
+
iface = gr.Interface(
|
9 |
+
fn=chatbot_interaction,
|
10 |
+
inputs="text",
|
11 |
+
outputs="text",
|
12 |
+
layout="vertical",
|
13 |
+
title="Chatbot",
|
14 |
+
description="Isa Ibn Maryam. Dis moi tu viens encore fais quoi ici ? 😂😂 Vas dormir ! Espace fermé ! ")
|
15 |
+
|
16 |
+
iface.launch()
|