Spaces:
Running
Running
Added a new output field
Browse files
app.py
CHANGED
@@ -218,7 +218,16 @@ class Predictor:
|
|
218 |
)
|
219 |
|
220 |
return sorted_general_strings, rating, character_res, general_res
|
221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
def main():
|
224 |
args = parse_args()
|
@@ -294,12 +303,14 @@ def main():
|
|
294 |
submit = gr.Button(value="Submit", variant="primary", size="lg")
|
295 |
with gr.Column(variant="panel"):
|
296 |
sorted_general_strings = gr.Textbox(label="Output (string)")
|
|
|
297 |
rating = gr.Label(label="Rating")
|
298 |
character_res = gr.Label(label="Output (characters)")
|
299 |
general_res = gr.Label(label="Output (tags)")
|
300 |
clear.add(
|
301 |
[
|
302 |
sorted_general_strings,
|
|
|
303 |
rating,
|
304 |
character_res,
|
305 |
general_res,
|
@@ -316,7 +327,7 @@ def main():
|
|
316 |
character_thresh,
|
317 |
character_mcut_enabled,
|
318 |
],
|
319 |
-
outputs=[sorted_general_strings, rating, character_res, general_res],
|
320 |
)
|
321 |
|
322 |
gr.Examples(
|
|
|
218 |
)
|
219 |
|
220 |
return sorted_general_strings, rating, character_res, general_res
|
221 |
+
|
222 |
+
def reemplazar_espacios(texto):
|
223 |
+
|
224 |
+
grupos = texto.split(',')
|
225 |
+
for i, grupo in enumerate(grupos):
|
226 |
+
palabras = grupo.split()
|
227 |
+
if len(palabras) > 1:
|
228 |
+
grupos[i] = '_'.join(palabras)
|
229 |
+
strings_parsec = ', '.join(grupos)
|
230 |
+
return strings_parsec
|
231 |
|
232 |
def main():
|
233 |
args = parse_args()
|
|
|
303 |
submit = gr.Button(value="Submit", variant="primary", size="lg")
|
304 |
with gr.Column(variant="panel"):
|
305 |
sorted_general_strings = gr.Textbox(label="Output (string)")
|
306 |
+
strings_parsec = gr.Textbox(label="Output (strings)" )
|
307 |
rating = gr.Label(label="Rating")
|
308 |
character_res = gr.Label(label="Output (characters)")
|
309 |
general_res = gr.Label(label="Output (tags)")
|
310 |
clear.add(
|
311 |
[
|
312 |
sorted_general_strings,
|
313 |
+
strings_parsec,
|
314 |
rating,
|
315 |
character_res,
|
316 |
general_res,
|
|
|
327 |
character_thresh,
|
328 |
character_mcut_enabled,
|
329 |
],
|
330 |
+
outputs=[sorted_general_strings, strings_parsec, rating, character_res, general_res],
|
331 |
)
|
332 |
|
333 |
gr.Examples(
|