NewUserID commited on
Commit
9997d5d
·
verified ·
1 Parent(s): d06338a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from g4f.client import Client
2
+ import gradio as gr
3
+
4
+ def process(prompt):
5
+ client = Client()
6
+ response = client.chat.completions.create(
7
+ model="gpt-3.5-turbo",
8
+ messages=[{"role": "user", "content": prompt}]
9
+ )
10
+ return(response.choices[0].message.content)
11
+
12
+ iface = gr.Interface(fn=process, inputs="text", outputs="text")
13
+ iface.launch()