File size: 385 Bytes
cc2a765
9458f8a
d663feb
cc2a765
d663feb
 
 
 
 
 
cc2a765
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr
import os
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()