Update app.py
Browse files
app.py
CHANGED
@@ -62,7 +62,7 @@ def chatbot(input_text, image, openai_api_key, reasoning_effort, model_choice, h
|
|
62 |
def clear_history():
|
63 |
return "", []
|
64 |
|
65 |
-
# Custom CSS styles with animations
|
66 |
custom_css = """
|
67 |
/* General body styles */
|
68 |
.gradio-container {
|
@@ -111,46 +111,22 @@ custom_css = """
|
|
111 |
border-color: #007bff;
|
112 |
}
|
113 |
/* Button styles */
|
114 |
-
|
115 |
-
|
116 |
-
background-color: #00aaff; /* Sky blue */
|
117 |
-
color: white;
|
118 |
-
border: none;
|
119 |
-
border-radius: 8px;
|
120 |
-
padding: 8px 15px; /* Smaller button size */
|
121 |
-
font-size: 1rem; /* Smaller font size */
|
122 |
-
cursor: pointer;
|
123 |
-
transition: all 0.3s ease;
|
124 |
-
width: auto;
|
125 |
-
margin-top: 10px;
|
126 |
-
}
|
127 |
-
#submit-btn:hover {
|
128 |
-
background-color: #0099cc; /* Slightly darker blue */
|
129 |
-
}
|
130 |
-
#submit-btn:active {
|
131 |
-
transform: scale(0.95);
|
132 |
-
}
|
133 |
-
|
134 |
-
/* Clear History Button: Light Red */
|
135 |
-
#clear-history {
|
136 |
-
background-color: #f5a4a4; /* Light red */
|
137 |
color: white;
|
138 |
border: none;
|
139 |
border-radius: 8px;
|
140 |
-
padding:
|
141 |
-
font-size: 1rem;
|
142 |
cursor: pointer;
|
143 |
transition: all 0.3s ease;
|
144 |
-
width: auto;
|
145 |
-
margin-top: 10px;
|
146 |
}
|
147 |
-
|
148 |
-
background-color: #
|
149 |
}
|
150 |
-
|
151 |
transform: scale(0.95);
|
152 |
}
|
153 |
-
|
154 |
/* Chat history styles */
|
155 |
.gradio-chatbot .message {
|
156 |
margin-bottom: 10px;
|
@@ -172,7 +148,14 @@ custom_css = """
|
|
172 |
margin-left: auto;
|
173 |
animation: slideInAssistant 0.5s ease-out;
|
174 |
}
|
175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
/* Animation keyframes */
|
177 |
@keyframes fadeIn {
|
178 |
0% { opacity: 0; }
|
@@ -233,8 +216,8 @@ def create_interface():
|
|
233 |
choices=["o1", "o3-mini"],
|
234 |
value="o1" # Default to 'o1' for image-related tasks
|
235 |
)
|
236 |
-
submit_btn = gr.Button("Send"
|
237 |
-
clear_btn = gr.Button("Clear History"
|
238 |
|
239 |
chat_history = gr.Chatbot()
|
240 |
|
|
|
62 |
def clear_history():
|
63 |
return "", []
|
64 |
|
65 |
+
# Custom CSS styles with animations
|
66 |
custom_css = """
|
67 |
/* General body styles */
|
68 |
.gradio-container {
|
|
|
111 |
border-color: #007bff;
|
112 |
}
|
113 |
/* Button styles */
|
114 |
+
.gradio-button {
|
115 |
+
background-color: #007bff;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
color: white;
|
117 |
border: none;
|
118 |
border-radius: 8px;
|
119 |
+
padding: 12px 20px;
|
120 |
+
font-size: 1.1rem;
|
121 |
cursor: pointer;
|
122 |
transition: all 0.3s ease;
|
|
|
|
|
123 |
}
|
124 |
+
.gradio-button:hover {
|
125 |
+
background-color: #0056b3;
|
126 |
}
|
127 |
+
.gradio-button:active {
|
128 |
transform: scale(0.95);
|
129 |
}
|
|
|
130 |
/* Chat history styles */
|
131 |
.gradio-chatbot .message {
|
132 |
margin-bottom: 10px;
|
|
|
148 |
margin-left: auto;
|
149 |
animation: slideInAssistant 0.5s ease-out;
|
150 |
}
|
151 |
+
/* Clear button style */
|
152 |
+
.gradio-button.clear-history {
|
153 |
+
background-color: #dc3545;
|
154 |
+
margin-left: 10px;
|
155 |
+
}
|
156 |
+
.gradio-button.clear-history:hover {
|
157 |
+
background-color: #c82333;
|
158 |
+
}
|
159 |
/* Animation keyframes */
|
160 |
@keyframes fadeIn {
|
161 |
0% { opacity: 0; }
|
|
|
216 |
choices=["o1", "o3-mini"],
|
217 |
value="o1" # Default to 'o1' for image-related tasks
|
218 |
)
|
219 |
+
submit_btn = gr.Button("Send")
|
220 |
+
clear_btn = gr.Button("Clear History") # No class_name argument
|
221 |
|
222 |
chat_history = gr.Chatbot()
|
223 |
|