Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
a7ace9c8
Unverified
Commit
a7ace9c8
authored
Mar 11, 2024
by
Liangsheng Yin
Committed by
GitHub
Mar 10, 2024
Browse files
Fix qwen config (#261)
parent
a833de05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
python/pyproject.toml
python/pyproject.toml
+1
-1
python/sglang/srt/models/qwen.py
python/sglang/srt/models/qwen.py
+4
-4
No files found.
python/pyproject.toml
View file @
a7ace9c8
...
@@ -19,7 +19,7 @@ dependencies = [
...
@@ -19,7 +19,7 @@ dependencies = [
[project.optional-dependencies]
[project.optional-dependencies]
srt
=
[
"aiohttp"
,
"fastapi"
,
"psutil"
,
"rpyc"
,
"torch"
,
"uvloop"
,
"uvicorn"
,
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"
]
"pydantic"
,
"referencing"
,
"diskcache"
,
"cloudpickle"
,
"pillow"
,
"outlines>=0.0.27"
]
openai
=
[
"openai>=1.0"
,
"numpy"
]
openai
=
[
"openai>=1.0"
,
"numpy"
]
anthropic
=
[
"anthropic"
,
"numpy"
]
anthropic
=
[
"anthropic"
,
"numpy"
]
...
...
python/sglang/srt/models/qwen.py
View file @
a7ace9c8
...
@@ -5,6 +5,7 @@ from sglang.srt.layers.logits_processor import LogitsProcessor
...
@@ -5,6 +5,7 @@ from sglang.srt.layers.logits_processor import LogitsProcessor
from
sglang.srt.layers.radix_attention
import
RadixAttention
from
sglang.srt.layers.radix_attention
import
RadixAttention
from
sglang.srt.managers.router.model_runner
import
InputMetadata
from
sglang.srt.managers.router.model_runner
import
InputMetadata
from
torch
import
nn
from
torch
import
nn
from
transformers
import
PretrainedConfig
from
vllm.model_executor.layers.activation
import
SiluAndMul
from
vllm.model_executor.layers.activation
import
SiluAndMul
from
vllm.model_executor.layers.layernorm
import
RMSNorm
from
vllm.model_executor.layers.layernorm
import
RMSNorm
from
vllm.model_executor.layers.linear
import
(
from
vllm.model_executor.layers.linear
import
(
...
@@ -25,7 +26,6 @@ from vllm.model_executor.weight_utils import (
...
@@ -25,7 +26,6 @@ from vllm.model_executor.weight_utils import (
default_weight_loader
,
default_weight_loader
,
hf_model_weights_iterator
,
hf_model_weights_iterator
,
)
)
from
vllm.transformers_utils.configs.qwen
import
QWenConfig
class
QWenMLP
(
nn
.
Module
):
class
QWenMLP
(
nn
.
Module
):
...
@@ -130,7 +130,7 @@ class QWenAttention(nn.Module):
...
@@ -130,7 +130,7 @@ class QWenAttention(nn.Module):
class
QWenBlock
(
nn
.
Module
):
class
QWenBlock
(
nn
.
Module
):
def
__init__
(
self
,
config
:
QWen
Config
,
layer_id
,
linear_method
=
None
):
def
__init__
(
self
,
config
:
Pretrained
Config
,
layer_id
,
linear_method
=
None
):
super
().
__init__
()
super
().
__init__
()
self
.
ln_1
=
RMSNorm
(
config
.
hidden_size
,
eps
=
config
.
layer_norm_epsilon
)
self
.
ln_1
=
RMSNorm
(
config
.
hidden_size
,
eps
=
config
.
layer_norm_epsilon
)
...
@@ -179,7 +179,7 @@ class QWenBlock(nn.Module):
...
@@ -179,7 +179,7 @@ class QWenBlock(nn.Module):
class
QWenModel
(
nn
.
Module
):
class
QWenModel
(
nn
.
Module
):
def
__init__
(
self
,
config
:
QWen
Config
,
linear_method
=
None
):
def
__init__
(
self
,
config
:
Pretrained
Config
,
linear_method
=
None
):
super
().
__init__
()
super
().
__init__
()
self
.
config
=
config
self
.
config
=
config
self
.
vocab_size
=
config
.
vocab_size
self
.
vocab_size
=
config
.
vocab_size
...
@@ -216,7 +216,7 @@ class QWenModel(nn.Module):
...
@@ -216,7 +216,7 @@ class QWenModel(nn.Module):
class
QWenLMHeadModel
(
nn
.
Module
):
class
QWenLMHeadModel
(
nn
.
Module
):
def
__init__
(
self
,
config
:
QWen
Config
,
linear_method
=
None
):
def
__init__
(
self
,
config
:
Pretrained
Config
,
linear_method
=
None
):
super
().
__init__
()
super
().
__init__
()
self
.
config
=
config
self
.
config
=
config
self
.
transformer
=
QWenModel
(
config
,
linear_method
=
linear_method
)
self
.
transformer
=
QWenModel
(
config
,
linear_method
=
linear_method
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment