Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,6 @@ from midi_synthesizer import MidiSynthesizer
|
|
18 |
|
19 |
MAX_SEED = np.iinfo(np.int32).max
|
20 |
in_space = os.getenv("SYSTEM") == "spaces"
|
21 |
-
np.random.seed()
|
22 |
|
23 |
@torch.inference_mode()
|
24 |
def generate(model: MIDIModel, prompt=None, max_len=512, temp=1.0, top_p=0.98, top_k=20,
|
@@ -130,10 +129,12 @@ def run(model_name, tab, mid_seq, continuation_state, instruments, drum_kit, bpm
|
|
130 |
key_sig_mi = key_sig % 2
|
131 |
gen_events = int(gen_events)
|
132 |
max_len = gen_events
|
|
|
133 |
if seed_rand:
|
134 |
seed = np.random.randint(0, MAX_SEED)
|
|
|
135 |
print(f"Random Seed: {seed}")
|
136 |
-
print(f"Numpy Randint: {np.random.randint(0, MAX_SEED)}")
|
137 |
generator = torch.Generator(opt.device).manual_seed(seed)
|
138 |
print(f"Seed: {seed}")
|
139 |
disable_patch_change = False
|
|
|
18 |
|
19 |
MAX_SEED = np.iinfo(np.int32).max
|
20 |
in_space = os.getenv("SYSTEM") == "spaces"
|
|
|
21 |
|
22 |
@torch.inference_mode()
|
23 |
def generate(model: MIDIModel, prompt=None, max_len=512, temp=1.0, top_p=0.98, top_k=20,
|
|
|
129 |
key_sig_mi = key_sig % 2
|
130 |
gen_events = int(gen_events)
|
131 |
max_len = gen_events
|
132 |
+
from random import randint
|
133 |
if seed_rand:
|
134 |
seed = np.random.randint(0, MAX_SEED)
|
135 |
+
seed = randint(0, MAX_SEED)
|
136 |
print(f"Random Seed: {seed}")
|
137 |
+
print(f"Numpy Randint: {np.random.randint(0, MAX_SEED)}, Python Randint: {randint(0, MAX_SEED)}")
|
138 |
generator = torch.Generator(opt.device).manual_seed(seed)
|
139 |
print(f"Seed: {seed}")
|
140 |
disable_patch_change = False
|