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