zhu-han commited on
Commit
64deef9
·
1 Parent(s): 9e4e0d2

fix app.py for 0.1.4 version

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -85,17 +85,15 @@ def _gen_core(
85
  ref_text=ref_text,
86
  )
87
 
88
- if mode == "design":
89
- if instruct and instruct.strip():
90
- kw["instruct"] = instruct.strip()
91
 
92
  try:
93
  audio = model.generate(**kw)
94
  except Exception as e:
95
  return None, f"Error: {type(e).__name__}: {e}"
96
 
97
- waveform = audio[0].squeeze(0).numpy()
98
- waveform = (waveform * 32767).astype(np.int16)
99
  return (sampling_rate, waveform), "Done."
100
 
101
 
 
85
  ref_text=ref_text,
86
  )
87
 
88
+ if instruct and instruct.strip():
89
+ kw["instruct"] = instruct.strip()
 
90
 
91
  try:
92
  audio = model.generate(**kw)
93
  except Exception as e:
94
  return None, f"Error: {type(e).__name__}: {e}"
95
 
96
+ waveform = (audio[0] * 32767).astype(np.int16)
 
97
  return (sampling_rate, waveform), "Done."
98
 
99