DazDin commited on
Commit
4721043
·
verified ·
1 Parent(s): b17d346
Files changed (1) hide show
  1. app.py +22 -42
app.py CHANGED
@@ -3,15 +3,13 @@ from random import randint
3
  from all_models import models
4
  from datetime import datetime
5
 
6
- now2 = 0
7
-
8
  def get_current_time():
9
  now = datetime.now()
10
  now2 = now
11
  current_time = now2.strftime("%Y-%m-%d %H:%M:%S")
12
  ki = f'{current_time}'
13
  return ki
14
-
15
  def load_fn(models):
16
  global models_load
17
  models_load = {}
@@ -74,34 +72,32 @@ def make_me():
74
  gr.HTML("")
75
 
76
  custom_css = """
77
- /* General Styles */
 
 
78
  body {
79
- background-color: #364a5f;
80
- color: #364a5f;
81
  margin: 0;
82
  padding: 0;
83
  font-family: Arial, sans-serif;
84
  height: 100vh;
85
  overflow-y: auto;
86
  }
87
-
88
- /* Container Styles */
89
  .gradio-container {
90
- background-color: #364a5f;
91
  color: #c5c6c7;
92
  padding: 20px;
93
  border-radius: 8px;
94
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
95
  width: 100%;
96
  max-width: 1200px;
97
- margin: 20px auto; /* Center the container horizontally */
98
- display: block; /* Ensure it's a block element */
99
- min-height: 100vh; /* Adjust the height of the container */
100
  }
101
-
102
- /* Header Styles */
103
  .app_title {
104
- background-color: #364a5f;
105
  color: #c5c6c7;
106
  padding: 10px 20px;
107
  border-bottom: 1px solid #3b4252;
@@ -110,10 +106,8 @@ body {
110
  font-weight: bold;
111
  width: 100%;
112
  box-sizing: border-box;
113
- margin-bottom: 20px; /* Add margin to separate the header from content */
114
  }
115
-
116
- /* Textbox Styles */
117
  .custom_textbox {
118
  background-color: #2d343f;
119
  border: 1px solid #3b4252;
@@ -124,8 +118,6 @@ body {
124
  width: 100%;
125
  box-sizing: border-box;
126
  }
127
-
128
- /* Button Styles */
129
  .custom_gen_button {
130
  background-color: #8b38ff;
131
  border: 1px solid #ffffff;
@@ -164,8 +156,6 @@ body {
164
  transform: translateY(-2px);
165
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
166
  }
167
-
168
- /* Image Styles */
169
  .custom_image {
170
  border: 1px solid #3b4252;
171
  background-color: #2d343f;
@@ -174,50 +164,42 @@ body {
174
  max-width: 100%;
175
  box-sizing: border-box;
176
  }
177
-
178
- /* Accordion Styles */
179
  .custom_accordion {
180
- background-color: #364a5f;
181
  color: #7f8184;
182
  border: 1px solid #3b4252;
183
  border-radius: 4px;
184
  margin-top: 20px;
185
  width: 100%;
186
  box-sizing: border-box;
187
- transition: margin 0.2s ease; /* Smooth transition for margin */
188
  }
189
-
190
  .custom_accordion .gr-accordion-header {
191
- background-color: #364a5f;
192
  color: #7f8184;
193
  padding: 10px 20px;
194
  border-bottom: 1px solid #5b6270;
195
  cursor: pointer;
196
  font-size: 18px;
197
  font-weight: bold;
198
- height: 40px; /* Fixed height for the header */
199
  display: flex;
200
  align-items: center;
201
  }
202
-
203
  .custom_accordion .gr-accordion-header:hover {
204
- background-color: #364a5f;
205
  }
206
-
207
  .custom_accordion .gr-accordion-content {
208
  padding: 10px 20px;
209
- background-color: #364a5f;
210
  border-top: 1px solid #5b6270;
211
- max-height: 0; /* Start with no height */
212
  overflow: hidden;
213
- transition: max-height 0.2s ease; /* Smooth transition for height */
214
  }
215
-
216
  .custom_accordion .gr-accordion-content.open {
217
- max-height: 500px; /* Set a reasonable max height */
218
  }
219
-
220
- /* Checkbox Group Styles */
221
  .custom_checkbox_group {
222
  background-color: #2d343f;
223
  border: 1px solid #3b4252;
@@ -227,8 +209,6 @@ body {
227
  width: 100%;
228
  box-sizing: border-box;
229
  }
230
-
231
- /* Responsive Design */
232
  @media (max-width: 768px) {
233
  .gradio-container {
234
  width: 100%;
@@ -245,5 +225,5 @@ body {
245
  with gr.Blocks(css=custom_css) as demo:
246
  make_me()
247
 
248
- demo.queue(concurrency_count=200)
249
  demo.launch()
 
3
  from all_models import models
4
  from datetime import datetime
5
 
 
 
6
  def get_current_time():
7
  now = datetime.now()
8
  now2 = now
9
  current_time = now2.strftime("%Y-%m-%d %H:%M:%S")
10
  ki = f'{current_time}'
11
  return ki
12
+
13
  def load_fn(models):
14
  global models_load
15
  models_load = {}
 
72
  gr.HTML("")
73
 
74
  custom_css = """
