Upload app.py
Browse files
app.py
CHANGED
|
@@ -33,13 +33,17 @@ 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 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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)
|
|
|
|
| 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 |
+
keys = ["body_background_fill", "body_text_color", "body_text_color_subdued", "background_fill_primary", "background_fill_secondary",
|
| 37 |
+
"block_background_fill", "input_background_fill", "border_color_primary", "block_border_color", "input_border_color",
|
| 38 |
+
"input_border_color_focus", "border_color_accent_subdued", "color_accent_soft", "link_text_color", "block_label_text_color",
|
| 39 |
+
"button_primary_background_fill", "button_secondary_background_fill", "button_primary_background_fill_hover",
|
| 40 |
+
"button_secondary_background_fill_hover", "button_primary_text_color", "button_secondary_text_color"]
|
| 41 |
+
# light: the site's white / light-blue / black embeds; dark: black with white text and blue accents
|
| 42 |
+
light = ["#ffffff", "#000000", "#5b7fa6", "#ffffff", "#f6f9fc", "#ffffff", "#ffffff", "#c9dcee", "#c9dcee", "#c9dcee",
|
| 43 |
+
"#0466C8", "#c9dcee", "#eaf4fd", "#0466C8", "#0466C8", "#0466C8", "#0466C8", "#2f9ce8", "#2f9ce8", "#ffffff", "#ffffff"]
|
| 44 |
+
dark = ["#000000", "#ffffff", "#8fb8e0", "#000000", "#0a1420", "#000000", "#0a1420", "#1f3b5c", "#1f3b5c", "#1f3b5c",
|
| 45 |
+
"#5aa4e8", "#1f3b5c", "#0b2a4a", "#5aa4e8", "#5aa4e8", "#0466C8", "#0466C8", "#2f9ce8", "#2f9ce8", "#ffffff", "#ffffff"]
|
| 46 |
+
theme = gr.themes.Base().set(**dict(zip(keys, light)), **{k + "_dark": v for k, v in zip(keys, dark)}, color_accent="#0466C8",
|
| 47 |
block_radius="8px", input_radius="6px", button_large_radius="6px", button_small_radius="6px")
|
| 48 |
|
| 49 |
gr.ChatInterface(respond, title="Eco", description="Questions about nature, climate and the environment.").launch(theme=theme, css=css)
|