Skip to content

Commit

Permalink
don't use wrapper for now
Browse files Browse the repository at this point in the history
  • Loading branch information
yxlllc authored Feb 27, 2023
1 parent c20a81a commit 56802b2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions export.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def main():

# load model
model, args = load_model(cmd.model_path, device=device)
model = DDSPWrapper(model, device)
#model = DDSPWrapper(model, device)

# extract model dirname and filename
directory = os.path.dirname(os.path.abspath(cmd.model_path))
Expand All @@ -65,12 +65,13 @@ def main():
n_frames = 10
mel = torch.randn((1, n_frames, n_mel_channels), dtype=torch.float32, device=device)
f0 = torch.FloatTensor([[440.] * n_frames]).to(device)

f0 = f0[..., None]

# export model
with torch.no_grad():
if cmd.traced:
torch_version = torch.version.__version__.rsplit('+', maxsplit=1)[0]
export_path = os.path.join(directory, f'{name}-traced-torch{torch_version}.pt')
export_path = os.path.join(directory, f'{name}-traced-torch{torch_version}.jit')
print(f' [Tracing] {cmd.model_path} => {export_path}')
model = torch.jit.trace(
model,
Expand Down

0 comments on commit 56802b2

Please sign in to comment.