import gradio as gr import requests #from transformers import AutoTokenizer #tokenizer = AutoTokenizer.from_pretrained("liam168/c2-roberta-base-finetuned-dianping-chinese") def chat(input): url = 'http://dark.21cnai.com:5000/api/chat' data = { "message": input } headers = {"Content-Type": "Application/json","Authorization":"Bearer kdfjwoieskdflasdnf"} response = requests.post(url, json=data, headers=headers) print(response.text) return response.text iface = gr.Interface(fn=chat, inputs="text", outputs="text") iface.launch(server_name="0.0.0.0")