escc commited on
Commit
37223cd
·
verified ·
1 Parent(s): b332e70

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -33,12 +33,13 @@ def respond(q, history):
33
  return chat([{"role": "system", "content": SYSTEM}] + hist + [{"role": "user", "content": ctx(sq) + "\n\nQuestion: " + q}])
34
 
35
  css = ".gradio-container { --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }"
36
- theme = gr.themes.Base().set( # matches the site's embed CSS
37
  body_background_fill="#ffffff", body_text_color="#000000", body_text_color_subdued="#5b7fa6",
38
- background_fill_primary="#ffffff", background_fill_secondary="#f6f9fc", block_background_fill="#ffffff",
39
  border_color_primary="#c9dcee", block_border_color="#c9dcee", input_border_color="#c9dcee", input_border_color_focus="#0466C8",
40
- color_accent="#0466C8", color_accent_soft="#eaf4fd", link_text_color="#0466C8",
41
- button_primary_background_fill="#0466C8", button_primary_background_fill_hover="#2f9ce8", button_primary_text_color="#ffffff",
 
42
  block_radius="8px", input_radius="6px", button_large_radius="6px", button_small_radius="6px")
43
 
44
  gr.ChatInterface(respond, title="Eco", description="Questions about nature, climate and the environment.").launch(theme=theme, css=css)
 
33
  return chat([{"role": "system", "content": SYSTEM}] + hist + [{"role": "user", "content": ctx(sq) + "\n\nQuestion: " + q}])
34
 
35
  css = ".gradio-container { --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }"
36
+ c = dict( # the site's embed colours, used in both light and dark mode so visitors always see them
37
  body_background_fill="#ffffff", body_text_color="#000000", body_text_color_subdued="#5b7fa6",
38
+ background_fill_primary="#ffffff", background_fill_secondary="#f6f9fc", block_background_fill="#ffffff", input_background_fill="#ffffff",
39
  border_color_primary="#c9dcee", block_border_color="#c9dcee", input_border_color="#c9dcee", input_border_color_focus="#0466C8",
40
+ border_color_accent_subdued="#c9dcee", color_accent="#0466C8", color_accent_soft="#eaf4fd", link_text_color="#0466C8",
41
+ button_primary_background_fill="#0466C8", button_primary_background_fill_hover="#2f9ce8", button_primary_text_color="#ffffff")
42
+ theme = gr.themes.Base().set(**c, **{k + "_dark": v for k, v in c.items() if k != "color_accent"},
43
  block_radius="8px", input_radius="6px", button_large_radius="6px", button_small_radius="6px")
44
 
45
  gr.ChatInterface(respond, title="Eco", description="Questions about nature, climate and the environment.").launch(theme=theme, css=css)