Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
@@ -16,267 +16,17 @@ css = """
|
|
16 |
.title { font-size: 3em; align-items: center; text-align: center; }
|
17 |
.info { align-items: center; text-align: center; }
|
18 |
.block.result { margin: 1em 0; padding: 1em; box-shadow: 0 0 3px 3px #664422, 0 0 3px 2px #664422 inset; border-radius: 6px; background: #665544; }
|
19 |
-
|
20 |
-
.block.result p,
|
21 |
-
.block.result .prose,
|
22 |
-
.block-result * {
|
23 |
-
color: aquamarine;
|
24 |
-
font-family: "Atma", monospace !important;
|
25 |
-
font-size: 1.06em;
|
26 |
-
letter-spacing: 0.50px;
|
27 |
-
word-spacing: 6px;
|
28 |
-
}
|
29 |
-
/* I know that I use a lot of !important instruction..
|
30 |
-
Yeah, I know it's not really properly recommended to use !important instruction when writing CSS rules ..
|
31 |
-
But it's because that Gradio interface use also a custom css-theme in gr.Blocks() from: "NoCrypt/miku@>=1.2.2"
|
32 |
-
And all my !important instructions are for avoiding to get unexpected superceeded by that "NoCrypt/miku@>=1.2.2" css theme skin...
|
33 |
-
No more, no less!
|
34 |
-
*/
|
35 |
-
.setting_tag::before {
|
36 |
-
content: "::";
|
37 |
-
font-family: system-ui, monospace !important;
|
38 |
-
font-size: 1.2em !important;
|
39 |
-
color: #736819 !important;
|
40 |
-
font-weight: bold;
|
41 |
-
display: block;
|
42 |
-
text-align: center !important;
|
43 |
-
margin: 0 auto !important;
|
44 |
-
}
|
45 |
-
.setting_tag {
|
46 |
-
margin-top: 1em !important;
|
47 |
-
font-size: 1.4em !important;
|
48 |
-
color: darkgoldenrod !important;
|
49 |
-
padding: 10px !important;
|
50 |
-
font-weight: normal !important;
|
51 |
-
border: 2px dotted gold !important;
|
52 |
-
background: white !important;
|
53 |
-
word-break: break-word !important;
|
54 |
-
display: block;
|
55 |
-
text-align: center !important;
|
56 |
-
margin: 0 auto !important;
|
57 |
-
text-shadow: 1px 1px 1px gold !important;
|
58 |
-
}
|
59 |
-
.setting_tag::after {
|
60 |
-
content: "::";
|
61 |
-
font-family: system-ui, monospace !important;
|
62 |
-
font-size: 1.2em !important;
|
63 |
-
color: #736819 !important;
|
64 |
-
font-weight: bold !important;
|
65 |
-
display: block !important;
|
66 |
-
text-align: center !important;
|
67 |
-
margin: 0 auto !important;
|
68 |
-
}
|
69 |
-
a.linkify_1,
|
70 |
-
a.linkify_1:focus,
|
71 |
-
a.linkify_1:visited {
|
72 |
-
color: red !important;
|
73 |
-
text-decoration: underline !important;
|
74 |
-
}
|
75 |
-
a.linkify_1:active,
|
76 |
-
a.linkify_1:hover {
|
77 |
-
color: darkred !important;
|
78 |
-
text-decoration: overline !important;
|
79 |
-
}
|
80 |
-
.details_info_block_expanded_override {
|
81 |
-
font-size: 0.95em !important;
|
82 |
-
color: grey !important;
|
83 |
-
padding: 10px !important;
|
84 |
-
font-weight: bold;
|
85 |
-
border: none !important;
|
86 |
-
box-shadow: 1px 1px 2px 3px whitesmoke, 3px 2px 1px 1px grey !important;
|
87 |
-
background: whitesmoke !important;
|
88 |
-
word-break: break-word !important;
|
89 |
-
}
|
90 |
-
.details_info_block {
|
91 |
-
font-size: 0.95em !important;
|
92 |
-
color: grey !important;
|
93 |
-
padding: 10px !important;
|
94 |
-
font-weight: bold;
|
95 |
-
border: none !important;
|
96 |
-
box-shadow: 1px 1px 2px 3px whitesmoke, 3px 2px 1px 1px grey !important;
|
97 |
-
background: whitesmoke !important;
|
98 |
-
word-break: break-word !important;
|
99 |
-
height: initial !important;
|
100 |
-
max-height: initial !important;
|
101 |
-
overflow: auto !important;
|
102 |
-
}
|
103 |
-
.details_info_block[is-expanded="False"]::before {
|
104 |
-
content: "(double-click to expand help...)";
|
105 |
-
user-select: none;
|
106 |
-
cursor: pointer;
|
107 |
-
font-family: "Atma" !important;
|
108 |
-
font-weight: 500 !important;
|
109 |
-
letter-spacing: 2px !important;
|
110 |
-
word-spacing: 5px !important;
|
111 |
-
color: darkmagenta !important;
|
112 |
-
display: inline-block !important;
|
113 |
-
font-size: 0.99em !important;
|
114 |
-
background: whitesmoke !important;
|
115 |
-
padding: 10px !important;
|
116 |
-
border: 2px solid black !important;
|
117 |
-
}
|
118 |
-
.details_info_block[is-expanded="False"] {
|
119 |
-
transition: 1.2s all;
|
120 |
-
height: 80px !important;
|
121 |
-
max-height: 80px !important;
|
122 |
-
overflow: hidden !important;
|
123 |
-
}
|
124 |
-
.details_info_block[is-expanded="True"]::before {
|
125 |
-
content: "(double-click to reduce help...)";
|
126 |
-
user-select: none;
|
127 |
-
cursor: pointer;
|
128 |
-
font-family: "Atma" !important;
|
129 |
-
font-weight: 500 !important;
|
130 |
-
letter-spacing: 2px !important;
|
131 |
-
word-spacing: 5px !important;
|
132 |
-
color: white !important;
|
133 |
-
display: block !important;
|
134 |
-
font-size: 0.99em !important;
|
135 |
-
background: #1c9e5c !important;
|
136 |
-
padding: 10px !important;
|
137 |
-
border: 2px solid black !important;
|
138 |
-
border-radius: 0px !important;
|
139 |
-
margin-bottom: 1em !important;
|
140 |
-
}
|
141 |
-
.details_info_block[is-expanded="True"] {
|
142 |
-
transition: 1.2s all;
|
143 |
-
height: initial !important;
|
144 |
-
max-height: initial !important;
|
145 |
-
overflow: auto !important;
|
146 |
-
margin-bottom: 1em !important;
|
147 |
-
}
|
148 |
-
.em_warning {
|
149 |
-
font-family: "Atma", system-ui !important;
|
150 |
-
font-weight: 400 !important;
|
151 |
-
font-style: normal !important;
|
152 |
-
font-size: 1.3em !important;
|
153 |
-
word-spacing: 3.2px !important;
|
154 |
-
color: orangered !important;
|
155 |
-
}
|
156 |
-
.spanify_safetensors_base_model {
|
157 |
-
font-family: "Nunito", system-ui, monospace !important;
|
158 |
-
font-weight: 600;
|
159 |
-
color: green !important;
|
160 |
-
}
|
161 |
-
.spanify_safetensors_checkpoint_model {
|
162 |
-
font-family: "Nunito", system-ui, monospace !important;
|
163 |
-
font-weight: 600;
|
164 |
-
color: orange !important;
|
165 |
-
}
|
166 |
-
.spanify_vae_model {
|
167 |
-
font-family: "Nunito", system-ui, monospace !important;
|
168 |
-
font-weight: 600;
|
169 |
-
color: deeppink !important;
|
170 |
-
}
|
171 |
-
.spanify_lora_checkpoint_model {
|
172 |
-
font-family: "Nunito", system-ui, monospace !important;
|
173 |
-
font-weight: 600;
|
174 |
-
color: #8c627b !important;
|
175 |
-
}
|
176 |
-
.spanify_other_model {
|
177 |
-
font-family: "Nunito", system-ui, monospace !important;
|
178 |
-
font-weight: 600;
|
179 |
-
color: silver !important;
|
180 |
-
}
|
181 |
-
.setting_tag_as_mini {
|
182 |
-
font-family: "Nunito", serif !important;
|
183 |
-
font-optical-sizing: auto !important;
|
184 |
-
font-weight: 600 !important;
|
185 |
-
font-size: 1.2em !important;
|
186 |
-
color: darkgoldenrod !important;
|
187 |
-
padding: 4px !important;
|
188 |
-
border: 2px dashed gold !important;
|
189 |
-
background: white !important;
|
190 |
-
word-break: break-word !important;
|
191 |
-
display: inline-block !important;
|
192 |
-
text-shadow: 1px 1px 1px gold !important;
|
193 |
-
}
|
194 |
-
li.has_divider_1 {
|
195 |
-
list-style: none;
|
196 |
-
}
|
197 |
-
li.has_divider_1 > div.is_divider_1 {
|
198 |
-
display: inline-block;
|
199 |
-
width: 100%;
|
200 |
-
height: 0.4em;
|
201 |
-
background: burlywood;
|
202 |
-
}
|
203 |
-
.accordion-element,
|
204 |
-
.accordion-element button:not(.reset-button):not(.primary),
|
205 |
-
.accordion-element button:not(.reset-button):not(.primary) * {
|
206 |
-
background: navy !important;
|
207 |
-
color: white !important;
|
208 |
-
font-family: "Nunito", serif !important;
|
209 |
-
font-optical-sizing: auto !important;
|
210 |
-
font-weight: 600 !important;
|
211 |
-
font-size: 1.2em !important;
|
212 |
-
}
|
213 |
-
/* the issue with a Gradio gr.Tab() component,
|
214 |
-
is that if we specify a CSS class for it through
|
215 |
-
the declaration of the well-said component, then,
|
216 |
-
it would be useless as it don't permit to targetting
|
217 |
-
the TRUE button tab clickable DOMElement..
|
218 |
-
so this is a workaround which assume the TAB is at that XPath (at least for Gradio version 5) */
|
219 |
-
/* any NOT active Gradio tab : */
|
220 |
-
.tab-wrapper .tab-container[role="tablist"] button[role="tab"]:not(.selected) {
|
221 |
-
background: red !important;
|
222 |
-
color: white !important;
|
223 |
-
font-family: "Nunito", serif !important;
|
224 |
-
font-optical-sizing: auto !important;
|
225 |
-
font-weight: 600 !important;
|
226 |
-
font-size: 1.2em !important;
|
227 |
-
}
|
228 |
-
/* the CURRENT active Gradio tab : */
|
229 |
-
.tab-wrapper .tab-container[role="tablist"] button[role="tab"].selected {
|
230 |
-
background: green !important;
|
231 |
-
color: white !important;
|
232 |
-
font-family: "Nunito", serif !important;
|
233 |
-
font-optical-sizing: auto !important;
|
234 |
-
font-weight: 600 !important;
|
235 |
-
font-size: 1.6em !important;
|
236 |
-
}
|
237 |
-
/* here we only target Gradio button
|
238 |
-
that are reset-button
|
239 |
-
IN an accordion-element classe */
|
240 |
-
.accordion-element button.reset-button {
|
241 |
-
background: #803e3e !important;
|
242 |
-
color: white !important;
|
243 |
-
font-family: "Atma", serif !important;
|
244 |
-
font-weight: 700 !important;
|
245 |
-
font-style: normal !important;
|
246 |
-
}
|
247 |
-
/* here we only target Gradio button
|
248 |
-
that are primary
|
249 |
-
IN an accordion-element classe */
|
250 |
-
.accordion-element button.primary {
|
251 |
-
background: #5f925e !important;
|
252 |
-
font-size: 1.6em !important;
|
253 |
-
font-style: oblique !important;
|
254 |
-
font-weight: normal !important;
|
255 |
-
text-transform: uppercase !important;
|
256 |
-
letter-spacing: 1px !important;
|
257 |
-
border-bottom-right-radius: 100em !important;
|
258 |
-
border-bottom-left-radius: 100em !important;
|
259 |
-
font-family: "Atma", serif !important;
|
260 |
-
font-weight: 700 !important;
|
261 |
-
font-style: normal !important;
|
262 |
-
}
|
263 |
"""
|
264 |
|
265 |
|
266 |
help_dict = {
|
267 |
"hf_username": """
|
268 |
-
<article class="setting_tag" use-webfont="wf-nunito-regular">
|
269 |
-
(hf_username)
|
270 |
-
</article>
|
271 |
<div class="details_info_block_expanded_override"
|
272 |
use-webfont="wf-atma-light"
|
273 |
>
|
274 |
<em>Your HuggingFace username, no more, no less</em>
|
275 |
</div>""",
|
276 |
"hf_write_token_access": """
|
277 |
-
<article class="setting_tag" use-webfont="wf-nunito-regular">
|
278 |
-
(hf_write_token_access)
|
279 |
-
</article>
|
280 |
<div class="details_info_block"
|
281 |
is-expanded="False"
|
282 |
ondblclick="makeExpandable(this);"
|
|
|
16 |
.title { font-size: 3em; align-items: center; text-align: center; }
|
17 |
.info { align-items: center; text-align: center; }
|
18 |
.block.result { margin: 1em 0; padding: 1em; box-shadow: 0 0 3px 3px #664422, 0 0 3px 2px #664422 inset; border-radius: 6px; background: #665544; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
"""
|
20 |
|
21 |
|
22 |
help_dict = {
|
23 |
"hf_username": """
|
|
|
|
|
|
|
24 |
<div class="details_info_block_expanded_override"
|
25 |
use-webfont="wf-atma-light"
|
26 |
>
|
27 |
<em>Your HuggingFace username, no more, no less</em>
|
28 |
</div>""",
|
29 |
"hf_write_token_access": """
|
|
|
|
|
|
|
30 |
<div class="details_info_block"
|
31 |
is-expanded="False"
|
32 |
ondblclick="makeExpandable(this);"
|