[fix] bugs
parent
af06c632ee
commit
f7b0a325c1
|
|
@ -6,6 +6,7 @@ transformers==4.57.6
|
||||||
speechbrain==1.1.0
|
speechbrain==1.1.0
|
||||||
onnxruntime==1.23.2
|
onnxruntime==1.23.2
|
||||||
funasr==1.3.1
|
funasr==1.3.1
|
||||||
|
addict==2.4.0
|
||||||
flask==3.0.3
|
flask==3.0.3
|
||||||
flask-cors==6.0.1
|
flask-cors==6.0.1
|
||||||
flask-sock==0.7.0
|
flask-sock==0.7.0
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ def build_ids(prompt, history):
|
||||||
def _mimi_decode(frames):
|
def _mimi_decode(frames):
|
||||||
codes = [f for f in frames if f and len(f) == 8]
|
codes = [f for f in frames if f and len(f) == 8]
|
||||||
if not codes or not M['mimi']: return None
|
if not codes or not M['mimi']: return None
|
||||||
mc = torch.tensor(codes, dtype=torch.long).T.unsqueeze(0)
|
mc = torch.tensor(codes, dtype=torch.long, device=M['device']).T.unsqueeze(0)
|
||||||
mc = torch.where(mc >= 2049, torch.zeros_like(mc), mc)
|
mc = torch.where(mc >= 2049, torch.zeros_like(mc), mc)
|
||||||
with torch.no_grad():
|
with torch.no_grad():
|
||||||
au = M['mimi'].decode(mc).audio_values.squeeze().cpu().numpy()
|
au = M['mimi'].decode(mc).audio_values.squeeze().cpu().numpy()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue