GeneralGost commited on
Commit
72e0ddf
·
verified ·
1 Parent(s): 196e3b0

Fixed bug, parse text

Browse files
Files changed (1) hide show
  1. app.py +14 -13
app.py CHANGED
@@ -217,17 +217,18 @@ class Predictor:
217
  ", ".join(sorted_general_strings).replace("(", "\(").replace(")", "\)")
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,14 +304,14 @@ def main():
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,7 +328,7 @@ def main():
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(
 
217
  ", ".join(sorted_general_strings).replace("(", "\(").replace(")", "\)")
218
  )
219
 
220
+ grupos = sorted_general_strings.split(',')
221
+ for i, grupo in enumerate(grupos):
222
+ palabras = grupo.split()
223
+ if len(palabras) > 1:
224
+ grupos[i] = '_'.join(palabras)
225
+ parse_general_strings = ','.join(grupos)
226
+
227
+ print(parse_general_strings)
228
+
229
+ return sorted_general_strings, parse_general_strings, rating, character_res, general_res
230
 
231
+
 
 
 
 
 
 
 
 
232
 
233
  def main():
234
  args = parse_args()
 
304
  submit = gr.Button(value="Submit", variant="primary", size="lg")
305
  with gr.Column(variant="panel"):
306
  sorted_general_strings = gr.Textbox(label="Output (string)")
307
+ parse_general_strings = gr.Textbox(label="Output Parse (string)")
308
  rating = gr.Label(label="Rating")
309
  character_res = gr.Label(label="Output (characters)")
310
  general_res = gr.Label(label="Output (tags)")
311
  clear.add(
312
  [
313
  sorted_general_strings,
314
+ parse_general_strings,
315
  rating,
316
  character_res,
317
  general_res,
 
328
  character_thresh,
329
  character_mcut_enabled,
330
  ],
331
+ outputs=[sorted_general_strings,parse_general_strings, rating, character_res, general_res],
332
  )
333
 
334
  gr.Examples(