mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-06 23:23:43 +00:00
Load js and css sources in UTF-8 (#7059)
This commit is contained in:
parent
4cf39120fc
commit
bc921c66e5
2 changed files with 15 additions and 14 deletions
|
|
@ -39,15 +39,16 @@ def minify_css(css: str) -> str:
|
|||
return css
|
||||
|
||||
|
||||
with open(Path(__file__).resolve().parent / '../css/html_readable_style.css', 'r') as f:
|
||||
with open(Path(__file__).resolve().parent / '../css/html_readable_style.css', 'r', encoding='utf-8') as f:
|
||||
readable_css = f.read()
|
||||
with open(Path(__file__).resolve().parent / '../css/html_instruct_style.css', 'r') as f:
|
||||
with open(Path(__file__).resolve().parent / '../css/html_instruct_style.css', 'r', encoding='utf-8') as f:
|
||||
instruct_css = f.read()
|
||||
|
||||
# Custom chat styles
|
||||
chat_styles = {}
|
||||
for k in get_available_chat_styles():
|
||||
chat_styles[k] = open(Path(f'css/chat_style-{k}.css'), 'r').read()
|
||||
with open(Path(f'css/chat_style-{k}.css'), 'r', encoding='utf-8') as f:
|
||||
chat_styles[k] = f.read()
|
||||
|
||||
# Handle styles that derive from other styles
|
||||
for k in chat_styles:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue