Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,52 +42,33 @@ def run_struct(text, struct_json):
|
|
| 42 |
res = model.extract_json(text=text, structures=cfg, include_confidence=True)
|
| 43 |
return model.pretty_print_results(res, include_confidence=True)
|
| 44 |
|
| 45 |
-
#
|
| 46 |
custom_css = """
|
| 47 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
|
| 48 |
-
|
| 49 |
-
--primary: #4f46e5;
|
| 50 |
-
--secondary: #6366f1;
|
| 51 |
-
--background: #f9fafb;
|
| 52 |
-
--card-bg: #ffffff;
|
| 53 |
-
--text: #1f2937;
|
| 54 |
-
--muted: #6b7280;
|
| 55 |
-
}
|
| 56 |
body {
|
| 57 |
-
background: var(--background) !important;
|
| 58 |
font-family: 'Inter', sans-serif;
|
| 59 |
-
color: var(--text) !important;
|
| 60 |
}
|
|
|
|
| 61 |
header.brand {
|
| 62 |
padding: 2rem 0;
|
| 63 |
text-align: center;
|
| 64 |
}
|
|
|
|
| 65 |
header.brand .logo {
|
| 66 |
font-size: 2rem;
|
| 67 |
font-weight: 700;
|
| 68 |
-
color:
|
| 69 |
}
|
|
|
|
| 70 |
header.brand .subtitle {
|
| 71 |
margin-top: 0.2rem;
|
| 72 |
font-size: 0.9rem;
|
| 73 |
-
color:
|
| 74 |
-
}
|
| 75 |
-
.gradio-container {
|
| 76 |
-
max-width: 800px;
|
| 77 |
-
margin: auto;
|
| 78 |
-
padding: 1rem;
|
| 79 |
-
}
|
| 80 |
-
.card {
|
| 81 |
-
background: var(--card-bg);
|
| 82 |
-
padding: 1.5rem;
|
| 83 |
-
border-radius: 0.75rem;
|
| 84 |
-
box-shadow: 0 4px 10px rgba(0,0,0,0.05);
|
| 85 |
-
margin-bottom: 1.5rem;
|
| 86 |
-
display: grid;
|
| 87 |
-
grid-gap: 1rem;
|
| 88 |
}
|
|
|
|
| 89 |
.gr-button.primary {
|
| 90 |
-
background:
|
| 91 |
color: #fff !important;
|
| 92 |
border-radius: 0.5rem;
|
| 93 |
padding: 0.6rem 1.2rem;
|
|
@@ -152,4 +133,4 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="purple", secondary_hue="blue"),
|
|
| 152 |
out3 = gr.Code(language="json", label="Results", lines=8)
|
| 153 |
btn3.click(run_struct, inputs=[txt3, struct3], outputs=out3)
|
| 154 |
|
| 155 |
-
demo.launch(share=False)
|
|
|
|
| 42 |
res = model.extract_json(text=text, structures=cfg, include_confidence=True)
|
| 43 |
return model.pretty_print_results(res, include_confidence=True)
|
| 44 |
|
| 45 |
+
# Simplified CSS - uses default backgrounds
|
| 46 |
custom_css = """
|
| 47 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
|
| 48 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
body {
|
|
|
|
| 50 |
font-family: 'Inter', sans-serif;
|
|
|
|
| 51 |
}
|
| 52 |
+
|
| 53 |
header.brand {
|
| 54 |
padding: 2rem 0;
|
| 55 |
text-align: center;
|
| 56 |
}
|
| 57 |
+
|
| 58 |
header.brand .logo {
|
| 59 |
font-size: 2rem;
|
| 60 |
font-weight: 700;
|
| 61 |
+
color: #4f46e5;
|
| 62 |
}
|
| 63 |
+
|
| 64 |
header.brand .subtitle {
|
| 65 |
margin-top: 0.2rem;
|
| 66 |
font-size: 0.9rem;
|
| 67 |
+
color: #6b7280;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
}
|
| 69 |
+
|
| 70 |
.gr-button.primary {
|
| 71 |
+
background: #4f46e5 !important;
|
| 72 |
color: #fff !important;
|
| 73 |
border-radius: 0.5rem;
|
| 74 |
padding: 0.6rem 1.2rem;
|
|
|
|
| 133 |
out3 = gr.Code(language="json", label="Results", lines=8)
|
| 134 |
btn3.click(run_struct, inputs=[txt3, struct3], outputs=out3)
|
| 135 |
|
| 136 |
+
demo.launch(share=False, width=800)
|