Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,7 +30,7 @@ def get_travel_guide_response(message, history):
|
|
| 30 |
"Content-Type": "application/json"
|
| 31 |
}
|
| 32 |
data = {
|
| 33 |
-
"model": "
|
| 34 |
"messages": conversation,
|
| 35 |
"max_tokens": 500
|
| 36 |
}
|
|
@@ -91,6 +91,28 @@ with gr.Blocks(theme=theme, css=custom_css) as iface:
|
|
| 91 |
)
|
| 92 |
clear.click(lambda: None, None, chatbot, queue=False)
|
| 93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
# Launch the interface
|
| 95 |
iface.launch()
|
| 96 |
|
|
|
|
| 30 |
"Content-Type": "application/json"
|
| 31 |
}
|
| 32 |
data = {
|
| 33 |
+
"model": "mixtral-8x7b-32768",
|
| 34 |
"messages": conversation,
|
| 35 |
"max_tokens": 500
|
| 36 |
}
|
|
|
|
| 91 |
)
|
| 92 |
clear.click(lambda: None, None, chatbot, queue=False)
|
| 93 |
|
| 94 |
+
# Add dark mode toggle
|
| 95 |
+
with gr.Row():
|
| 96 |
+
dark_mode = gr.Checkbox(label="Dark Mode", value=False)
|
| 97 |
+
|
| 98 |
+
def toggle_dark_mode(dark):
|
| 99 |
+
if dark:
|
| 100 |
+
return gr.themes.Default(primary_hue="blue", neutral_hue="slate", text_size="lg").set(
|
| 101 |
+
body_background_fill="*neutral_900",
|
| 102 |
+
block_background_fill="*neutral_800",
|
| 103 |
+
button_primary_background_fill="*primary_600",
|
| 104 |
+
button_primary_background_fill_dark="*primary_700",
|
| 105 |
+
)
|
| 106 |
+
else:
|
| 107 |
+
return gr.themes.Default(primary_hue="blue", neutral_hue="slate", text_size="lg").set(
|
| 108 |
+
body_background_fill="*neutral_50",
|
| 109 |
+
block_background_fill="*neutral_100",
|
| 110 |
+
button_primary_background_fill="*primary_500",
|
| 111 |
+
button_primary_background_fill_dark="*primary_600",
|
| 112 |
+
)
|
| 113 |
+
|
| 114 |
+
dark_mode.change(toggle_dark_mode, dark_mode, None)
|
| 115 |
+
|
| 116 |
# Launch the interface
|
| 117 |
iface.launch()
|
| 118 |
|