update app
Browse files
app.py
CHANGED
|
@@ -16,27 +16,27 @@ from gradio.themes.utils import colors, fonts, sizes
|
|
| 16 |
import rerun as rr
|
| 17 |
from gradio_rerun import Rerun
|
| 18 |
|
| 19 |
-
colors.
|
| 20 |
-
name="
|
| 21 |
-
c50="#
|
| 22 |
-
c100="#
|
| 23 |
-
c200="#
|
| 24 |
-
c300="#
|
| 25 |
-
c400="#
|
| 26 |
-
c500="#
|
| 27 |
-
c600="#
|
| 28 |
-
c700="#
|
| 29 |
-
c800="#
|
| 30 |
-
c900="#
|
| 31 |
-
c950="#
|
| 32 |
)
|
| 33 |
|
| 34 |
-
class
|
| 35 |
def __init__(
|
| 36 |
self,
|
| 37 |
*,
|
| 38 |
primary_hue: colors.Color | str = colors.gray,
|
| 39 |
-
secondary_hue: colors.Color | str = colors.
|
| 40 |
neutral_hue: colors.Color | str = colors.slate,
|
| 41 |
text_size: sizes.Size | str = sizes.text_lg,
|
| 42 |
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
|
@@ -57,7 +57,7 @@ class DeepSkyBlueTheme(Soft):
|
|
| 57 |
super().set(
|
| 58 |
background_fill_primary="*primary_50",
|
| 59 |
background_fill_primary_dark="*primary_900",
|
| 60 |
-
body_background_fill="linear-gradient(135deg, *
|
| 61 |
body_background_fill_dark="linear-gradient(135deg, *primary_900, *primary_800)",
|
| 62 |
button_primary_text_color="white",
|
| 63 |
button_primary_text_color_hover="white",
|
|
@@ -82,7 +82,7 @@ class DeepSkyBlueTheme(Soft):
|
|
| 82 |
block_label_background_fill="*primary_200",
|
| 83 |
)
|
| 84 |
|
| 85 |
-
|
| 86 |
|
| 87 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 88 |
|
|
@@ -267,7 +267,7 @@ css="""
|
|
| 267 |
margin: 0 auto;
|
| 268 |
max-width: 980px;
|
| 269 |
}
|
| 270 |
-
#main-title h1 {font-size: 2.
|
| 271 |
"""
|
| 272 |
|
| 273 |
with gr.Blocks() as demo:
|
|
@@ -328,4 +328,4 @@ with gr.Blocks() as demo:
|
|
| 328 |
)
|
| 329 |
|
| 330 |
if __name__ == "__main__":
|
| 331 |
-
demo.queue(max_size=30).launch(css=css, theme=
|
|
|
|
| 16 |
import rerun as rr
|
| 17 |
from gradio_rerun import Rerun
|
| 18 |
|
| 19 |
+
colors.orange_red = colors.Color(
|
| 20 |
+
name="orange_red",
|
| 21 |
+
c50="#FFF0E5",
|
| 22 |
+
c100="#FFE0CC",
|
| 23 |
+
c200="#FFC299",
|
| 24 |
+
c300="#FFA366",
|
| 25 |
+
c400="#FF8533",
|
| 26 |
+
c500="#FF4500",
|
| 27 |
+
c600="#E63E00",
|
| 28 |
+
c700="#CC3700",
|
| 29 |
+
c800="#B33000",
|
| 30 |
+
c900="#992900",
|
| 31 |
+
c950="#802200",
|
| 32 |
)
|
| 33 |
|
| 34 |
+
class OrangeRedTheme(Soft):
|
| 35 |
def __init__(
|
| 36 |
self,
|
| 37 |
*,
|
| 38 |
primary_hue: colors.Color | str = colors.gray,
|
| 39 |
+
secondary_hue: colors.Color | str = colors.orange_red,
|
| 40 |
neutral_hue: colors.Color | str = colors.slate,
|
| 41 |
text_size: sizes.Size | str = sizes.text_lg,
|
| 42 |
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
|
|
|
| 57 |
super().set(
|
| 58 |
background_fill_primary="*primary_50",
|
| 59 |
background_fill_primary_dark="*primary_900",
|
| 60 |
+
body_background_fill="linear-gradient(135deg, *primary_200, *primary_100)",
|
| 61 |
body_background_fill_dark="linear-gradient(135deg, *primary_900, *primary_800)",
|
| 62 |
button_primary_text_color="white",
|
| 63 |
button_primary_text_color_hover="white",
|
|
|
|
| 82 |
block_label_background_fill="*primary_200",
|
| 83 |
)
|
| 84 |
|
| 85 |
+
orange_red_theme = OrangeRedTheme()
|
| 86 |
|
| 87 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 88 |
|
|
|
|
| 267 |
margin: 0 auto;
|
| 268 |
max-width: 980px;
|
| 269 |
}
|
| 270 |
+
#main-title h1 {font-size: 2.2em !important;}
|
| 271 |
"""
|
| 272 |
|
| 273 |
with gr.Blocks() as demo:
|
|
|
|
| 328 |
)
|
| 329 |
|
| 330 |
if __name__ == "__main__":
|
| 331 |
+
demo.queue(max_size=30).launch(css=css, theme=orange_red_theme, mcp_server=True, ssr_mode=False, show_error=True)
|