zest-2023 / app.py
yozozaya's picture
test as an API
5f9d5c0
raw
history blame
593 Bytes
import gradio
def my_inference_function(name):
return "Hello " + name + "!"
gradio_interface = gradio.Interface(
fn=my_inference_function,
inputs="text",
outputs="text",
examples=[
["Jill"],
["Sam"]
],
title="REST API with Gradio and Huggingface Spaces",
description="This is a demo of how to build an AI powered REST API with Gradio and Huggingface Spaces – for free! Based on [this article](https://www.tomsoderlund.com/ai/building-ai-powered-rest-api). See the **Use via API** link at the bottom of this page.",
article="Test 2023"
)
gradio_interface.launch()