Compare commits
No commits in common. "f7b0a325c13540ebab00b8e753b6f18a77d5c771" and "0d1ae504f29397820f097aca965e46570f803c0f" have entirely different histories.
f7b0a325c1
...
0d1ae504f2
|
|
@ -6,7 +6,6 @@ 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, device=M['device']).T.unsqueeze(0)
|
mc = torch.tensor(codes, dtype=torch.long).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()
|
||||||
|
|
@ -486,7 +486,7 @@ def init_model(args):
|
||||||
au = torch.full((1, 8, 3), 2049, dtype=torch.long, device=args.device)
|
au = torch.full((1, 8, 3), 2049, dtype=torch.long, device=args.device)
|
||||||
M['model'].forward(torch.cat((au, ids.unsqueeze(1)), dim=1))
|
M['model'].forward(torch.cat((au, ids.unsqueeze(1)), dim=1))
|
||||||
if M['model'].audio_encoder: M['model'].audio_encoder(torch.zeros(1, 100, 560, device=args.device), torch.tensor([100], device=args.device))
|
if M['model'].audio_encoder: M['model'].audio_encoder(torch.zeros(1, 100, 560, device=args.device), torch.tensor([100], device=args.device))
|
||||||
if M['mimi']: M['mimi'].decode(torch.zeros(1, 8, 1, dtype=torch.long, device=args.device))
|
if M['mimi']: M['mimi'].decode(torch.zeros(1, 8, 1, dtype=torch.long))
|
||||||
print('Warmup done!')
|
print('Warmup done!')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue