Spaces:
Paused
Paused
Update app.py
Browse files
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 |
# ์ผ์ชฝ ์
๋ ฅ ์ปฌ๋ผ
|