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

Fix qwen config #261

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies = [

[project.optional-dependencies]
srt = ["aiohttp", "fastapi", "psutil", "rpyc", "torch", "uvloop", "uvicorn",
"zmq", "vllm>=0.2.5", "interegular", "lark", "numba",
"zmq", "vllm>=0.3.3", "interegular", "lark", "numba",
"pydantic", "referencing", "diskcache", "cloudpickle", "pillow", "outlines>=0.0.27"]
openai = ["openai>=1.0", "numpy"]
anthropic = ["anthropic", "numpy"]
Expand Down
8 changes: 4 additions & 4 deletions python/sglang/srt/models/qwen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from sglang.srt.layers.radix_attention import RadixAttention
from sglang.srt.managers.router.model_runner import InputMetadata
from torch import nn
from transformers import PretrainedConfig
from vllm.model_executor.layers.activation import SiluAndMul
from vllm.model_executor.layers.layernorm import RMSNorm
from vllm.model_executor.layers.linear import (
Expand All @@ -25,7 +26,6 @@
default_weight_loader,
hf_model_weights_iterator,
)
from vllm.transformers_utils.configs.qwen import QWenConfig


class QWenMLP(nn.Module):
Expand Down Expand Up @@ -130,7 +130,7 @@ def forward(


class QWenBlock(nn.Module):
def __init__(self, config: QWenConfig, layer_id, linear_method=None):
def __init__(self, config: PretrainedConfig, layer_id, linear_method=None):
super().__init__()
self.ln_1 = RMSNorm(config.hidden_size, eps=config.layer_norm_epsilon)

Expand Down Expand Up @@ -179,7 +179,7 @@ def forward(


class QWenModel(nn.Module):
def __init__(self, config: QWenConfig, linear_method=None):
def __init__(self, config: PretrainedConfig, linear_method=None):
super().__init__()
self.config = config
self.vocab_size = config.vocab_size
Expand Down Expand Up @@ -216,7 +216,7 @@ def forward(


class QWenLMHeadModel(nn.Module):
def __init__(self, config: QWenConfig, linear_method=None):
def __init__(self, config: PretrainedConfig, linear_method=None):
super().__init__()
self.config = config
self.transformer = QWenModel(config, linear_method=linear_method)
Expand Down