Test markdown
Browse files
app.py
CHANGED
@@ -1,9 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
|
4 |
-
def
|
5 |
res = requests.get("https://api.quotable.io/random").json()
|
6 |
-
return res["content"]
|
7 |
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|