ictnlp / LLaMA-Omni

LLaMA-Omni is a low-latency and high-quality end-to-end speech interaction model built upon Llama-3.1-8B-Instruct, aiming to achieve speech capabilities at the GPT-4o level.
https://arxiv.org/abs/2409.06666
Apache License 2.0
2.61k stars 175 forks source link

Automatically exit while Launch a model worker. #31

Open JV-X opened 2 months ago

JV-X commented 2 months ago

I am following the steps in the readme.md document to install the environment on my Windows computer. When I execute

python -m omni_speech.serve.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port 40000 --worker http://localhost:40000 --model-path Llama-3.1-8B-Omni --model-name Llama-3.1-8B-Omni --s2s 

, the program automatically exits. What could be the reason? Could you help me take a look?

here is my error log

(llama-omni) D:\repo\LLaMA-Omni>python -m omni_speech.serve.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port 40000 --worker http://localhost:40000 --model-path Llama-3.1-8B-Omni --model-name Llama-3.1-8B-Omni --s2s
2024-09-29 10:10:56 | INFO | model_worker | args: Namespace(host='0.0.0.0', port=40000, worker_address='http://localhost:40000', controller_address='http://localhost:10000', model_path='Llama-3.1-8B-Omni', model_base=None, model_name='Llama-3.1-8B-Omni', device='cuda', limit_model_concurrency=5, stream_interval=1, no_register=False, load_8bit=False, load_4bit=False, use_flash_attn=False, input_type='mel', mel_size=128, s2s=True, is_lora=False)
2024-09-29 10:10:57 | ERROR | stderr | D:\anaconda\envs\llama-omni\lib\site-packages\whisper\__init__.py:146: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
2024-09-29 10:10:57 | ERROR | stderr |   checkpoint = torch.load(fp, map_location=device)
Loading checkpoint shards:   0%|                                                                 | 0/4 [00:00<?, ?it/s]
Loading checkpoint shards:  25%|██████████████▎                                          | 1/4 [00:01<00:03,  1.24s/it]

(llama-omni) D:\repo\LLaMA-Omni>
mingtop commented 2 months ago

Got some error. Hope authors to advice how to solve this problem:

