Spaces:
Runtime error
Runtime error
added file to upload theme
Browse files- .gitignore +1 -0
- app.py +3 -0
- theme_upload.py +46 -0
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
venv/
|
app.py
CHANGED
@@ -6,6 +6,9 @@ from gradio.themes.utils.theme_dropdown import create_theme_dropdown
|
|
6 |
dropdown, js = create_theme_dropdown()
|
7 |
|
8 |
with gr.Blocks(theme='trimble/trimble_ai_theme') as demo:
|
|
|
|
|
|
|
9 |
with gr.Row(equal_height=True):
|
10 |
with gr.Column(scale=10):
|
11 |
gr.Markdown(
|
|
|
6 |
dropdown, js = create_theme_dropdown()
|
7 |
|
8 |
with gr.Blocks(theme='trimble/trimble_ai_theme') as demo:
|
9 |
+
|
10 |
+
gr.HTML("<img src=\"https://huggingface.co/spaces/trimble/trimble_ai_theme/resolve/main/images/logo.png\">")
|
11 |
+
|
12 |
with gr.Row(equal_height=True):
|
13 |
with gr.Column(scale=10):
|
14 |
gr.Markdown(
|
theme_upload.py
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import argparse
|
3 |
+
|
4 |
+
|
5 |
+
# Call file with incremented version number and hf access token
|
6 |
+
parser = argparse.ArgumentParser()
|
7 |
+
parser.add_argument("-version")
|
8 |
+
parser.add_argument("-token")
|
9 |
+
args = parser.parse_args()
|
10 |
+
|
11 |
+
|
12 |
+
# Gradio theme
|
13 |
+
theme = gr.themes.Base(
|
14 |
+
primary_hue=gr.themes.Color(c50="#217cbb", c100="#217cbb", c200="#217cbb", c300="#217cbb", c400="#217cbb", c500="#0063a3", c600="#0063a3", c700="#0063a3", c800="#0e416c", c900="#0e416c", c950="#0e416c"),
|
15 |
+
secondary_hue=gr.themes.Color(c50="#fec157", c100="#fec157", c200="#fec157", c300="#fec157", c400="#fec157", c500="#fbad26", c600="#fbad26", c700="#fbad26", c800="#e49325", c900="#e49325", c950="#e49325"),
|
16 |
+
neutral_hue=gr.themes.Color(c50="#f1f1f6", c100="#f1f1f6", c200="#b7b9c3", c300="#a3a6b1", c400="#90939f", c500="#7d808d", c600="#6a6e79", c700="#585c65", c800="#454b52", c900="#353a40", c950="#24292d"),
|
17 |
+
).set(
|
18 |
+
button_secondary_background_fill="#0063a3",
|
19 |
+
button_secondary_background_fill_hover="#004f83",
|
20 |
+
button_secondary_text_color="#ffffff",
|
21 |
+
button_secondary_background_fill_dark="#0063a3",
|
22 |
+
button_secondary_background_fill_hover_dark="#004f83",
|
23 |
+
button_secondary_text_color_dark="#ffffff",
|
24 |
+
button_primary_background_fill="#fbad26",
|
25 |
+
button_primary_background_fill_hover="#e49325",
|
26 |
+
button_primary_text_color="#ffffff",
|
27 |
+
button_primary_background_fill_dark="#fbad26",
|
28 |
+
button_primary_background_fill_hover_dark="#e49325",
|
29 |
+
button_primary_text_color_dark="#ffffff",
|
30 |
+
checkbox_label_text_color="#ffffff",
|
31 |
+
checkbox_label_text_color_dark="#ffffff",
|
32 |
+
slider_color="#0063a3",
|
33 |
+
slider_color_dark="#0063a3"
|
34 |
+
)
|
35 |
+
|
36 |
+
theme.push_to_hub(
|
37 |
+
repo_name = 'trimble_ai_theme',
|
38 |
+
org_name = 'trimble',
|
39 |
+
version = args.version,
|
40 |
+
hf_token = args.token
|
41 |
+
)
|
42 |
+
|
43 |
+
|
44 |
+
# code to manually generation theme json file
|
45 |
+
#filename = "theme_schema@{}.json".format(args.version)
|
46 |
+
#theme.dump(filename)
|