Spaces:
Sleeping
Sleeping
Update model.py
Browse files
model.py
CHANGED
@@ -30,5 +30,5 @@ def choice_to_tensor(choice: Sequence[str]) -> torch.Tensor:
|
|
30 |
return torch.tensor(instruments.index(choice))
|
31 |
|
32 |
def generate(choice: Sequence[str], params: Sequence[int]=None):
|
33 |
-
noise = torch.tensor(params).unsqueeze(0).to(device) if params else torch.randn(1, 5).to(
|
34 |
return model.sample(eps=noise, c = choice_to_tensor(choice).to(device)).cpu().numpy()[0]
|
|
|
30 |
return torch.tensor(instruments.index(choice))
|
31 |
|
32 |
def generate(choice: Sequence[str], params: Sequence[int]=None):
|
33 |
+
noise = torch.tensor(params).unsqueeze(0).to(device) if params else torch.randn(1, 5).to(device)
|
34 |
return model.sample(eps=noise, c = choice_to_tensor(choice).to(device)).cpu().numpy()[0]
|