rin2401 commited on
Commit
ccd487a
1 Parent(s): ddb0ce4

Test markdown

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -1,9 +1,16 @@
1
  import gradio as gr
2
  import requests
3
 
4
- def greet(name):
5
  res = requests.get("https://api.quotable.io/random").json()
6
- return res["content"] + "\n\n" + res["author"]
7
 
8
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
9
- iface.launch()
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
  import requests
3
 
4
+ def quote():
5
  res = requests.get("https://api.quotable.io/random").json()
6
+ return f'<h1> {res["content"]}</h1> <h3>{res["author"]}</h3>'
7
 
8
+ # demo = gr.Interface(fn=greet, inputs="text", outputs="text")
9
+
10
+ with gr.Blocks() as demo:
11
+ # text = gr.Textbox(label="Quote")
12
+ btn = gr.Button(value="Random quote")
13
+ html = gr.Markdown()
14
+ btn.click(quote, inputs=[], outputs=[html])
15
+
16
+ demo.launch()