File size: 440 Bytes
0a5606e
35081a2
0a5606e
ccd487a
35081a2
ccd487a
0a5606e
ccd487a
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
import requests

def quote():
    res = requests.get("https://api.quotable.io/random").json()
    return f'<h1> {res["content"]}</h1> <h3>{res["author"]}</h3>'

# demo = gr.Interface(fn=greet, inputs="text", outputs="text")

with gr.Blocks() as demo:
    # text = gr.Textbox(label="Quote")
    btn = gr.Button(value="Random quote")
    html = gr.Markdown()
    btn.click(quote, inputs=[], outputs=[html])

demo.launch()