Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,100 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
import subprocess
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
folder_path = 'src/server'
|
| 6 |
file_name = 'main.cs'
|
|
@@ -36,5 +130,5 @@ def compile(cs):
|
|
| 36 |
|
| 37 |
return 'ha'
|
| 38 |
|
| 39 |
-
demo = gr.Interface(fn=compile, inputs="text", outputs="text")
|
| 40 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
import subprocess
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
from typing import Iterable
|
| 7 |
+
|
| 8 |
+
from gradio.themes.base import Base
|
| 9 |
+
from gradio.themes.utils import colors, fonts, sizes
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class Monochrome(Base):
|
| 13 |
+
def __init__(
|
| 14 |
+
self,
|
| 15 |
+
*,
|
| 16 |
+
primary_hue: colors.Color | str = colors.neutral,
|
| 17 |
+
secondary_hue: colors.Color | str = colors.neutral,
|
| 18 |
+
neutral_hue: colors.Color | str = colors.neutral,
|
| 19 |
+
spacing_size: sizes.Size | str = sizes.spacing_lg,
|
| 20 |
+
radius_size: sizes.Size | str = sizes.radius_none,
|
| 21 |
+
text_size: sizes.Size | str = sizes.text_md,
|
| 22 |
+
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
| 23 |
+
fonts.GoogleFont("Quicksand"),
|
| 24 |
+
"ui-sans-serif",
|
| 25 |
+
"system-ui",
|
| 26 |
+
"sans-serif",
|
| 27 |
+
),
|
| 28 |
+
font_mono: fonts.Font | str | Iterable[fonts.Font | str] = (
|
| 29 |
+
fonts.GoogleFont("IBM Plex Mono"),
|
| 30 |
+
"ui-monospace",
|
| 31 |
+
"Consolas",
|
| 32 |
+
"monospace",
|
| 33 |
+
),
|
| 34 |
+
):
|
| 35 |
+
super().__init__(
|
| 36 |
+
primary_hue=primary_hue,
|
| 37 |
+
secondary_hue=secondary_hue,
|
| 38 |
+
neutral_hue=neutral_hue,
|
| 39 |
+
spacing_size=spacing_size,
|
| 40 |
+
radius_size=radius_size,
|
| 41 |
+
text_size=text_size,
|
| 42 |
+
font=font,
|
| 43 |
+
font_mono=font_mono,
|
| 44 |
+
)
|
| 45 |
+
self.name = "monochrome"
|
| 46 |
+
super().set(
|
| 47 |
+
# Colors
|
| 48 |
+
slider_color="*neutral_900",
|
| 49 |
+
slider_color_dark="*neutral_500",
|
| 50 |
+
accordion_text_color="*body_text_color",
|
| 51 |
+
accordion_text_color_dark="*body_text_color",
|
| 52 |
+
table_text_color="*body_text_color",
|
| 53 |
+
table_text_color_dark="*body_text_color",
|
| 54 |
+
body_text_color="*neutral_900",
|
| 55 |
+
block_label_text_color="*body_text_color",
|
| 56 |
+
block_title_text_color="*body_text_color",
|
| 57 |
+
body_text_color_subdued="*neutral_700",
|
| 58 |
+
background_fill_primary_dark="*neutral_900",
|
| 59 |
+
background_fill_secondary_dark="*neutral_800",
|
| 60 |
+
block_background_fill_dark="*neutral_800",
|
| 61 |
+
input_background_fill_dark="*neutral_700",
|
| 62 |
+
# Button Colors
|
| 63 |
+
button_primary_background_fill="*neutral_900",
|
| 64 |
+
button_primary_background_fill_hover="*neutral_700",
|
| 65 |
+
button_primary_text_color="white",
|
| 66 |
+
button_primary_background_fill_dark="*neutral_600",
|
| 67 |
+
button_primary_background_fill_hover_dark="*neutral_600",
|
| 68 |
+
button_primary_text_color_dark="white",
|
| 69 |
+
button_secondary_background_fill="*button_primary_background_fill",
|
| 70 |
+
button_secondary_background_fill_hover="*button_primary_background_fill_hover",
|
| 71 |
+
button_secondary_text_color="*button_primary_text_color",
|
| 72 |
+
button_cancel_background_fill="*button_primary_background_fill",
|
| 73 |
+
button_cancel_background_fill_hover="*button_primary_background_fill_hover",
|
| 74 |
+
button_cancel_text_color="*button_primary_text_color",
|
| 75 |
+
checkbox_label_background_fill="*button_primary_background_fill",
|
| 76 |
+
checkbox_label_background_fill_hover="*button_primary_background_fill_hover",
|
| 77 |
+
checkbox_label_text_color="*button_primary_text_color",
|
| 78 |
+
checkbox_background_color_selected="*neutral_600",
|
| 79 |
+
checkbox_background_color_dark="*neutral_700",
|
| 80 |
+
checkbox_background_color_selected_dark="*neutral_700",
|
| 81 |
+
checkbox_border_color_selected_dark="*neutral_800",
|
| 82 |
+
# Padding
|
| 83 |
+
checkbox_label_padding="*spacing_md",
|
| 84 |
+
button_large_padding="*spacing_lg",
|
| 85 |
+
button_small_padding="*spacing_sm",
|
| 86 |
+
# Borders
|
| 87 |
+
block_border_width="0px",
|
| 88 |
+
block_border_width_dark="1px",
|
| 89 |
+
shadow_drop_lg="0 1px 4px 0 rgb(0 0 0 / 0.1)",
|
| 90 |
+
block_shadow="*shadow_drop_lg",
|
| 91 |
+
block_shadow_dark="none",
|
| 92 |
+
# Block Labels
|
| 93 |
+
block_title_text_weight="600",
|
| 94 |
+
block_label_text_weight="600",
|
| 95 |
+
block_label_text_size="*text_md",
|
| 96 |
+
)
|
| 97 |
+
|
| 98 |
|
| 99 |
folder_path = 'src/server'
|
| 100 |
file_name = 'main.cs'
|
|
|
|
| 130 |
|
| 131 |
return 'ha'
|
| 132 |
|
| 133 |
+
demo = gr.Interface(fn=compile, inputs="text", outputs="text", theme=Monochrome())
|
| 134 |
demo.launch()
|