75
+ :root {
76
+ --body-background-fill: #2d3d4f;
77
+ }
78
  body {
79
+ background-color: var(--body-background-fill) !important;
80
+ color: #2d3d4f;
81
  margin: 0;
82
  padding: 0;
83
  font-family: Arial, sans-serif;
84
  height: 100vh;
85
  overflow-y: auto;
86
  }
 
 
87
  .gradio-container {
88
+ background-color: #2d3d4f;
89
  color: #c5c6c7;
90
  padding: 20px;
91
  border-radius: 8px;
92
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
93
  width: 100%;
94
  max-width: 1200px;
95
+ margin: 20px auto;
96
+ display: block;
97
+ min-height: 100vh;
98
  }
 
 
99
  .app_title {
100
+ background-color: #2d3d4f;
101
  color: #c5c6c7;
102
  padding: 10px 20px;
103
  border-bottom: 1px solid #3b4252;
 
106
  font-weight: bold;
107
  width: 100%;
108
  box-sizing: border-box;
109
+ margin-bottom: 20px;
110
  }
 
 
111
  .custom_textbox {
112
  background-color: #2d343f;
113
  border: 1px solid #3b4252;
 
118
  width: 100%;
119
  box-sizing: border-box;
120
  }
 
 
121
  .custom_gen_button {
122
  background-color: #8b38ff;
123
  border: 1px solid #ffffff;
 
156
  transform: translateY(-2px);
157
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
158
  }
 
 
159
  .custom_image {
160
  border: 1px solid #3b4252;
161
  background-color: #2d343f;
 
164
  max-width: 100%;
165
  box-sizing: border-box;
166
  }
 
 
167
  .custom_accordion {
168
+ background-color: #2d3d4f;
169
  color: #7f8184;
170
  border: 1px solid #3b4252;
171
  border-radius: 4px;
172
  margin-top: 20px;
173
  width: 100%;
174
  box-sizing: border-box;
175
+ transition: margin 0.2s ease;
176
  }
 
177
  .custom_accordion .gr-accordion-header {
178
+ background-color: #2d3d4f;
179
  color: #7f8184;
180
  padding: 10px 20px;
181
  border-bottom: 1px solid #5b6270;
182
  cursor: pointer;
183
  font-size: 18px;
184
  font-weight: bold;
185
+ height: 40px;
186
  display: flex;
187
  align-items: center;
188
  }
 
189
  .custom_accordion .gr-accordion-header:hover {
190
+ background-color: #2d3d4f;
191
  }
 
192
  .custom_accordion .gr-accordion-content {
193
  padding: 10px 20px;
194
+ background-color: #2d3d4f;
195
  border-top: 1px solid #5b6270;
196
+ max-height: 0;
197
  overflow: hidden;
198
+ transition: max-height 0.2s ease;
199
  }
 
200
  .custom_accordion .gr-accordion-content.open {
201
+ max-height: 500px;
202
  }
 
 
203
  .custom_checkbox_group {
204
  background-color: #2d343f;
205
  border: 1px solid #3b4252;
 
209
  width: 100%;
210
  box-sizing: border-box;
211
  }
 
 
212
  @media (max-width: 768px) {
213
  .gradio-container {
214
  width: 100%;
 
225
  with gr.Blocks(css=custom_css) as demo:
226
  make_me()
227
 
228
+ demo.queue(concurrency_count=100)
229
  demo.launch()