API_demo_client / app copy.py
Nuno-Tome's picture
as
749138f
raw
history blame
530 Bytes
from gradio_client import Client
import gradio as gr
DEBUG_MODE = True
client = Client("Nuno-Tome/API_demo_server")
def request(text):
#if DEBUG_MODE:
result = "Hello World"
# gr.Markdown("client:" + str(client))
# gr.Markdown(f"## Requesting prediction for: {text}")
result = client.echo(text, api_name="/echo")
#if DEBUG_MODE:
# gr.Markdown(f"## Prediction result: {result}")
# print(f"Prediction result: {result}")
return result
io = gr.Interface(request, "textbox", "json")