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
OpenDAS
text-generation-inference
Commits
52647592
Commit
52647592
authored
May 22, 2024
by
huangwb
Browse files
fix qwen2 sliding_window logic bug
parent
aac64dda
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
server/text_generation_server/models/__init__.py
server/text_generation_server/models/__init__.py
+2
-0
server/text_generation_server/models/flash_qwen2.py
server/text_generation_server/models/flash_qwen2.py
+1
-0
No files found.
server/text_generation_server/models/__init__.py
View file @
52647592
...
@@ -527,6 +527,8 @@ def get_model(
...
@@ -527,6 +527,8 @@ def get_model(
if
model_type
==
"qwen2"
:
if
model_type
==
"qwen2"
:
sliding_window
=
config_dict
.
get
(
"sliding_window"
,
-
1
)
sliding_window
=
config_dict
.
get
(
"sliding_window"
,
-
1
)
use_sliding_window
=
config_dict
.
get
(
"use_sliding_window"
,
False
)
sliding_window
=
sliding_window
if
use_sliding_window
else
None
if
(
if
(
(
sliding_window
is
None
or
sliding_window
==
-
1
)
and
FLASH_ATTENTION
(
sliding_window
is
None
or
sliding_window
==
-
1
)
and
FLASH_ATTENTION
)
or
HAS_FLASH_ATTN_V2_CUDA
:
)
or
HAS_FLASH_ATTN_V2_CUDA
:
...
...
server/text_generation_server/models/flash_qwen2.py
View file @
52647592
...
@@ -54,6 +54,7 @@ class FlashQwen2(BaseFlashMistral):
...
@@ -54,6 +54,7 @@ class FlashQwen2(BaseFlashMistral):
)
)
config
.
quantize
=
quantize
config
.
quantize
=
quantize
config
.
use_medusa
=
use_medusa
config
.
use_medusa
=
use_medusa
config
.
sliding_window
=
config
.
sliding_window
if
config
.
use_sliding_window
else
None
# Set context windows
# Set context windows
if
config
.
sliding_window
is
not
None
:
if
config
.
sliding_window
is
not
None
:
...
...
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