Spaces:
Runtime error
Runtime error
Commit
·
eee9f98
1
Parent(s):
25d1299
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ import torch
|
|
15 |
|
16 |
# setup()
|
17 |
|
18 |
-
#
|
19 |
# print("Download preprocessed cache files...")
|
20 |
# CACHE_URLS = [
|
21 |
# 'https://huggingface.co/pharma/ci-preprocess/resolve/main/ViT-H-14_laion2b_s32b_b79k_artists.pkl',
|
@@ -128,14 +128,37 @@ a {text-decoration-line: underline; font-weight: 600;}
|
|
128 |
#share-btn-container .wrap {
|
129 |
display: none !important;
|
130 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
'''
|
132 |
|
133 |
with gr.Blocks(css=css) as block:
|
134 |
with gr.Column(elem_id="col-container"):
|
135 |
gr.HTML(title)
|
136 |
|
137 |
-
input_image = gr.
|
138 |
-
# NUM_IMAGES = len(input_image)
|
139 |
with gr.Row():
|
140 |
mode_input = gr.Radio(['best', 'classic', 'fast'], label='Select mode', value='best')
|
141 |
flavor_input = gr.Slider(minimum=2, maximum=24, step=2, value=4, label='best mode max flavors')
|
@@ -144,8 +167,8 @@ with gr.Blocks(css=css) as block:
|
|
144 |
|
145 |
# rows, cols = NUM_IMAGES //3,
|
146 |
gallery = gr.Gallery(
|
147 |
-
label="
|
148 |
-
)
|
149 |
|
150 |
with gr.Group(elem_id="share-btn-container"):
|
151 |
loading_icon = gr.HTML(loading_icon_html, visible=False)
|
|
|
15 |
|
16 |
# setup()
|
17 |
|
18 |
+
# download cache files
|
19 |
# print("Download preprocessed cache files...")
|
20 |
# CACHE_URLS = [
|
21 |
# 'https://huggingface.co/pharma/ci-preprocess/resolve/main/ViT-H-14_laion2b_s32b_b79k_artists.pkl',
|
|
|
128 |
#share-btn-container .wrap {
|
129 |
display: none !important;
|
130 |
}
|
131 |
+
#gallery .caption-label.svelte-w0jac3 {
|
132 |
+
font-size: 15px;
|
133 |
+
right: 0;
|
134 |
+
max-width: 100%; /* Added missing semicolon */
|
135 |
+
text-overflow: clip;
|
136 |
+
white-space: normal;
|
137 |
+
overflow: auto;
|
138 |
+
height: 20%;
|
139 |
+
}
|
140 |
+
|
141 |
+
#gallery .grid-wrap.svelte-w0jac3.fixed-height .grid-wrap.svelte-w0jac3.fixed-height{
|
142 |
+
overflow-y: auto;
|
143 |
+
}
|
144 |
+
|
145 |
+
#gallery .caption.svelte-w0jac3{
|
146 |
+
padding: var(--size-2) var(--size-3);
|
147 |
+
text-overflow: clip;
|
148 |
+
white-space: normal; /* Allows the text to wrap */
|
149 |
+
color: var(--block-label-text-color);
|
150 |
+
font-weight: var(--weight-semibold);
|
151 |
+
text-align: center;
|
152 |
+
height: 100%;
|
153 |
+
font-size: 17px;
|
154 |
+
}
|
155 |
'''
|
156 |
|
157 |
with gr.Blocks(css=css) as block:
|
158 |
with gr.Column(elem_id="col-container"):
|
159 |
gr.HTML(title)
|
160 |
|
161 |
+
input_image = gr.Files(label = "Inputs", file_count="multiple", type='bytes', elem_id='inputs')
|
|
|
162 |
with gr.Row():
|
163 |
mode_input = gr.Radio(['best', 'classic', 'fast'], label='Select mode', value='best')
|
164 |
flavor_input = gr.Slider(minimum=2, maximum=24, step=2, value=4, label='best mode max flavors')
|
|
|
167 |
|
168 |
# rows, cols = NUM_IMAGES //3,
|
169 |
gallery = gr.Gallery(
|
170 |
+
label="Outputs", show_label=True, elem_id="gallery", object_fit="contain", height="auto"
|
171 |
+
)
|
172 |
|
173 |
with gr.Group(elem_id="share-btn-container"):
|
174 |
loading_icon = gr.HTML(loading_icon_html, visible=False)
|