Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# https://huggingface.co/spaces/asigalov61/
|
2 |
|
3 |
import os
|
4 |
import time as reqtime
|
@@ -31,8 +31,8 @@ def GenerateSong(input_melody_seed_number):
|
|
31 |
|
32 |
print('Loading model...')
|
33 |
|
34 |
-
SEQ_LEN =
|
35 |
-
PAD_IDX =
|
36 |
DEVICE = 'cuda' # 'cuda'
|
37 |
|
38 |
# instantiate the model
|
@@ -43,7 +43,7 @@ def GenerateSong(input_melody_seed_number):
|
|
43 |
attn_layers = Decoder(dim = 1024, depth = 32, heads = 16, attn_flash = True)
|
44 |
)
|
45 |
|
46 |
-
model = AutoregressiveWrapper(model, ignore_index = PAD_IDX)
|
47 |
|
48 |
model.to(DEVICE)
|
49 |
print('=' * 70)
|
@@ -203,10 +203,10 @@ if __name__ == "__main__":
|
|
203 |
app = gr.Blocks()
|
204 |
|
205 |
with app:
|
206 |
-
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>
|
207 |
-
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Generate
|
208 |
gr.Markdown(
|
209 |
-
"
|
212 |
|
|
|
1 |
+
# https://huggingface.co/spaces/asigalov61/Bridge-Music-Transformer
|
2 |
|
3 |
import os
|
4 |
import time as reqtime
|
|
|
31 |
|
32 |
print('Loading model...')
|
33 |
|
34 |
+
SEQ_LEN = 3074
|
35 |
+
PAD_IDX = 653
|
36 |
DEVICE = 'cuda' # 'cuda'
|
37 |
|
38 |
# instantiate the model
|
|
|
43 |
attn_layers = Decoder(dim = 1024, depth = 32, heads = 16, attn_flash = True)
|
44 |
)
|
45 |
|
46 |
+
model = AutoregressiveWrapper(model, ignore_index = PAD_IDX, pad_value=PAD_IDX)
|
47 |
|
48 |
model.to(DEVICE)
|
49 |
print('=' * 70)
|
|
|
203 |
app = gr.Blocks()
|
204 |
|
205 |
with app:
|
206 |
+
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Bridge Music Transformer</h1>")
|
207 |
+
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Generate a seamless bridge between two composition parts</h1>")
|
208 |
gr.Markdown(
|
209 |
+
"\n\n")
|
210 |
|
211 |
input_melody_seed_number = gr.Slider(0, 203664, value=0, step=1, label="Select seed melody number")
|
212 |
|