Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,23 +1,23 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
# -----------------------------
|
| 4 |
-
# CSS (
|
| 5 |
# -----------------------------
|
| 6 |
css = """
|
| 7 |
:root {
|
| 8 |
--bg1: #1a0c12;
|
| 9 |
--bg2: #3a1523;
|
| 10 |
-
--
|
| 11 |
-
--
|
| 12 |
--border: rgba(255,255,255,0.10);
|
| 13 |
-
--text: #
|
| 14 |
--muted: rgba(255,255,255,0.65);
|
| 15 |
--accent: #ff5c8a;
|
| 16 |
}
|
| 17 |
|
| 18 |
body {
|
| 19 |
background: linear-gradient(135deg, var(--bg1), var(--bg2));
|
| 20 |
-
font-family:
|
| 21 |
}
|
| 22 |
|
| 23 |
.gradio-container {
|
|
@@ -27,7 +27,7 @@ body {
|
|
| 27 |
|
| 28 |
/* Header */
|
| 29 |
.header {
|
| 30 |
-
margin-bottom:
|
| 31 |
}
|
| 32 |
.logo {
|
| 33 |
font-size: 42px;
|
|
@@ -40,7 +40,7 @@ body {
|
|
| 40 |
color: var(--accent);
|
| 41 |
}
|
| 42 |
|
| 43 |
-
/* Section
|
| 44 |
.section-title {
|
| 45 |
font-size: 20px;
|
| 46 |
font-weight: 600;
|
|
@@ -51,7 +51,7 @@ body {
|
|
| 51 |
margin-bottom: 14px;
|
| 52 |
}
|
| 53 |
|
| 54 |
-
/* GRID
|
| 55 |
.main-grid {
|
| 56 |
display: grid;
|
| 57 |
grid-template-columns: 2fr 1fr 1fr;
|
|
@@ -59,18 +59,18 @@ body {
|
|
| 59 |
gap: 22px;
|
| 60 |
}
|
| 61 |
|
| 62 |
-
/* Upload
|
| 63 |
.upload-box {
|
| 64 |
grid-row: span 2;
|
| 65 |
-
background: var(--
|
| 66 |
border: 1px solid var(--border);
|
| 67 |
border-radius: 14px;
|
| 68 |
-
padding:
|
| 69 |
}
|
| 70 |
|
| 71 |
-
/*
|
| 72 |
.stem-box {
|
| 73 |
-
background: var(--
|
| 74 |
border: 1px solid var(--border);
|
| 75 |
border-radius: 14px;
|
| 76 |
padding: 14px;
|
|
@@ -99,7 +99,6 @@ body {
|
|
| 99 |
letter-spacing: 0.3px;
|
| 100 |
}
|
| 101 |
|
| 102 |
-
/* Footer off */
|
| 103 |
footer { display: none !important; }
|
| 104 |
"""
|
| 105 |
|
|
@@ -109,50 +108,44 @@ footer { display: none !important; }
|
|
| 109 |
with gr.Blocks() as demo:
|
| 110 |
|
| 111 |
# Header
|
| 112 |
-
gr.
|
| 113 |
-
"""
|
| 114 |
<div class="header">
|
| 115 |
<div class="logo">SWARA STUDIO</div>
|
| 116 |
<div class="tagline">Separating Music Into Its elements</div>
|
| 117 |
</div>
|
| 118 |
-
|
| 119 |
-
unsafe_allow_html=True
|
| 120 |
-
)
|
| 121 |
|
| 122 |
-
# Intro
|
| 123 |
-
gr.
|
| 124 |
-
"""
|
| 125 |
<div class="section-title">Select a track</div>
|
| 126 |
<div class="section-sub">We’ll break it down into individual parts</div>
|
| 127 |
-
|
| 128 |
-
unsafe_allow_html=True
|
| 129 |
-
)
|
| 130 |
|
| 131 |
-
#
|
| 132 |
with gr.Row(elem_classes="main-grid"):
|
| 133 |
|
| 134 |
-
#
|
| 135 |
with gr.Column(elem_classes="upload-box"):
|
| 136 |
audio_in = gr.Audio(label="Audio", type="filepath")
|
| 137 |
|
| 138 |
-
#
|
| 139 |
with gr.Column(elem_classes="stem-box"):
|
| 140 |
-
gr.
|
| 141 |
vocals = gr.Audio(label=None)
|
| 142 |
|
| 143 |
-
#
|
| 144 |
with gr.Column(elem_classes="stem-box"):
|
| 145 |
-
gr.
|
| 146 |
drums = gr.Audio(label=None)
|
| 147 |
|
| 148 |
-
#
|
| 149 |
with gr.Column(elem_classes="stem-box"):
|
| 150 |
-
gr.
|
| 151 |
bass = gr.Audio(label=None)
|
| 152 |
|
| 153 |
-
#
|
| 154 |
with gr.Column(elem_classes="stem-box"):
|
| 155 |
-
gr.
|
| 156 |
other = gr.Audio(label=None)
|
| 157 |
|
| 158 |
# Action
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
# -----------------------------
|
| 4 |
+
# CSS (Gradio 6 compatible)
|
| 5 |
# -----------------------------
|
| 6 |
css = """
|
| 7 |
:root {
|
| 8 |
--bg1: #1a0c12;
|
| 9 |
--bg2: #3a1523;
|
| 10 |
+
--panel: rgba(255,255,255,0.04);
|
| 11 |
+
--panel-soft: rgba(255,255,255,0.03);
|
| 12 |
--border: rgba(255,255,255,0.10);
|
| 13 |
+
--text: #f4f4f4;
|
| 14 |
--muted: rgba(255,255,255,0.65);
|
| 15 |
--accent: #ff5c8a;
|
| 16 |
}
|
| 17 |
|
| 18 |
body {
|
| 19 |
background: linear-gradient(135deg, var(--bg1), var(--bg2));
|
| 20 |
+
font-family: Inter, system-ui, sans-serif;
|
| 21 |
}
|
| 22 |
|
| 23 |
.gradio-container {
|
|
|
|
| 27 |
|
| 28 |
/* Header */
|
| 29 |
.header {
|
| 30 |
+
margin-bottom: 26px;
|
| 31 |
}
|
| 32 |
.logo {
|
| 33 |
font-size: 42px;
|
|
|
|
| 40 |
color: var(--accent);
|
| 41 |
}
|
| 42 |
|
| 43 |
+
/* Section */
|
| 44 |
.section-title {
|
| 45 |
font-size: 20px;
|
| 46 |
font-weight: 600;
|
|
|
|
| 51 |
margin-bottom: 14px;
|
| 52 |
}
|
| 53 |
|
| 54 |
+
/* GRID */
|
| 55 |
.main-grid {
|
| 56 |
display: grid;
|
| 57 |
grid-template-columns: 2fr 1fr 1fr;
|
|
|
|
| 59 |
gap: 22px;
|
| 60 |
}
|
| 61 |
|
| 62 |
+
/* Upload */
|
| 63 |
.upload-box {
|
| 64 |
grid-row: span 2;
|
| 65 |
+
background: var(--panel);
|
| 66 |
border: 1px solid var(--border);
|
| 67 |
border-radius: 14px;
|
| 68 |
+
padding: 18px;
|
| 69 |
}
|
| 70 |
|
| 71 |
+
/* Stems */
|
| 72 |
.stem-box {
|
| 73 |
+
background: var(--panel-soft);
|
| 74 |
border: 1px solid var(--border);
|
| 75 |
border-radius: 14px;
|
| 76 |
padding: 14px;
|
|
|
|
| 99 |
letter-spacing: 0.3px;
|
| 100 |
}
|
| 101 |
|
|
|
|
| 102 |
footer { display: none !important; }
|
| 103 |
"""
|
| 104 |
|
|
|
|
| 108 |
with gr.Blocks() as demo:
|
| 109 |
|
| 110 |
# Header
|
| 111 |
+
gr.HTML("""
|
|
|
|
| 112 |
<div class="header">
|
| 113 |
<div class="logo">SWARA STUDIO</div>
|
| 114 |
<div class="tagline">Separating Music Into Its elements</div>
|
| 115 |
</div>
|
| 116 |
+
""")
|
|
|
|
|
|
|
| 117 |
|
| 118 |
+
# Intro
|
| 119 |
+
gr.HTML("""
|
|
|
|
| 120 |
<div class="section-title">Select a track</div>
|
| 121 |
<div class="section-sub">We’ll break it down into individual parts</div>
|
| 122 |
+
""")
|
|
|
|
|
|
|
| 123 |
|
| 124 |
+
# Main grid
|
| 125 |
with gr.Row(elem_classes="main-grid"):
|
| 126 |
|
| 127 |
+
# Upload (aligned by grid, not hacks)
|
| 128 |
with gr.Column(elem_classes="upload-box"):
|
| 129 |
audio_in = gr.Audio(label="Audio", type="filepath")
|
| 130 |
|
| 131 |
+
# Vocals
|
| 132 |
with gr.Column(elem_classes="stem-box"):
|
| 133 |
+
gr.HTML('<div class="stem-title">Vocals</div>')
|
| 134 |
vocals = gr.Audio(label=None)
|
| 135 |
|
| 136 |
+
# Drums
|
| 137 |
with gr.Column(elem_classes="stem-box"):
|
| 138 |
+
gr.HTML('<div class="stem-title">Drums</div>')
|
| 139 |
drums = gr.Audio(label=None)
|
| 140 |
|
| 141 |
+
# Bass
|
| 142 |
with gr.Column(elem_classes="stem-box"):
|
| 143 |
+
gr.HTML('<div class="stem-title">Bass</div>')
|
| 144 |
bass = gr.Audio(label=None)
|
| 145 |
|
| 146 |
+
# Other
|
| 147 |
with gr.Column(elem_classes="stem-box"):
|
| 148 |
+
gr.HTML('<div class="stem-title">Other</div>')
|
| 149 |
other = gr.Audio(label=None)
|
| 150 |
|
| 151 |
# Action
|