Spaces:
Runtime error
Runtime error
JunchuanYu
commited on
Commit
·
5258a5e
1
Parent(s):
16eb92e
Update app.py
Browse files
app.py
CHANGED
@@ -14,15 +14,74 @@ if my_api_key == "empty":
|
|
14 |
|
15 |
gr.Chatbot.postprocess = postprocess
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
history = gr.State([])
|
27 |
token_count = gr.State([])
|
28 |
promptTemplates = gr.State(load_template(get_template_names(plain=True)[0], mode=2))
|
|
|
14 |
|
15 |
gr.Chatbot.postprocess = postprocess
|
16 |
|
17 |
+
|
18 |
+
with open("custom.css", "r", encoding="utf-8") as f:
|
19 |
+
customCSS = f.read()
|
20 |
+
|
21 |
+
with gr.Blocks(
|
22 |
+
css=customCSS,
|
23 |
+
theme=gr.themes.Soft(
|
24 |
+
primary_hue=gr.themes.Color(
|
25 |
+
c50="#02C160",
|
26 |
+
c100="rgba(2, 193, 96, 0.2)",
|
27 |
+
c200="#02C160",
|
28 |
+
c300="rgba(2, 193, 96, 0.32)",
|
29 |
+
c400="rgba(2, 193, 96, 0.32)",
|
30 |
+
c500="rgba(2, 193, 96, 1.0)",
|
31 |
+
c600="rgba(2, 193, 96, 1.0)",
|
32 |
+
c700="rgba(2, 193, 96, 0.32)",
|
33 |
+
c800="rgba(2, 193, 96, 0.32)",
|
34 |
+
c900="#02C160",
|
35 |
+
c950="#02C160",
|
36 |
+
),
|
37 |
+
secondary_hue=gr.themes.Color(
|
38 |
+
c50="#576b95",
|
39 |
+
c100="#576b95",
|
40 |
+
c200="#576b95",
|
41 |
+
c300="#576b95",
|
42 |
+
c400="#576b95",
|
43 |
+
c500="#576b95",
|
44 |
+
c600="#576b95",
|
45 |
+
c700="#576b95",
|
46 |
+
c800="#576b95",
|
47 |
+
c900="#576b95",
|
48 |
+
c950="#576b95",
|
49 |
+
),
|
50 |
+
neutral_hue=gr.themes.Color(
|
51 |
+
name="gray",
|
52 |
+
c50="#f9fafb",
|
53 |
+
c100="#f3f4f6",
|
54 |
+
c200="#e5e7eb",
|
55 |
+
c300="#d1d5db",
|
56 |
+
c400="#B2B2B2",
|
57 |
+
c500="#808080",
|
58 |
+
c600="#636363",
|
59 |
+
c700="#515151",
|
60 |
+
c800="#393939",
|
61 |
+
c900="#272727",
|
62 |
+
c950="#171717",
|
63 |
+
),
|
64 |
+
radius_size=gr.themes.sizes.radius_sm,
|
65 |
+
).set(
|
66 |
+
button_primary_background_fill="#06AE56",
|
67 |
+
button_primary_background_fill_dark="#06AE56",
|
68 |
+
button_primary_background_fill_hover="#07C863",
|
69 |
+
button_primary_border_color="#06AE56",
|
70 |
+
button_primary_border_color_dark="#06AE56",
|
71 |
+
button_primary_text_color="#FFFFFF",
|
72 |
+
button_primary_text_color_dark="#FFFFFF",
|
73 |
+
button_secondary_background_fill="#F2F2F2",
|
74 |
+
button_secondary_background_fill_dark="#2B2B2B",
|
75 |
+
button_secondary_text_color="#393939",
|
76 |
+
button_secondary_text_color_dark="#FFFFFF",
|
77 |
+
# background_fill_primary="#F7F7F7",
|
78 |
+
# background_fill_primary_dark="#1F1F1F",
|
79 |
+
block_title_text_color="*primary_500",
|
80 |
+
block_title_background_fill="*primary_100",
|
81 |
+
input_background_fill="#F6F6F6",
|
82 |
+
),
|
83 |
+
) as demo:
|
84 |
+
|
85 |
history = gr.State([])
|
86 |
token_count = gr.State([])
|
87 |
promptTemplates = gr.State(load_template(get_template_names(plain=True)[0], mode=2))
|