ginipick commited on
Commit
7d46486
Β·
verified Β·
1 Parent(s): f7b0b4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -20,6 +20,20 @@ logging.basicConfig(
20
  ]
21
  )
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  ################################
24
  # 기쑴에 μ •μ˜λœ ν•¨μˆ˜ 및 λ‘œμ§λ“€ #
25
  ################################
@@ -493,14 +507,6 @@ def main():
493
  </div>
494
  """)
495
 
496
- # 예제 μŒμ•… ν”Œλ ˆμ΄μ–΄ μΆ”κ°€
497
- gr.HTML("""
498
- <div style="padding: 1rem; margin-bottom: 1.5rem; background-color: #f8f9fa; border-radius: 8px; text-align: center;">
499
- <h3 style="margin: 0;">Sample Generated Music</h3>
500
- <p style="color: #666; margin: 5px 0;">Listen to this example</p>
501
- </div>
502
- """)
503
- gr.Audio("metal.mp3", label="Sample Music")
504
 
505
  with gr.Row():
506
  # μ™Όμͺ½ μž…λ ₯ 컬럼
 
20
  ]
21
  )
22
 
23
+
24
+ # ν”„λ‘œμ νŠΈ 루트 λ””λ ‰ν† λ¦¬μ—μ„œ samples 폴더 경둜 μ„€μ •
25
+ samples_dir = os.path.join(os.path.dirname(__file__), 'samples')
26
+ sample_audio_path = os.path.join(samples_dir, 'metal.mp3')
27
+
28
+ # samples 디렉토리가 μ—†λ‹€λ©΄ 생성
29
+ os.makedirs(samples_dir, exist_ok=True)
30
+
31
+ # 예제 μŒμ•…μ΄ μ‘΄μž¬ν•˜λŠ”μ§€ 확인
32
+ if os.path.exists(sample_audio_path):
33
+ gr.Audio(sample_audio_path, label="Sample Music")
34
+ else:
35
+ gr.Markdown("### Sample music file not found")
36
+
37
  ################################
38
  # 기쑴에 μ •μ˜λœ ν•¨μˆ˜ 및 λ‘œμ§λ“€ #
39
  ################################
 
507
  </div>
508
  """)
509
 
 
 
 
 
 
 
 
 
510
 
511
  with gr.Row():
512
  # μ™Όμͺ½ μž…λ ₯ 컬럼