Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,17 @@ torch.set_num_threads(2)
|
|
18 |
openrouter_key = os.environ.get("OPENROUTER_KEY")
|
19 |
model = EmbeddingModel(use_quantized_onnx_model=True)
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
# Configure logging
|
22 |
logging.basicConfig(level=logging.ERROR, format='%(asctime)s - %(levelname)s - %(message)s')
|
23 |
|
@@ -175,6 +186,23 @@ async def predict(message, history):
|
|
175 |
except Exception:
|
176 |
pass
|
177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
gr.ChatInterface(
|
179 |
predict,
|
180 |
title="Live Web Chat",
|
@@ -185,6 +213,7 @@ gr.ChatInterface(
|
|
185 |
'What is the current sentiment of the Brazil election?',
|
186 |
'Compare the current economies of China & India',
|
187 |
'What are the new design trends in 2024',
|
188 |
-
|
189 |
-
|
|
|
190 |
).launch()
|
|
|
18 |
openrouter_key = os.environ.get("OPENROUTER_KEY")
|
19 |
model = EmbeddingModel(use_quantized_onnx_model=True)
|
20 |
|
21 |
+
|
22 |
+
# Define a custom theme
|
23 |
+
custom_theme = gr.themes.Default(
|
24 |
+
primary_hue="#3498db", # Custom primary color
|
25 |
+
secondary_hue="#2ecc71", # Custom secondary color
|
26 |
+
font="Roboto", # Custom font
|
27 |
+
font_size="16px", # Custom font size
|
28 |
+
rounded_corners=True, # Enable rounded corners
|
29 |
+
background_color="#f0f0f0", # Custom background color
|
30 |
+
)
|
31 |
+
|
32 |
# Configure logging
|
33 |
logging.basicConfig(level=logging.ERROR, format='%(asctime)s - %(levelname)s - %(message)s')
|
34 |
|
|
|
186 |
except Exception:
|
187 |
pass
|
188 |
|
189 |
+
|
190 |
+
# Define a custom theme
|
191 |
+
custom_theme = gr.themes.Default(
|
192 |
+
primary_hue="#3498db", # Custom primary color
|
193 |
+
secondary_hue="#2ecc71", # Custom secondary color
|
194 |
+
font="Roboto", # Custom font
|
195 |
+
font_size="16px", # Custom font size
|
196 |
+
rounded_corners=True, # Enable rounded corners
|
197 |
+
background_color="#f0f0f0", # Custom background color
|
198 |
+
)
|
199 |
+
|
200 |
+
def predict(message, history):
|
201 |
+
# Your predict function implementation
|
202 |
+
pass
|
203 |
+
|
204 |
+
|
205 |
+
# Apply the custom theme to the Gradio interface
|
206 |
gr.ChatInterface(
|
207 |
predict,
|
208 |
title="Live Web Chat",
|
|
|
213 |
'What is the current sentiment of the Brazil election?',
|
214 |
'Compare the current economies of China & India',
|
215 |
'What are the new design trends in 2024',
|
216 |
+
],
|
217 |
+
theme=custom_theme # Apply the custom theme
|
218 |
+
).launch()
|
219 |
).launch()
|