aiqcamp commited on
Commit
feb4651
Β·
verified Β·
1 Parent(s): 8b7acec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -21
app.py CHANGED
@@ -404,22 +404,21 @@ with gr.Blocks(title="ν‚€μ›Œλ“œ 기반 창의적 λ³€ν™” 아이디어 생성기",
404
  text_input3 = gr.Textbox(label="ν‚€μ›Œλ“œ 3 (선택)", placeholder="예: ν—¬μŠ€μΌ€μ–΄")
405
 
406
  # μž…λ ₯κ³Ό λ²„νŠΌ 사이에 μƒνƒœ λ©”μ‹œμ§€λ₯Ό ν‘œμ‹œν•  μ˜μ—­ μΆ”κ°€
407
- status_msg = gr.Markdown("πŸ’‘ '아이디어 μƒμ„±ν•˜κΈ°' λ²„νŠΌμ„ ν΄λ¦­ν•˜λ©΄ ν”„λ‘œκ·Έλ ˆμŠ€ λ°”κ°€ λ‚˜νƒ€λ‚©λ‹ˆλ‹€.")
408
 
409
  # 처리 쀑일 λ•Œλ§Œ ν‘œμ‹œλ˜λŠ” μƒνƒœ λ©”μ‹œμ§€
410
- with gr.Box(visible=False) as processing_box:
411
- processing_indicator = gr.HTML("""
412
- <div style="display: flex; justify-content: center; align-items: center; margin: 10px 0;">
413
- <div style="border: 5px solid #f3f3f3; border-top: 5px solid #3498db; border-radius: 50%; width: 30px; height: 30px; animation: spin 2s linear infinite;"></div>
414
- <p style="margin-left: 10px; font-weight: bold; color: #3498db;">처리 μ€‘μž…λ‹ˆλ‹€...</p>
415
- </div>
416
- <style>
417
- @keyframes spin {
418
- 0% { transform: rotate(0deg); }
419
- 100% { transform: rotate(360deg); }
420
- }
421
- </style>
422
- """)
423
 
424
  submit_button = gr.Button("아이디어 μƒμ„±ν•˜κΈ°", variant="primary")
425
 
@@ -430,12 +429,10 @@ with gr.Blocks(title="ν‚€μ›Œλ“œ 기반 창의적 λ³€ν™” 아이디어 생성기",
430
  # μ˜ˆμ‹œ μž…λ ₯
431
  gr.Examples(
432
  examples=[
433
-
434
- ["μžλ™μ°¨", "", ""],
435
- ["슀마트폰", "인곡지λŠ₯", ""],
436
- ["λ“œλ‘ ", "인곡지λŠ₯", ""],
437
  ["μš΄λ™ν™”", "μ›¨μ–΄λŸ¬λΈ”", "건강"],
438
-
439
  ],
440
  inputs=[text_input1, text_input2, text_input3],
441
  )
@@ -452,7 +449,7 @@ with gr.Blocks(title="ν‚€μ›Œλ“œ 기반 창의적 λ³€ν™” 아이디어 생성기",
452
  submit_button.click(
453
  fn=show_processing_indicator,
454
  inputs=None,
455
- outputs=processing_box
456
  ).then(
457
  fn=process_inputs,
458
  inputs=[text_input1, text_input2, text_input3],
@@ -460,7 +457,7 @@ with gr.Blocks(title="ν‚€μ›Œλ“œ 기반 창의적 λ³€ν™” 아이디어 생성기",
460
  ).then(
461
  fn=hide_processing_indicator,
462
  inputs=None,
463
- outputs=processing_box
464
  )
465
 
466
  if __name__ == "__main__":
 
404
  text_input3 = gr.Textbox(label="ν‚€μ›Œλ“œ 3 (선택)", placeholder="예: ν—¬μŠ€μΌ€μ–΄")
405
 
406
  # μž…λ ₯κ³Ό λ²„νŠΌ 사이에 μƒνƒœ λ©”μ‹œμ§€λ₯Ό ν‘œμ‹œν•  μ˜μ—­ μΆ”κ°€
407
+ status_msg = gr.Markdown("πŸ’‘ '아이디어 μƒμ„±ν•˜κΈ°' λ²„νŠΌμ„ ν΄λ¦­ν•˜λ©΄ 아이디어 생성이 μ‹œμž‘λ©λ‹ˆλ‹€.")
408
 
409
  # 처리 쀑일 λ•Œλ§Œ ν‘œμ‹œλ˜λŠ” μƒνƒœ λ©”μ‹œμ§€
410
+ processing_indicator = gr.HTML("""
411
+ <div style="display: flex; justify-content: center; align-items: center; margin: 10px 0;">
412
+ <div style="border: 5px solid #f3f3f3; border-top: 5px solid #3498db; border-radius: 50%; width: 30px; height: 30px; animation: spin 2s linear infinite;"></div>
413
+ <p style="margin-left: 10px; font-weight: bold; color: #3498db;">처리 μ€‘μž…λ‹ˆλ‹€...</p>
414
+ </div>
415
+ <style>
416
+ @keyframes spin {
417
+ 0% { transform: rotate(0deg); }
418
+ 100% { transform: rotate(360deg); }
419
+ }
420
+ </style>
421
+ """, visible=False)
 
422
 
423
  submit_button = gr.Button("아이디어 μƒμ„±ν•˜κΈ°", variant="primary")
424
 
 
429
  # μ˜ˆμ‹œ μž…λ ₯
430
  gr.Examples(
431
  examples=[
432
+ ["슀마트폰", "", ""],
433
+ ["컀피", "μ±…", ""],
434
+ ["μžλ™μ°¨", "λ‘œλ΄‡", "인곡지λŠ₯"],
 
435
  ["μš΄λ™ν™”", "μ›¨μ–΄λŸ¬λΈ”", "건강"],
 
436
  ],
437
  inputs=[text_input1, text_input2, text_input3],
438
  )
 
449
  submit_button.click(
450
  fn=show_processing_indicator,
451
  inputs=None,
452
+ outputs=processing_indicator
453
  ).then(
454
  fn=process_inputs,
455
  inputs=[text_input1, text_input2, text_input3],
 
457
  ).then(
458
  fn=hide_processing_indicator,
459
  inputs=None,
460
+ outputs=processing_indicator
461
  )
462
 
463
  if __name__ == "__main__":