-
Notifications
You must be signed in to change notification settings - Fork 299
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
Qwen2-1.5B not work. Only output many “!” #589
Comments
Can you check the prompt template by printing |
Sorry for late. Template seems normal. # python -m sglang.launch_server --model-path /data/images/llms/huggingface/hub/models--Qwen--Qwen2-1.5B-Instruct/snapshots/ba1cf1846d7df0a0591d6c00649f57e798519da8 --port 5000 --trust-remote-code --tp-size 1 2>&1 | tee sglang.log
# python -m sglang.launch_server --model-path /data/images/llms/huggingface/hub/models--Qwen--Qwen2-1.5B-Instruct/snapshots/ba1cf1846d7df0a0591d6c00649f57e798519da8 --port 5000 --trust-remote-code --tp-size 1 --attention-reduce-in-fp32 2>&1 | tee sglang.log
# both not work
import sglang as sgl
@sgl.function
def sglang_build_qwen_prompt(s, question):
s += sgl.system("You are a helpful assistant.")
s += sgl.user(question)
# s += "<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n"
# s += f"<|im_start|>user\n{question}<|im_end|>\n"
# s += "<|im_start|>assistant\n"
s += sgl.assistant(sgl.gen(
name='output',
temperature=0,
max_tokens=40,
))
print(f"s.text():\n{s.text()}")
sgl.set_default_backend(sgl.RuntimeEndpoint(base_url='http://127.0.0.1:5000'))
output = sglang_build_qwen_prompt.run(
question="Hello, Please Introduce yourself."
)
print(output.messages()) I got output as
I also tried to add the template manually. Is the template right? # python -m sglang.launch_server --model-path /data/images/llms/huggingface/hub/models--Qwen--Qwen2-1.5B-Instruct/snapshots/ba1cf1846d7df0a0591d6c00649f57e798519da8 --port 5000 --trust-remote-code --tp-size 1 2>&1 | tee sglang.log
# python -m sglang.launch_server --model-path /data/images/llms/huggingface/hub/models--Qwen--Qwen2-1.5B-Instruct/snapshots/ba1cf1846d7df0a0591d6c00649f57e798519da8 --port 5000 --trust-remote-code --tp-size 1 --attention-reduce-in-fp32 2>&1 | tee sglang.log
# both not work
import sglang as sgl
@sgl.function
def sglang_build_qwen_prompt(s, question):
# s += sgl.system("You are a helpful assistant.")
# s += sgl.user(question)
s += "<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n"
s += f"<|im_start|>user\n{question}<|im_end|>\n"
s += "<|im_start|>assistant\n"
s += sgl.gen(
name='output',
temperature=0,
max_tokens=40,
)
print(f"s.text():\n{s.text()}")
sgl.set_default_backend(sgl.RuntimeEndpoint(base_url='http://127.0.0.1:5000'))
output = sglang_build_qwen_prompt.run(
question="Hello, Please Introduce yourself."
)
# print(output.messages()) Output:
|
ref #630 |
Thanks a lot. I will close this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My environment:
sglang 0.1.17
torch 2.3.0
CUDA 11.8
My Problem:
My sglang works well on qwen1.5-4B and qwen1.5-0.5B. But not work on qwen2-1.5B. Outputs is all "!"
My test script:
My script ouputs:
The text was updated successfully, but these errors were encountered: