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
  # ์™ผ์ชฝ ์ž…๋ ฅ ์ปฌ๋Ÿผ