Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Lm.warmup() missing 1 required positional argument: 'ct' #237

Open
hzeng-otterai opened this issue Mar 5, 2025 · 3 comments
Open
Labels
bug Something isn't working

Comments

@hzeng-otterai
Copy link

Backend impacted

The MLX implementation

Operating system

Linux

Hardware

CPU

Description

Hi, I am running the following command on a Mac laptop and got the following error. Searched for it but can't find any related issues.

% python -m moshi_mlx.local_web
[Info] [SERVER] loading text tokenizer /Users/***/.cache/huggingface/hub/models--kyutai--moshiko-mlx-bf16/snapshots/a31ebad976783a3ea356d6beb8b8e826d2d45a68/tokenizer_spm_32k_3.model
[Info] [SERVER] loading weights /Users/***//.cache/huggingface/hub/models--kyutai--moshiko-mlx-bf16/snapshots/a31ebad976783a3ea356d6beb8b8e826d2d45a68/model.safetensors
[Info] [SERVER] weights loaded
Process Process-2:
Traceback (most recent call last):
  File "/Users/***//miniconda3/envs/moshi/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/Users/***//miniconda3/envs/moshi/lib/python3.12/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/***//miniconda3/envs/moshi/lib/python3.12/site-packages/moshi_mlx/local_web.py", line 132, in model_server
    model.warmup()
TypeError: Lm.warmup() missing 1 required positional argument: 'ct'

Extra information

As above

Environment

Fill in the following information on your system.

  • Operating system version: Mac OS 15.3

If the backend impacted is PyTorch:

  • Python version:
  • PyTorch version:
  • CUDA version (run python -c 'import torch; print(torch.version.cuda)'):
  • GPU model and memory:

If the backend is MLX:

  • Mac model: Apple M1 Pro with 16GB memory, Mac OS 15.3
@hzeng-otterai hzeng-otterai added the bug Something isn't working label Mar 5, 2025
@hzeng-otterai
Copy link
Author

Python version is 3.12.9.

@CuriousMonkey7
Copy link

same issue

@CuriousMonkey7
Copy link

@hzeng-otterai It turns out they forgot to set the default value of ct to None. This has been fixed in the code now.

def warmup(self, ct: ConditionTensor | None = None):
text, audio = self.sample(
mx.array([[self.cfg.text_out_vocab_size]]),
[mx.array([[0]])] * self.cfg.other_codebooks,
text_sampler=sampling.Sampler(),
audio_sampler=sampling.Sampler(),
ct=ct,
)

You can uninstall the current version and use the following command to install the latest version:

pip install -U -e "git+https://[email protected]/kyutai-labs/moshi.git#egg=moshi_mlx&subdirectory=moshi_mlx"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants