ChrisPreston commited on
Commit
1903060
1 Parent(s): ed8690b

Update infer_tools/infer_tool.py

Browse files
Files changed (1) hide show
  1. infer_tools/infer_tool.py +4 -4
infer_tools/infer_tool.py CHANGED
@@ -179,11 +179,11 @@ class Svc:
179
 
180
  def getitem(item):
181
  max_frames = hparams['max_frames']
182
- spec = torch.Tensor(item['mel'])[:max_frames]
183
- mel2ph = torch.LongTensor(item['mel2ph'])[:max_frames] if 'mel2ph' in item else None
184
  f0, uv = norm_interp_f0(item["f0"][:max_frames], hparams)
185
- hubert = torch.Tensor(item['hubert'][:hparams['max_input_tokens']])
186
- pitch = torch.LongTensor(item.get("pitch"))[:max_frames]
187
  sample = {
188
  "id": item['id'],
189
  "spk_id": item['spk_id'],
 
179
 
180
  def getitem(item):
181
  max_frames = hparams['max_frames']
182
+ spec = torch.Tensor(item['mel']).cpu()[:max_frames]
183
+ mel2ph = torch.LongTensor(item['mel2ph']).cpu()[:max_frames] if 'mel2ph' in item else None
184
  f0, uv = norm_interp_f0(item["f0"][:max_frames], hparams)
185
+ hubert = torch.Tensor(item['hubert'][:hparams['max_input_tokens']]).cpu()
186
+ pitch = torch.LongTensor(item.get("pitch")).cpu()[:max_frames]
187
  sample = {
188
  "id": item['id'],
189
  "spk_id": item['spk_id'],