GeneralGost commited on
Commit
2e1e50c
·
verified ·
1 Parent(s): 72e0ddf

Update App.py Fix Bug Output R34

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -218,11 +218,12 @@ class Predictor:
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
 
@@ -304,7 +305,7 @@ def main():
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)")
@@ -332,7 +333,7 @@ def main():
332
  )
333
 
334
  gr.Examples(
335
- [["power.jpg", SWINV2_MODEL_DSV3_REPO, 0.35, False, 0.85, False]],
336
  inputs=[
337
  image,
338
  model_repo,
@@ -349,3 +350,4 @@ def main():
349
 
350
  if __name__ == "__main__":
351
  main()
 
 
218
  )
219
 
220
  grupos = sorted_general_strings.split(',')
221
+
222
  for i, grupo in enumerate(grupos):
223
+ grupo = grupo.strip()
224
  palabras = grupo.split()
225
+ grupos[i] = '_'.join(palabras)
226
+ parse_general_strings = ' '.join(grupos)
 
227
 
228
  print(parse_general_strings)
229
 
 
305
  submit = gr.Button(value="Submit", variant="primary", size="lg")
306
  with gr.Column(variant="panel"):
307
  sorted_general_strings = gr.Textbox(label="Output (string)")
308
+ parse_general_strings = gr.Textbox(label="Output Parse r34 (string)")
309
  rating = gr.Label(label="Rating")
310
  character_res = gr.Label(label="Output (characters)")
311
  general_res = gr.Label(label="Output (tags)")
 
333
  )
334
 
335
  gr.Examples(
336
+ [["C:/Users/nubev/Desktop/scripts/Tagger/power.jpg", SWINV2_MODEL_DSV3_REPO, 0.35, False, 0.85, False]],
337
  inputs=[
338
  image,
339
  model_repo,
 
350
 
351
  if __name__ == "__main__":
352
  main()
353
+