File tree Expand file tree Collapse file tree 5 files changed +44
-8
lines changed Expand file tree Collapse file tree 5 files changed +44
-8
lines changed Original file line number Diff line number Diff line change 84
84
appSettings :
85
85
hf_model_name : *model-name
86
86
hf_model_instruction : " You are a helpful AI assistant. Please response appropriately."
87
+ # Use local system fonts by default to avoid GDPR issues
88
+ # with Gradio's defaults fonts which require fetching from
89
+ # the Google fonts API. To restore default Gradio theme
90
+ # fonts, remove the font and font-mono keys.
91
+ theme_params :
92
+ font :
93
+ - sans-serif
94
+ - Arial
95
+ font_mono :
96
+ - sans-serif
97
+ - Arial
87
98
# Container image config
88
99
image :
89
100
repository : ghcr.io/stackhpc/azimuth-llm-ui-base
Original file line number Diff line number Diff line change 2
2
from pydantic import Field , HttpUrl
3
3
from pydantic_settings import BaseSettings , SettingsConfigDict
4
4
5
- from typing import Optional
5
+ from typing import Optional , Union , List
6
6
7
7
8
8
def get_k8s_namespace ():
@@ -52,7 +52,7 @@ class AppSettings(BaseSettings):
52
52
# Variables explicitly passed to gradio.theme.Default()
53
53
# For example:
54
54
# {"primary_hue": "red"}
55
- theme_params : dict [str , str ] = Field (default_factory = dict )
55
+ theme_params : dict [str , Union [ str , List [ str ]] ] = Field (default_factory = dict )
56
56
# Overrides for theme.body_background_fill property
57
57
theme_background_colour : Optional [str ] = Field (default = None )
58
58
# Custom page title colour override passed as CSS
Original file line number Diff line number Diff line change 1
- backend_url : http://128.232.226.230
2
- hf_model_name : tiiuae/falcon-7b
1
+ backend_url : http://localhost:8081
2
+ hf_model_name : ise-uiuc/Magicoder-S-DS-6.7B
3
3
4
- hf_model_instruction : You are a helpful and cheerful AI assistant. Please respond appropriately.
4
+ # model_instruction: You are a helpful and cheerful AI assistant. Please respond appropriately.
5
+
6
+ page_description : " [Privacy statement](https://google.com)"
5
7
6
8
# UI theming tweaks
7
9
# theme_title_colour: white
8
10
# theme_background_colour: "#00376c"
9
- # theme_params:
10
- # primary_hue: blue
11
+ theme_params :
12
+ # primary_hue: blue
13
+ font :
14
+ - sans-serif
15
+ font_mono :
16
+ - sans-serif
11
17
12
18
# llm_max_tokens:
13
19
# llm_temperature:
Original file line number Diff line number Diff line change @@ -3,4 +3,7 @@ FROM python:3.11-slim
3
3
ENV GRADIO_SERVER_PORT=7680
4
4
5
5
COPY requirements.txt requirements.txt
6
- RUN pip install --no-cache-dir -r requirements.txt
6
+ RUN pip install --no-cache-dir -r requirements.txt
7
+
8
+ COPY purge-google-fonts.sh purge-google-fonts.sh
9
+ RUN bash purge-google-fonts.sh
Original file line number Diff line number Diff line change
1
+
2
+ SOURCE_CODE_PATH=/usr/local/lib/python3.11/site-packages/gradio/
3
+
4
+ # Strip out preconnect directives from HTML <link> tags
5
+ find $SOURCE_CODE_PATH -name " *.html" -type f -exec sed -i s! ' rel="preconnect"' !! g {} \;
6
+
7
+ # Replace hard-coded links in HTML templates with something harmless but identifiable
8
+ declare -a LINKS=(
9
+ " https://fonts.gstatic.com"
10
+ " https://fonts.googleapis.com"
11
+ " https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/.*/iframeResizer.contentWindow.min.js"
12
+ )
13
+ REPLACEMENT=" external-url-removed-for-gdpr-compliance"
14
+ for item in " ${LINKS[@]} " ; do
15
+ find $SOURCE_CODE_PATH -name " *.html" -type f -exec sed -i s! $item ! $REPLACEMENT ! g {} \;
16
+ done
You can’t perform that action at this time.
0 commit comments