Spaces:
Runtime error
Runtime error
import os | |
import json | |
import requests | |
import gradio as gr | |
server_url = os.environ["SERVER_URL"] | |
def chat(message, history): | |
data = { | |
"message": message, | |
"history": history | |
} | |
response = requests.post( | |
server_url, | |
json = data | |
).json() | |
return response['response'] | |
gradio_io = gr.ChatInterface(chat) | |
gradio_io.launch() | |