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

can model Qwen/Qwen-VL-Chat work well? #962

Closed
wangschang opened this issue Sep 6, 2023 · 11 comments · Fixed by #8029
Closed

can model Qwen/Qwen-VL-Chat work well? #962

wangschang opened this issue Sep 6, 2023 · 11 comments · Fixed by #8029
Labels
new model Requests to new models

Comments

@wangschang
Copy link

when i use Qwen/Qwen-VL-Chat I do not know why!

throw a error

Traceback (most recent call last): File "test.py", line 20, in <module> model = LLM(model=model_path, tokenizer=model_path,tokenizer_mode='slow',tensor_parallel_size=1,trust_remote_code=True) File "/usr/local/miniconda3/lib/python3.8/site-packages/vllm/entrypoints/llm.py", line 66, in __init__ self.llm_engine = LLMEngine.from_engine_args(engine_args) File "/usr/local/miniconda3/lib/python3.8/site-packages/vllm/engine/llm_engine.py", line 220, in from_engine_args engine = cls(*engine_configs, File "/usr/local/miniconda3/lib/python3.8/site-packages/vllm/engine/llm_engine.py", line 101, in __init__ self._init_workers(distributed_init_method) File "/usr/local/miniconda3/lib/python3.8/site-packages/vllm/engine/llm_engine.py", line 133, in _init_workers self._run_workers( File "/usr/local/miniconda3/lib/python3.8/site-packages/vllm/engine/llm_engine.py", line 470, in _run_workers output = executor(*args, **kwargs) File "/usr/local/miniconda3/lib/python3.8/site-packages/vllm/worker/worker.py", line 67, in init_model self.model = get_model(self.model_config) File "/usr/local/miniconda3/lib/python3.8/site-packages/vllm/model_executor/model_loader.py", line 57, in get_model model.load_weights(model_config.model, model_config.download_dir, File "/usr/local/miniconda3/lib/python3.8/site-packages/vllm/model_executor/models/qwen.py", line 308, in load_weights param = state_dict[name] KeyError: 'transformer.visual.positional_embedding'

the code is

`from vllm import LLM, SamplingParams
from transformers import AutoModelForCausalLM, AutoTokenizer,AutoConfig
import time

model_path="Qwen/Qwen-VL-Chat"

model = LLM(model=model_path, tokenizer=model_path,tokenizer_mode='slow',tensor_parallel_size=1,trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_path, legacy=True, trust_remote_code=True)

sampling_params = SamplingParams(temperature=0,max_tokens=8096)
start=time.time()
prompts = ["你好!"]
outputs = model.generate(prompts, sampling_params)
end = time.time()
for output in outputs:
prompt = output.prompt
generated_text = output.outputs[0].text
length = len(generated_text)
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
print(end-start)
cost = end-start
print(f"{length/cost}tokens/s")`

@iFe1er
Copy link

iFe1er commented Nov 14, 2023

same question here

@hntee
Copy link

hntee commented Dec 29, 2023

Same issue. I think this is because model_executor/models/qwen.py is only for Qwen-7B-Chat, not compatible with Qwen-VL.
https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/models/qwen.py

@ruifengma
Copy link

same issue

@linzm1007
Copy link

有解决了没

@NDDec
Copy link

NDDec commented May 28, 2024

same issue

@hmellor
Copy link
Collaborator

hmellor commented May 31, 2024

Please stop saying same issue, just react to the original message to show your support

@DamonFool
Copy link
Contributor

For text-only inputs, we can run the model with this patch #5710 .

@alex-jw-brooks
Copy link
Contributor

alex-jw-brooks commented Aug 7, 2024

I am looking into adding support for image inputs for Qwen-VL/Qwen-VL-Chat 😄

@hmellor
Copy link
Collaborator

hmellor commented Aug 27, 2024

@alex-jw-brooks thanks for the upcoming contribution!

When you have updates, please post them here as I've closed the other issues as duplicates.

@alex-jw-brooks
Copy link
Contributor

alex-jw-brooks commented Aug 28, 2024

Great, thank you @hmellor - It's almost ready, I've been able to load and get reasonable looking stuff out of qwen-vl/qwen-vl-chat, just need to work through some cleanup, small fixes, and tests. I will open the PR in the next couple of days 🤞

@alex-jw-brooks
Copy link
Contributor

alex-jw-brooks commented Aug 30, 2024

PR #8029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new model Requests to new models
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants