Match example fills to button labels; lock container width; round logo corners
Browse files
app.py
CHANGED
|
@@ -129,9 +129,19 @@ html, body, gradio-app, [class*="gradio-container"] {
|
|
| 129 |
background: #f5f9ff !important;
|
| 130 |
}
|
| 131 |
|
| 132 |
-
/* The Space iframe wraps Gradio in <gradio-app>; force it to
|
| 133 |
-
|
|
|
|
|
|
|
| 134 |
display: block !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
margin-left: auto !important;
|
| 136 |
margin-right: auto !important;
|
| 137 |
}
|
|
@@ -139,11 +149,45 @@ gradio-app, gradio-app > .gradio-container, gradio-app > div {
|
|
| 139 |
[class*="gradio-container"] {
|
| 140 |
max-width: 1480px !important;
|
| 141 |
width: 92vw !important;
|
|
|
|
| 142 |
margin-left: auto !important;
|
| 143 |
margin-right: auto !important;
|
| 144 |
padding-left: 28px !important;
|
| 145 |
padding-right: 28px !important;
|
| 146 |
color: #0f2744;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
}
|
| 148 |
|
| 149 |
/* Some Gradio builds wrap the app in `.main` or `.app`; center those too. */
|
|
@@ -166,17 +210,20 @@ gradio-app, gradio-app > .gradio-container, gradio-app > div {
|
|
| 166 |
.banner-logo-image,
|
| 167 |
.banner-logo-image .image-container,
|
| 168 |
.banner-logo-image .image-frame,
|
| 169 |
-
.banner-logo-image > div
|
|
|
|
| 170 |
background: transparent !important;
|
| 171 |
border: none !important;
|
| 172 |
box-shadow: none !important;
|
|
|
|
|
|
|
| 173 |
}
|
| 174 |
.banner-logo-image img {
|
| 175 |
width: 100%;
|
| 176 |
max-width: 360px;
|
| 177 |
height: auto;
|
| 178 |
object-fit: contain;
|
| 179 |
-
border-radius:
|
| 180 |
background: transparent !important;
|
| 181 |
border: none !important;
|
| 182 |
box-shadow: none !important;
|
|
@@ -947,17 +994,17 @@ with gr.Blocks(
|
|
| 947 |
outputs=[answer, trace],
|
| 948 |
)
|
| 949 |
ex1_btn.click(
|
| 950 |
-
fn=lambda: "Plan a 2-day
|
| 951 |
inputs=[],
|
| 952 |
outputs=[question],
|
| 953 |
)
|
| 954 |
ex2_btn.click(
|
| 955 |
-
fn=lambda: "
|
| 956 |
inputs=[],
|
| 957 |
outputs=[question],
|
| 958 |
)
|
| 959 |
ex3_btn.click(
|
| 960 |
-
fn=lambda: "
|
| 961 |
inputs=[],
|
| 962 |
outputs=[question],
|
| 963 |
)
|
|
|
|
| 129 |
background: #f5f9ff !important;
|
| 130 |
}
|
| 131 |
|
| 132 |
+
/* The Space iframe wraps Gradio in <gradio-app>; force it to fill viewport so the
|
| 133 |
+
container width never depends on inner content (otherwise Code/Markdown content
|
| 134 |
+
will visibly resize the whole page after the first answer arrives). */
|
| 135 |
+
gradio-app {
|
| 136 |
display: block !important;
|
| 137 |
+
width: 100% !important;
|
| 138 |
+
margin-left: auto !important;
|
| 139 |
+
margin-right: auto !important;
|
| 140 |
+
}
|
| 141 |
+
gradio-app > .gradio-container,
|
| 142 |
+
gradio-app > div {
|
| 143 |
+
display: block !important;
|
| 144 |
+
width: 100% !important;
|
| 145 |
margin-left: auto !important;
|
| 146 |
margin-right: auto !important;
|
| 147 |
}
|
|
|
|
| 149 |
[class*="gradio-container"] {
|
| 150 |
max-width: 1480px !important;
|
| 151 |
width: 92vw !important;
|
| 152 |
+
min-width: 0 !important;
|
| 153 |
margin-left: auto !important;
|
| 154 |
margin-right: auto !important;
|
| 155 |
padding-left: 28px !important;
|
| 156 |
padding-right: 28px !important;
|
| 157 |
color: #0f2744;
|
| 158 |
+
box-sizing: border-box !important;
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
/* Lock the inner two-column row so the right panel doesn't shrink before content
|
| 162 |
+
arrives, then snap back when results appear. */
|
| 163 |
+
[class*="gradio-container"] .layout-gap {
|
| 164 |
+
width: 100% !important;
|
| 165 |
+
}
|
| 166 |
+
[class*="gradio-container"] .layout-gap > .gr-column {
|
| 167 |
+
min-width: 0 !important;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
/* Prevent Code / Markdown from pushing the page wider than the container. */
|
| 171 |
+
[class*="gradio-container"] .codemirror-wrapper,
|
| 172 |
+
[class*="gradio-container"] .cm-editor,
|
| 173 |
+
[class*="gradio-container"] .cm-scroller {
|
| 174 |
+
max-width: 100% !important;
|
| 175 |
+
overflow-x: auto !important;
|
| 176 |
+
}
|
| 177 |
+
[class*="gradio-container"] .gradio-markdown,
|
| 178 |
+
[class*="gradio-container"] .gradio-code,
|
| 179 |
+
[class*="gradio-container"] .prose,
|
| 180 |
+
[class*="gradio-container"] .markdown,
|
| 181 |
+
[class*="gradio-container"] [data-testid="markdown"] {
|
| 182 |
+
max-width: 100% !important;
|
| 183 |
+
word-wrap: break-word !important;
|
| 184 |
+
overflow-wrap: anywhere !important;
|
| 185 |
+
}
|
| 186 |
+
[class*="gradio-container"] .prose pre,
|
| 187 |
+
[class*="gradio-container"] .markdown pre {
|
| 188 |
+
max-width: 100% !important;
|
| 189 |
+
overflow-x: auto !important;
|
| 190 |
+
white-space: pre-wrap !important;
|
| 191 |
}
|
| 192 |
|
| 193 |
/* Some Gradio builds wrap the app in `.main` or `.app`; center those too. */
|
|
|
|
| 210 |
.banner-logo-image,
|
| 211 |
.banner-logo-image .image-container,
|
| 212 |
.banner-logo-image .image-frame,
|
| 213 |
+
.banner-logo-image > div,
|
| 214 |
+
.banner-logo-image button {
|
| 215 |
background: transparent !important;
|
| 216 |
border: none !important;
|
| 217 |
box-shadow: none !important;
|
| 218 |
+
border-radius: 18px !important;
|
| 219 |
+
overflow: hidden !important;
|
| 220 |
}
|
| 221 |
.banner-logo-image img {
|
| 222 |
width: 100%;
|
| 223 |
max-width: 360px;
|
| 224 |
height: auto;
|
| 225 |
object-fit: contain;
|
| 226 |
+
border-radius: 18px !important;
|
| 227 |
background: transparent !important;
|
| 228 |
border: none !important;
|
| 229 |
box-shadow: none !important;
|
|
|
|
| 994 |
outputs=[answer, trace],
|
| 995 |
)
|
| 996 |
ex1_btn.click(
|
| 997 |
+
fn=lambda: "Plan a 2-day Tokyo trip under $250 with trade-offs.",
|
| 998 |
inputs=[],
|
| 999 |
outputs=[question],
|
| 1000 |
)
|
| 1001 |
ex2_btn.click(
|
| 1002 |
+
fn=lambda: "Compare 3 open-source coding agents with pros/cons.",
|
| 1003 |
inputs=[],
|
| 1004 |
outputs=[question],
|
| 1005 |
)
|
| 1006 |
ex3_btn.click(
|
| 1007 |
+
fn=lambda: "RAG vs fine-tuning for legal QA: which and why?",
|
| 1008 |
inputs=[],
|
| 1009 |
outputs=[question],
|
| 1010 |
)
|