Spaces:
Sleeping
Sleeping
Commit
·
17599b8
1
Parent(s):
5c14a51
upds
Browse files
app.py
CHANGED
|
@@ -10,23 +10,55 @@ custom_css = """
|
|
| 10 |
--martian-gray-medium: #2A2A2A;
|
| 11 |
}
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
}
|
| 16 |
|
| 17 |
/* TABS - Bigger and bolder */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
.tab-nav button {
|
| 19 |
font-size: 1.6rem !important;
|
| 20 |
font-weight: 800 !important;
|
| 21 |
padding: 1.25rem 2.5rem !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
}
|
| 23 |
|
| 24 |
.tab-nav button.selected {
|
| 25 |
background: var(--martian-orange) !important;
|
| 26 |
color: white !important;
|
|
|
|
| 27 |
}
|
| 28 |
|
| 29 |
-
/* ORANGE RECTANGLE LABELS
|
| 30 |
label span, .label-wrap span {
|
| 31 |
background: var(--martian-orange) !important;
|
| 32 |
color: white !important;
|
|
@@ -37,47 +69,80 @@ label span, .label-wrap span {
|
|
| 37 |
display: inline-block !important;
|
| 38 |
}
|
| 39 |
|
| 40 |
-
/*
|
| 41 |
-
.
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
}
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
}
|
| 50 |
|
| 51 |
-
/* Citation box
|
| 52 |
.citation-content {
|
| 53 |
-
background:
|
| 54 |
-
padding: 1rem !important;
|
| 55 |
-
border-radius: 8px !important;
|
| 56 |
}
|
| 57 |
|
| 58 |
.citation-content pre {
|
| 59 |
-
background:
|
| 60 |
color: #D0D0D0 !important;
|
| 61 |
-
margin: 0 !important;
|
| 62 |
}
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
|
|
|
| 66 |
}
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
| 70 |
}
|
| 71 |
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
| 75 |
}
|
| 76 |
"""
|
| 77 |
|
| 78 |
with gr.Blocks(css=custom_css, title="TinySQL Demo") as demo:
|
| 79 |
gr.HTML("""
|
| 80 |
-
<div style="text-align: center; padding: 1.5rem 0 1rem 0;">
|
| 81 |
<h1 style="font-size: 2rem; font-weight: 700; color: #FF6B4A; margin: 0;">TinySQL</h1>
|
| 82 |
<p style="color: #999; font-size: 0.95rem; margin-top: 0.25rem;">Mechanistic Interpretability for Text-to-SQL</p>
|
| 83 |
</div>
|
|
@@ -96,8 +161,8 @@ with gr.Blocks(css=custom_css, title="TinySQL Demo") as demo:
|
|
| 96 |
gr.HTML("""
|
| 97 |
<div style="border-radius: 12px; padding: 1.5rem; margin: 2rem auto; max-width: 900px; background: #2A2A2A;">
|
| 98 |
<div style="font-weight: 700; color: #FF6B4A; margin-bottom: 1rem; font-size: 1.1rem; text-align: center;">Cite Our Work</div>
|
| 99 |
-
<div class="citation-content">
|
| 100 |
-
<pre style="font-family: 'Monaco', monospace; font-size: 0.85rem; overflow-x: auto;">@misc{harrasse2025tinysqlprogressivetexttosqldataset,
|
| 101 |
title={TinySQL: A Progressive Text-to-SQL Dataset for Mechanistic Interpretability Research},
|
| 102 |
author={Abir Harrasse and Philip Quirke and Clement Neo and Dhruv Nathawani and Luke Marks and Amir Abdullah},
|
| 103 |
year={2025},
|
|
@@ -111,8 +176,8 @@ with gr.Blocks(css=custom_css, title="TinySQL Demo") as demo:
|
|
| 111 |
""")
|
| 112 |
|
| 113 |
gr.HTML("""
|
| 114 |
-
<div style="text-align: center; padding: 2rem 0; margin-top: 3rem;">
|
| 115 |
-
<p style="font-size: 0.85rem; margin-top: 1rem;">
|
| 116 |
<a href="https://arxiv.org/abs/2503.12730" style="color: #FF6B4A;">Paper</a> •
|
| 117 |
<a href="https://github.com/withmartian/TinySQL" style="color: #FF6B4A;">Code</a> •
|
| 118 |
<a href="https://huggingface.co/collections/withmartian/tinysql-6760e92748b63fa56a6ffc9f" style="color: #FF6B4A;">Dataset</a>
|
|
|
|
| 10 |
--martian-gray-medium: #2A2A2A;
|
| 11 |
}
|
| 12 |
|
| 13 |
+
/* FORCE DARK MODE EVERYWHERE */
|
| 14 |
+
.gradio-container, .gradio-container *, body, html {
|
| 15 |
+
background-color: var(--martian-black) !important;
|
| 16 |
+
color: #E0E0E0 !important;
|
| 17 |
+
color-scheme: dark !important;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
/* Force dark backgrounds on all elements */
|
| 21 |
+
div, section, .block, .panel, .form, .input-wrap {
|
| 22 |
+
background-color: var(--martian-black) !important;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
/* Force text colors */
|
| 26 |
+
h1, h2, h3, h4, h5, h6, p, span, label, div, strong {
|
| 27 |
+
color: #E0E0E0 !important;
|
| 28 |
}
|
| 29 |
|
| 30 |
/* TABS - Bigger and bolder */
|
| 31 |
+
.tab-nav {
|
| 32 |
+
border-bottom: 2px solid var(--martian-gray-dark) !important;
|
| 33 |
+
background: var(--martian-gray-dark) !important;
|
| 34 |
+
padding: 0.5rem 1rem !important;
|
| 35 |
+
border-radius: 12px 12px 0 0 !important;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
.tab-nav button {
|
| 39 |
font-size: 1.6rem !important;
|
| 40 |
font-weight: 800 !important;
|
| 41 |
padding: 1.25rem 2.5rem !important;
|
| 42 |
+
border-radius: 8px !important;
|
| 43 |
+
margin: 0 0.25rem !important;
|
| 44 |
+
transition: all 0.3s ease !important;
|
| 45 |
+
color: #888 !important;
|
| 46 |
+
border: none !important;
|
| 47 |
+
background: transparent !important;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.tab-nav button:hover {
|
| 51 |
+
background: var(--martian-gray-medium) !important;
|
| 52 |
+
color: #E0E0E0 !important;
|
| 53 |
}
|
| 54 |
|
| 55 |
.tab-nav button.selected {
|
| 56 |
background: var(--martian-orange) !important;
|
| 57 |
color: white !important;
|
| 58 |
+
box-shadow: 0 2px 8px rgba(255, 107, 74, 0.3) !important;
|
| 59 |
}
|
| 60 |
|
| 61 |
+
/* ORANGE RECTANGLE LABELS */
|
| 62 |
label span, .label-wrap span {
|
| 63 |
background: var(--martian-orange) !important;
|
| 64 |
color: white !important;
|
|
|
|
| 69 |
display: inline-block !important;
|
| 70 |
}
|
| 71 |
|
| 72 |
+
/* Input fields */
|
| 73 |
+
select, input, textarea, .input-wrap input {
|
| 74 |
+
background: var(--martian-gray-medium) !important;
|
| 75 |
+
border: 1px solid #3A3A3A !important;
|
| 76 |
+
color: #E0E0E0 !important;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
select:focus, input:focus, textarea:focus {
|
| 80 |
+
border-color: var(--martian-orange) !important;
|
| 81 |
+
outline: none !important;
|
| 82 |
+
box-shadow: 0 0 0 2px rgba(255, 107, 74, 0.2) !important;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
/* Orange sliders */
|
| 86 |
+
input[type="range"]::-webkit-slider-thumb {
|
| 87 |
+
background: var(--martian-orange) !important;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
input[type="range"]::-moz-range-thumb {
|
| 91 |
+
background: var(--martian-orange) !important;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
input[type="range"]::-webkit-slider-track {
|
| 95 |
+
background: #3A3A3A !important;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
input[type="range"]::-moz-range-track {
|
| 99 |
+
background: #3A3A3A !important;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
/* Buttons */
|
| 103 |
+
.primary, .primary:hover {
|
| 104 |
+
background: var(--martian-orange) !important;
|
| 105 |
+
border-color: var(--martian-orange) !important;
|
| 106 |
+
color: white !important;
|
| 107 |
}
|
| 108 |
|
| 109 |
+
button {
|
| 110 |
+
border: none !important;
|
| 111 |
+
background: var(--martian-gray-medium) !important;
|
| 112 |
+
color: #E0E0E0 !important;
|
| 113 |
}
|
| 114 |
|
| 115 |
+
/* Citation box */
|
| 116 |
.citation-content {
|
| 117 |
+
background: var(--martian-gray-medium) !important;
|
|
|
|
|
|
|
| 118 |
}
|
| 119 |
|
| 120 |
.citation-content pre {
|
| 121 |
+
background: var(--martian-gray-dark) !important;
|
| 122 |
color: #D0D0D0 !important;
|
|
|
|
| 123 |
}
|
| 124 |
|
| 125 |
+
/* Dataset info - force white text for CS1, CS2, etc */
|
| 126 |
+
.dataset-info strong {
|
| 127 |
+
color: #E0E0E0 !important;
|
| 128 |
}
|
| 129 |
|
| 130 |
+
/* Dropdown and select */
|
| 131 |
+
select option {
|
| 132 |
+
background: var(--martian-gray-medium) !important;
|
| 133 |
+
color: #E0E0E0 !important;
|
| 134 |
}
|
| 135 |
|
| 136 |
+
/* Code blocks */
|
| 137 |
+
code, pre {
|
| 138 |
+
background: var(--martian-gray-dark) !important;
|
| 139 |
+
color: #D0D0D0 !important;
|
| 140 |
}
|
| 141 |
"""
|
| 142 |
|
| 143 |
with gr.Blocks(css=custom_css, title="TinySQL Demo") as demo:
|
| 144 |
gr.HTML("""
|
| 145 |
+
<div style="text-align: center; padding: 1.5rem 0 1rem 0; background: #0A0A0A;">
|
| 146 |
<h1 style="font-size: 2rem; font-weight: 700; color: #FF6B4A; margin: 0;">TinySQL</h1>
|
| 147 |
<p style="color: #999; font-size: 0.95rem; margin-top: 0.25rem;">Mechanistic Interpretability for Text-to-SQL</p>
|
| 148 |
</div>
|
|
|
|
| 161 |
gr.HTML("""
|
| 162 |
<div style="border-radius: 12px; padding: 1.5rem; margin: 2rem auto; max-width: 900px; background: #2A2A2A;">
|
| 163 |
<div style="font-weight: 700; color: #FF6B4A; margin-bottom: 1rem; font-size: 1.1rem; text-align: center;">Cite Our Work</div>
|
| 164 |
+
<div class="citation-content" style="background: #2A2A2A; padding: 1rem; border-radius: 8px;">
|
| 165 |
+
<pre style="font-family: 'Monaco', monospace; font-size: 0.85rem; overflow-x: auto; background: #1A1A1A; color: #D0D0D0; margin: 0; padding: 1rem; border-radius: 6px;">@misc{harrasse2025tinysqlprogressivetexttosqldataset,
|
| 166 |
title={TinySQL: A Progressive Text-to-SQL Dataset for Mechanistic Interpretability Research},
|
| 167 |
author={Abir Harrasse and Philip Quirke and Clement Neo and Dhruv Nathawani and Luke Marks and Amir Abdullah},
|
| 168 |
year={2025},
|
|
|
|
| 176 |
""")
|
| 177 |
|
| 178 |
gr.HTML("""
|
| 179 |
+
<div style="text-align: center; padding: 2rem 0; margin-top: 3rem; background: #0A0A0A;">
|
| 180 |
+
<p style="font-size: 0.85rem; margin-top: 1rem; color: #999;">
|
| 181 |
<a href="https://arxiv.org/abs/2503.12730" style="color: #FF6B4A;">Paper</a> •
|
| 182 |
<a href="https://github.com/withmartian/TinySQL" style="color: #FF6B4A;">Code</a> •
|
| 183 |
<a href="https://huggingface.co/collections/withmartian/tinysql-6760e92748b63fa56a6ffc9f" style="color: #FF6B4A;">Dataset</a>
|