Update gradio_demo.py
Browse files- gradio_demo.py +21 -1
gradio_demo.py
CHANGED
@@ -15,6 +15,26 @@ from pdf_attacker import PDFAttacker
|
|
15 |
|
16 |
attacker = PDFAttacker()
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
def _ensure_tmp_dir() -> str:
|
20 |
"""Ensure tmp dir exists and return its path"""
|
@@ -80,7 +100,7 @@ def generate_pdf(
|
|
80 |
|
81 |
def build_demo():
|
82 |
"""Construct and return the Gradio Blocks demo"""
|
83 |
-
with gr.Blocks() as demo:
|
84 |
gr.Markdown("# PDF Humanizer: Attack demo\nGenerate PDFs that look normal but extract differently when copied")
|
85 |
|
86 |
with gr.Row():
|
|
|
15 |
|
16 |
attacker = PDFAttacker()
|
17 |
|
18 |
+
# Theme customization per request
|
19 |
+
theme = gr.themes.Soft(
|
20 |
+
primary_hue="fuchsia",
|
21 |
+
secondary_hue="cyan",
|
22 |
+
neutral_hue="gray",
|
23 |
+
radius_size="none",
|
24 |
+
font=[
|
25 |
+
gr.themes.GoogleFont("IBM Plex Sans"),
|
26 |
+
"ui-sans-serif",
|
27 |
+
"system-ui",
|
28 |
+
"sans-serif",
|
29 |
+
],
|
30 |
+
font_mono=[
|
31 |
+
gr.themes.GoogleFont("IBM Plex Mono"),
|
32 |
+
"ui-monospace",
|
33 |
+
"Consolas",
|
34 |
+
"monospace",
|
35 |
+
],
|
36 |
+
)
|
37 |
+
|
38 |
|
39 |
def _ensure_tmp_dir() -> str:
|
40 |
"""Ensure tmp dir exists and return its path"""
|
|
|
100 |
|
101 |
def build_demo():
|
102 |
"""Construct and return the Gradio Blocks demo"""
|
103 |
+
with gr.Blocks(theme=theme) as demo:
|
104 |
gr.Markdown("# PDF Humanizer: Attack demo\nGenerate PDFs that look normal but extract differently when copied")
|
105 |
|
106 |
with gr.Row():
|