File size: 577 Bytes
c10da6a 2577a9c c10da6a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | import gradio as gr
# def greet(name):
# return "Hello " + name + "!"
# demo = gr.Interface(fn=greet, inputs="textbox", outputs="textbox")
# Define the API URL
api_url = "https://jsonplaceholder.typicode.com/guides"
# Fetch the data from the API
data = gr.get(api_url)
# Create a table with the fetched data
table = gr.table(data, headers=["ID", "Name", "Email"])
# Create a Gradio interface with the table
interface = gr.Interface(fn=table, inputs=None, outputs=table)
interface.launch()
demo.launch(share=True) # Share your demo with just 1 extra parameter 🚀
|