File size: 375 Bytes
cc2a765
d663feb
cc2a765
d663feb
 
 
 
 
 
cc2a765
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import gradio as gr
import requests

key = os.getenv("baixing_key")
url = "https://gpt.baixing.com/"

def chat(p, qid, uid): 
    result = requests.get(url, params={"p": p, "k": key}).json()['data']
    return ["text", result]

iface = gr.Interface(fn=chat, 
                     inputs=["text", "text", "text"], 
                     outputs=["text", "text"])
iface.launch()