Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,20 +15,18 @@ import random
|
|
| 15 |
import spaces
|
| 16 |
import os
|
| 17 |
|
| 18 |
-
|
| 19 |
torch.backends.cudnn.benchmark = True
|
| 20 |
torch.backends.cudnn.allow_tf32 = True
|
| 21 |
torch.backends.cuda.matmul.allow_tf32 = True
|
| 22 |
|
| 23 |
in_space = os.getenv("SYSTEM") == "spaces"
|
| 24 |
-
os.environ['CUDA_HOME'] = '/usr/local/cuda'
|
| 25 |
|
| 26 |
n_layer = 12
|
| 27 |
n_embd = 768
|
| 28 |
ctx_len = 2048
|
| 29 |
|
| 30 |
os.environ['RWKV_FLOAT_MODE'] = 'fp32'
|
| 31 |
-
os.environ['RWKV_RUN_DEVICE'] = '
|
| 32 |
model_type = 'RWKV'
|
| 33 |
|
| 34 |
MODEL_NAME = 'model'
|
|
@@ -71,7 +69,6 @@ def humanize_notes(midi_events):
|
|
| 71 |
return midi_events
|
| 72 |
|
| 73 |
|
| 74 |
-
@spaces.GPU(duration=60)
|
| 75 |
def generate_midi(LENGTH_PER_TRIAL, src_ctx, model, src_len, ctx_len, TEMPERATURE, top_k, tokenizer, ctx_seed, bpm):
|
| 76 |
midi_seq = []
|
| 77 |
|
|
|
|
| 15 |
import spaces
|
| 16 |
import os
|
| 17 |
|
|
|
|
| 18 |
torch.backends.cudnn.benchmark = True
|
| 19 |
torch.backends.cudnn.allow_tf32 = True
|
| 20 |
torch.backends.cuda.matmul.allow_tf32 = True
|
| 21 |
|
| 22 |
in_space = os.getenv("SYSTEM") == "spaces"
|
|
|
|
| 23 |
|
| 24 |
n_layer = 12
|
| 25 |
n_embd = 768
|
| 26 |
ctx_len = 2048
|
| 27 |
|
| 28 |
os.environ['RWKV_FLOAT_MODE'] = 'fp32'
|
| 29 |
+
os.environ['RWKV_RUN_DEVICE'] = 'cpu'
|
| 30 |
model_type = 'RWKV'
|
| 31 |
|
| 32 |
MODEL_NAME = 'model'
|
|
|
|
| 69 |
return midi_events
|
| 70 |
|
| 71 |
|
|
|
|
| 72 |
def generate_midi(LENGTH_PER_TRIAL, src_ctx, model, src_len, ctx_len, TEMPERATURE, top_k, tokenizer, ctx_seed, bpm):
|
| 73 |
midi_seq = []
|
| 74 |
|