ghostai1 commited on
Commit
540a829
·
verified ·
1 Parent(s): 95471fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -23
app.py CHANGED
@@ -39,7 +39,7 @@ def chatbot_response(user_feedback, chat_history):
39
  ))
40
  return chat_history, ""
41
 
42
- # Custom CSS for a dark grey, minimalist UI
43
  custom_css = """
44
  body, .gradio-container {
45
  background: #2d2d2d !important;
@@ -112,25 +112,6 @@ h1, h2, h3 {
112
  color: #b3b3b3 !important;
113
  font-weight: 600;
114
  }
115
- .loading {
116
- display: flex;
117
- justify-content: center;
118
- align-items: center;
119
- height: 100px;
120
- }
121
- .loading::after {
122
- content: '';
123
- width: 24px;
124
- height: 24px;
125
- border: 4px solid #6b6b6b;
126
- border-top: 4px solid transparent;
127
- border-radius: 50%;
128
- animation: spin 1s linear infinite;
129
- }
130
- @keyframes spin {
131
- 0% { transform: rotate(0deg); }
132
- 100% { transform: rotate(360deg); }
133
- }
134
  @media (max-width: 768px) {
135
  .gradio-container {
136
  padding: 10px;
@@ -190,7 +171,7 @@ with gr.Blocks(css=custom_css) as demo:
190
  fn=analyze_sentiment,
191
  inputs=sentiment_input,
192
  outputs=sentiment_output,
193
- _js="() => { document.querySelector('.loading').style.display = 'block'; setTimeout(() => document.querySelector('.loading').style.display = 'none', 1000); }"
194
  )
195
 
196
  # Text-to-Image Tab
@@ -219,7 +200,7 @@ with gr.Blocks(css=custom_css) as demo:
219
  fn=generate_mock_image,
220
  inputs=image_prompt,
221
  outputs=image_output,
222
- _js="() => { document.querySelector('.loading').style.display = 'block'; setTimeout(() => document.querySelector('.loading').style.display = 'none', 1000); }"
223
  )
224
 
225
  # Chatbot Tab
@@ -248,7 +229,7 @@ with gr.Blocks(css=custom_css) as demo:
248
  fn=chatbot_response,
249
  inputs=[feedback_input, chatbot],
250
  outputs=[chatbot, feedback_output],
251
- _js="() => { document.querySelector('.loading').style.display = 'block'; setTimeout(() => document.querySelector('.loading').style.display = 'none', 500); }"
252
  )
253
 
254
  # Launch the app
 
39
  ))
40
  return chat_history, ""
41
 
42
+ # Custom CSS for dark grey, minimalist UI
43
  custom_css = """
44
  body, .gradio-container {
45
  background: #2d2d2d !important;
 
112
  color: #b3b3b3 !important;
113
  font-weight: 600;
114
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  @media (max-width: 768px) {
116
  .gradio-container {
117
  padding: 10px;
 
171
  fn=analyze_sentiment,
172
  inputs=sentiment_input,
173
  outputs=sentiment_output,
174
+ show_progress=True
175
  )
176
 
177
  # Text-to-Image Tab
 
200
  fn=generate_mock_image,
201
  inputs=image_prompt,
202
  outputs=image_output,
203
+ show_progress=True
204
  )
205
 
206
  # Chatbot Tab
 
229
  fn=chatbot_response,
230
  inputs=[feedback_input, chatbot],
231
  outputs=[chatbot, feedback_output],
232
+ show_progress=True
233
  )
234
 
235
  # Launch the app