2024-09-27 13:20:07 | INFO | model_worker | args: Namespace(host='0.0.0.0', port=40000, worker_address='http://localhost:40000', controller_address='http://localhost:10000', model_path='Llama-3.1-8B-Omni', model_base=None, model_name='Llama-3.1-8B-Omni', device='cuda', limit_model_concurrency=5, stream_interval=1, no_register=False, load_8bit=False, load_4bit=False, use_flash_attn=False, input_type='mel', mel_size=128, s2s=True, is_lora=False) 2024-09-27 13:20:09 | ERROR | stderr | Traceback (most recent call last): 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/runpy.py", line 196, in _run_module_as_main 2024-09-27 13:20:09 | ERROR | stderr | return _run_code(code, main_globals, None, 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/runpy.py", line 86, in _run_code 2024-09-27 13:20:09 | ERROR | stderr | exec(code, run_globals) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/serve/model_worker.py", line 277, in 2024-09-27 13:20:09 | ERROR | stderr | worker = ModelWorker(args.controller_address, 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/serve/model_worker.py", line 83, in init 2024-09-27 13:20:09 | ERROR | stderr | self.tokenizer, self.model, self.context_len = load_pretrained_model( 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/builder.py", line 79, in load_pretrained_model 2024-09-27 13:20:09 | ERROR | stderr | model = model_cls.from_pretrained( 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3798, in from_pretrained 2024-09-27 13:20:09 | ERROR | stderr | model = cls(config, *model_args, *model_kwargs) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/language_model/omni_speech2s_llama.py", line 25, in init 2024-09-27 13:20:09 | ERROR | stderr | super().init(config) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/language_model/omni_speech_llama.py", line 46, in init 2024-09-27 13:20:09 | ERROR | stderr | self.model = OmniSpeechLlamaModel(config) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/language_model/omni_speech_llama.py", line 38, in init 2024-09-27 13:20:09 | ERROR | stderr | super(OmniSpeechLlamaModel, self).init(config) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/omni_speech_arch.py", line 32, in init 2024-09-27 13:20:09 | ERROR | stderr | self.speech_encoder = build_speech_encoder(config) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/speech_encoder/builder.py", line 7, in build_speech_encoder 2024-09-27 13:20:09 | ERROR | stderr | return WhisperWrappedEncoder.load(config) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/speech_encoder/speech_encoder.py", line 28, in load 2024-09-27 13:20:09 | ERROR | stderr | encoder = whisper.load_model(name=model_config.speech_encoder, device=device).encoder.to(dtype) 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/site-packages/whisper/init.py", line 150, in load_model 2024-09-27 13:20:09 | ERROR | stderr | model = Whisper(dims) 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/site-packages/whisper/model.py", line 225, in init 2024-09-27 13:20:09 | ERROR | stderr | self.encoder = AudioEncoder( 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/site-packages/whisper/model.py", line 150, in init 2024-09-27 13:20:09 | ERROR | stderr | self.register_buffer("positional_embedding", sinusoids(n_ctx, n_state)) 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/site-packages/whisper/model.py", line 57, in sinusoids 2024-09-27 13:20:09 | ERROR | stderr | inv_timescales = torch.exp(-log_timescale_increment torch.arange(channels // 2)) 2024-09-27 13:20:09 | ERROR | stderr | RuntimeError: "exp_vml_cpu" not implemented for 'Half' (llama-omni) user@ HPC:/data1/git_proj/LLaMA-Omni$

ZhengRachel commented 1 month ago

Got some error. Hope authors to advice how to solve this problem:

2024-09-27 13:20:07 | INFO | model_worker | args: Namespace(host='0.0.0.0', port=40000, worker_address='http://localhost:40000', controller_address='http://localhost:10000', model_path='Llama-3.1-8B-Omni', model_base=None, model_name='Llama-3.1-8B-Omni', device='cuda', limit_model_concurrency=5, stream_interval=1, no_register=False, load_8bit=False, load_4bit=False, use_flash_attn=False, input_type='mel', mel_size=128, s2s=True, is_lora=False) 2024-09-27 13:20:09 | ERROR | stderr | Traceback (most recent call last): 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/runpy.py", line 196, in _run_module_as_main 2024-09-27 13:20:09 | ERROR | stderr | return _run_code(code, main_globals, None, 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/runpy.py", line 86, in _run_code 2024-09-27 13:20:09 | ERROR | stderr | exec(code, run_globals) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/serve/model_worker.py", line 277, in 2024-09-27 13:20:09 | ERROR | stderr | worker = ModelWorker(args.controller_address, 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/serve/model_worker.py", line 83, in init 2024-09-27 13:20:09 | ERROR | stderr | self.tokenizer, self.model, self.context_len = load_pretrained_model( 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/builder.py", line 79, in load_pretrained_model 2024-09-27 13:20:09 | ERROR | stderr | model = model_cls.from_pretrained( 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3798, in from_pretrained 2024-09-27 13:20:09 | ERROR | stderr | model = cls(config, *model_args, model_kwargs) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/language_model/omni_speech2s_llama.py", line 25, in init 2024-09-27 13:20:09 | ERROR | stderr | super().init(config) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/language_model/omni_speech_llama.py", line 46, in init 2024-09-27 13:20:09 | ERROR | stderr | self.model = OmniSpeechLlamaModel(config) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/language_model/omni_speech_llama.py", line 38, in init 2024-09-27 13:20:09 | ERROR | stderr | super(OmniSpeechLlamaModel, self).init(config) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/omni_speech_arch.py", line 32, in init 2024-09-27 13:20:09 | ERROR | stderr | self.speech_encoder = build_speech_encoder(config) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/speech_encoder/builder.py", line 7, in build_speech_encoder 2024-09-27 13:20:09 | ERROR | stderr | return WhisperWrappedEncoder.load(config) 2024-09-27 13:20:09 | ERROR | stderr | File "/data1/git_proj/LLaMA-Omni/omni_speech/model/speech_encoder/speech_encoder.py", line 28, in load 2024-09-27 13:20:09 | ERROR | stderr | encoder = whisper.load_model(name=model_config.speech_encoder, device=device).encoder.to(dtype) 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/site-packages/whisper/init.py", line 150, in load_model 2024-09-27 13:20:09 | ERROR | stderr | model = Whisper(dims) 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/site-packages/whisper/model.py", line 225, in init 2024-09-27 13:20:09 | ERROR | stderr | self.encoder = AudioEncoder( 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/site-packages/whisper/model.py", line 150, in init* 2024-09-27 13:20:09 | ERROR | stderr | self.register_buffer("positional_embedding", sinusoids(n_ctx, n_state)) 2024-09-27 13:20:09 | ERROR | stderr | File "/home/user/anaconda3/envs/llama-omni/lib/python3.10/site-packages/whisper/model.py", line 57, in sinusoids 2024-09-27 13:20:09 | ERROR | stderr | inv_timescales = torch.exp(-log_timescale_increment torch.arange(channels // 2)) 2024-09-27 13:20:09 | ERROR | stderr | RuntimeError: "exp_vml_cpu" not implemented for 'Half' (llama-omni) user@ HPC:/data1/git_proj/LLaMA-Omni$

Same here. I followed the set up in the readme and bash omni_speech/infer/run.sh omni_speech/infer/examples but encounter this error Traceback (most recent call last): File "/home/rczheng/LLaMA-Omni/omni_speech/infer/infer.py", line 181, in <module> eval_model(args) File "/home/rczheng/LLaMA-Omni/omni_speech/infer/infer.py", line 94, in eval_model tokenizer, model, context_len = load_pretrained_model(model_path, args.model_base, is_lora=args.is_lora, s2s=args.s2s) File "/home/rczheng/LLaMA-Omni/omni_speech/model/builder.py", line 79, in load_pretrained_model model = model_cls.from_pretrained( File "/home/rczheng/anaconda3/envs/llama-omni/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3798, in from_pretrained model = cls(config, *model_args, **model_kwargs) File "/home/rczheng/LLaMA-Omni/omni_speech/model/language_model/omni_speech2s_llama.py", line 25, in __init__ super().__init__(config) File "/home/rczheng/LLaMA-Omni/omni_speech/model/language_model/omni_speech_llama.py", line 46, in __init__ self.model = OmniSpeechLlamaModel(config) File "/home/rczheng/LLaMA-Omni/omni_speech/model/language_model/omni_speech_llama.py", line 38, in __init__ super(OmniSpeechLlamaModel, self).__init__(config) File "/home/rczheng/LLaMA-Omni/omni_speech/model/omni_speech_arch.py", line 32, in __init__ self.speech_encoder = build_speech_encoder(config) File "/home/rczheng/LLaMA-Omni/omni_speech/model/speech_encoder/builder.py", line 7, in build_speech_encoder return WhisperWrappedEncoder.load(config) File "/home/rczheng/LLaMA-Omni/omni_speech/model/speech_encoder/speech_encoder.py", line 26, in load encoder = whisper.load_model(name=model_config.speech_encoder, device='cpu').encoder File "/home/rczheng/anaconda3/envs/llama-omni/lib/python3.10/site-packages/whisper/__init__.py", line 154, in load_model model = Whisper(dims) File "/home/rczheng/anaconda3/envs/llama-omni/lib/python3.10/site-packages/whisper/model.py", line 256, in __init__ self.encoder = AudioEncoder( File "/home/rczheng/anaconda3/envs/llama-omni/lib/python3.10/site-packages/whisper/model.py", line 181, in __init__ self.register_buffer("positional_embedding", sinusoids(n_ctx, n_state)) File "/home/rczheng/anaconda3/envs/llama-omni/lib/python3.10/site-packages/whisper/model.py", line 66, in sinusoids inv_timescales = torch.exp(-log_timescale_increment * torch.arange(channels // 2)) RuntimeError: "exp_vml_cpu" not implemented for 'Half'