File tree Expand file tree Collapse file tree 3 files changed +16
-17
lines changed Expand file tree Collapse file tree 3 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -127,17 +127,6 @@ def inference(latest_message, history):
127
127
if settings .theme_background_colour :
128
128
theme .body_background_fill = settings .theme_background_colour
129
129
130
- css_overrides = ""
131
- if settings .theme_title_colour :
132
- css_overrides += """
133
- h1 {{
134
- color: {0};
135
- padding-top: 0.5em;
136
- }}
137
- """ .format (
138
- settings .theme_title_colour
139
- )
140
-
141
130
142
131
def inference_wrapper (* args ):
143
132
"""
@@ -171,12 +160,14 @@ def inference_wrapper(*args):
171
160
scale = 7 ,
172
161
),
173
162
title = settings .page_title ,
163
+ description = settings .page_description ,
174
164
retry_btn = "Retry" ,
175
165
undo_btn = "Undo" ,
176
166
clear_btn = "Clear" ,
177
167
analytics_enabled = False ,
178
168
theme = theme ,
179
- css = css_overrides ,
169
+ css = settings .css_overrides ,
170
+ js = settings .custom_javascript ,
180
171
) as app :
181
172
logger .debug ("Gradio chat interface config: %s" , app .config )
182
173
# For running locally in tilt dev setup
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ class AppSettings(BaseSettings):
33
33
default_factory = lambda : f"http://llm-backend.{ get_k8s_namespace ()} .svc"
34
34
)
35
35
page_title : str = Field (default = "Large Language Model" )
36
+ page_description : Optional [str ] = Field (default = None )
36
37
hf_model_instruction : str = Field (
37
38
default = "You are a helpful and cheerful AI assistant. Please respond appropriately."
38
39
)
@@ -55,8 +56,10 @@ class AppSettings(BaseSettings):
55
56
theme_params : dict [str , Union [str , List [str ]]] = Field (default_factory = dict )
56
57
# Overrides for theme.body_background_fill property
57
58
theme_background_colour : Optional [str ] = Field (default = None )
58
- # Custom page title colour override passed as CSS
59
- theme_title_colour : Optional [str ] = Field (default = None )
59
+ # Provides arbitrary CSS and JS overrides to the UI,
60
+ # see https://www.gradio.app/guides/custom-CSS-and-JS
61
+ css_overrides : Optional [str ] = Field (default = None )
62
+ custom_javascript : Optional [str ] = Field (default = None )
60
63
61
64
# Method for loading settings file
62
65
@staticmethod
Original file line number Diff line number Diff line change @@ -3,18 +3,23 @@ hf_model_name: ise-uiuc/Magicoder-S-DS-6.7B
3
3
4
4
# model_instruction: You are a helpful and cheerful AI assistant. Please respond appropriately.
5
5
6
- page_description : " [Privacy statement ](https://google.com)"
6
+ page_description : " [Custom Markdown ](https://google.com)"
7
7
8
8
# UI theming tweaks
9
- # theme_title_colour: white
10
- # theme_background_colour: "#00376c"
9
+ theme_background_colour : " #00376c"
11
10
theme_params :
12
11
# primary_hue: blue
13
12
font :
14
13
- sans-serif
15
14
font_mono :
16
15
- sans-serif
17
16
17
+ css_overrides : |
18
+ h1 {
19
+ color: white;
20
+ padding-top: 1em;
21
+ }
22
+
18
23
# llm_max_tokens:
19
24
# llm_temperature:
20
25
# llm_top_p:
You can’t perform that action at this time.
0 commit comments