yingzhi commited on
Commit
804973c
·
verified ·
1 Parent(s): 2f6bf49

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +42 -0
app.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import re
3
+
4
+
5
+ with open("README.md", encoding="utf-8") as f:
6
+ md = f.read()
7
+
8
+ md = re.sub(r"^---.*?---\s*", "", md, flags=re.S)
9
+
10
+ CSS = """
11
+ :root {
12
+ font-size: 20px !important;
13
+ }
14
+ .gradio-container {
15
+ font-size: 20px !important;
16
+ }
17
+ .gradio-container .markdown,
18
+ .gradio-container .markdown p,
19
+ .gradio-container .markdown li {
20
+ font-size: 20px !important;
21
+ line-height: 1.9 !important;
22
+ }
23
+ .gradio-container .markdown h1 {
24
+ font-size: 2.4rem !important;
25
+ }
26
+ .gradio-container .markdown h2 {
27
+ font-size: 1.8rem !important;
28
+ }
29
+ .gradio-container .markdown h3 {
30
+ font-size: 1.4rem !important;
31
+ }
32
+ .gradio-container {
33
+ max-width: 900px;
34
+ margin: auto;
35
+ }
36
+ """
37
+
38
+ with gr.Blocks(css=CSS) as demo:
39
+ gr.Image("image1.jpeg", show_label=False)
40
+ gr.Markdown(md)
41
+ gr.Image("image2.png", show_label=False)
42
+ demo.launch()