Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -102,45 +102,140 @@ class GradioInterface:
|
|
102 |
def __init__(self, prompt_refiner: PromptRefiner):
|
103 |
self.prompt_refiner = prompt_refiner
|
104 |
custom_css = """
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
|
145 |
with gr.Blocks(css=custom_css, theme=gr.themes.Default()) as self.interface:
|
146 |
with gr.Column(elem_classes=["container", "title-container"]):
|
|
|
102 |
def __init__(self, prompt_refiner: PromptRefiner):
|
103 |
self.prompt_refiner = prompt_refiner
|
104 |
custom_css = """
|
105 |
+
/* Main containers and borders */
|
106 |
+
.container {
|
107 |
+
border: 2px solid #2196F3;
|
108 |
+
border-radius: 10px;
|
109 |
+
padding: 20px;
|
110 |
+
margin: 15px;
|
111 |
+
background: white;
|
112 |
+
position: relative;
|
113 |
+
}
|
114 |
+
|
115 |
+
/* Container labels */
|
116 |
+
.container::before {
|
117 |
+
position: absolute;
|
118 |
+
top: -12px;
|
119 |
+
left: 20px;
|
120 |
+
background: white;
|
121 |
+
padding: 0 10px;
|
122 |
+
color: #2196F3;
|
123 |
+
font-weight: bold;
|
124 |
+
font-size: 1.2em;
|
125 |
+
}
|
126 |
+
|
127 |
+
/* Remove all Gradio default styles */
|
128 |
+
.gradio-container {
|
129 |
+
border: none !important;
|
130 |
+
background: none !important;
|
131 |
+
}
|
132 |
+
|
133 |
+
/* Remove backgrounds and borders from inputs */
|
134 |
+
.no-background > div:first-child {
|
135 |
+
border: none !important;
|
136 |
+
background: transparent !important;
|
137 |
+
box-shadow: none !important;
|
138 |
+
}
|
139 |
+
|
140 |
+
/* Title styling */
|
141 |
+
h1 {
|
142 |
+
color: #2196F3 !important;
|
143 |
+
font-size: 2.5em !important;
|
144 |
+
font-weight: bold !important;
|
145 |
+
margin-bottom: 0.5em !important;
|
146 |
+
text-align: center !important;
|
147 |
+
}
|
148 |
+
|
149 |
+
h3 {
|
150 |
+
color: #666 !important;
|
151 |
+
font-size: 1.2em !important;
|
152 |
+
text-align: center !important;
|
153 |
+
margin-bottom: 1em !important;
|
154 |
+
}
|
155 |
+
|
156 |
+
/* Container labels */
|
157 |
+
.title-container::before { content: ''; }
|
158 |
+
.input-container::before { content: 'PROMPT REFINEMENT'; }
|
159 |
+
.analysis-container::before { content: 'ANALYSIS & REFINEMENT'; }
|
160 |
+
.model-container::before { content: 'MODEL APPLICATION'; }
|
161 |
+
.results-container::before { content: 'RESULTS'; }
|
162 |
+
.examples-container::before { content: 'EXAMPLES'; }
|
163 |
+
|
164 |
+
/* Radio button group */
|
165 |
+
.radio-group {
|
166 |
+
display: flex;
|
167 |
+
gap: 10px;
|
168 |
+
margin: 10px 0;
|
169 |
+
}
|
170 |
+
|
171 |
+
/* Remove default Gradio container styles */
|
172 |
+
.gradio-container {
|
173 |
+
border: none !important;
|
174 |
+
}
|
175 |
+
|
176 |
+
/* Remove input container borders */
|
177 |
+
.input-container div,
|
178 |
+
.input-container textarea,
|
179 |
+
.input-container input {
|
180 |
+
border: none !important;
|
181 |
+
box-shadow: none !important;
|
182 |
+
}
|
183 |
+
|
184 |
+
/* Remove textbox container borders */
|
185 |
+
.textbox-container {
|
186 |
+
border: none !important;
|
187 |
+
box-shadow: none !important;
|
188 |
+
}
|
189 |
+
|
190 |
+
/* Remove focus outlines */
|
191 |
+
*:focus {
|
192 |
+
outline: none !important;
|
193 |
+
box-shadow: none !important;
|
194 |
+
}
|
195 |
+
|
196 |
+
/* Remove nested container borders */
|
197 |
+
.container .gradio-container,
|
198 |
+
.container .gradio-container > div {
|
199 |
+
border: none !important;
|
200 |
+
box-shadow: none !important;
|
201 |
+
}
|
202 |
+
|
203 |
+
/* Target specific Gradio elements */
|
204 |
+
.gr-box,
|
205 |
+
.gr-form,
|
206 |
+
.gr-input,
|
207 |
+
.gr-panel {
|
208 |
+
border: none !important;
|
209 |
+
box-shadow: none !important;
|
210 |
+
}
|
211 |
+
|
212 |
+
/* Remove any remaining borders */
|
213 |
+
.container * {
|
214 |
+
border-color: transparent !important;
|
215 |
+
}
|
216 |
+
|
217 |
+
/* Markdown text styling */
|
218 |
+
.markdown {
|
219 |
+
font-size: 1em !important;
|
220 |
+
line-height: 1.6 !important;
|
221 |
+
color: #333 !important;
|
222 |
+
}
|
223 |
+
|
224 |
+
/* Button styling */
|
225 |
+
button {
|
226 |
+
background: #2196F3 !important;
|
227 |
+
color: white !important;
|
228 |
+
border: none !important;
|
229 |
+
border-radius: 5px !important;
|
230 |
+
padding: 10px 20px !important;
|
231 |
+
cursor: pointer !important;
|
232 |
+
transition: background 0.3s !important;
|
233 |
+
}
|
234 |
+
|
235 |
+
button:hover {
|
236 |
+
background: #1976D2 !important;
|
237 |
+
}
|
238 |
+
"""
|
239 |
|
240 |
with gr.Blocks(css=custom_css, theme=gr.themes.Default()) as self.interface:
|
241 |
with gr.Column(elem_classes=["container", "title-container"]):
|