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
8332fc49
Unverified
Commit
8332fc49
authored
Apr 30, 2024
by
OlivierDehaene
Committed by
GitHub
Apr 30, 2024
Browse files
fix: use get_speculate to the number of layers (#1737)
parent
743ecbca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
server/text_generation_server/utils/layers.py
server/text_generation_server/utils/layers.py
+4
-3
No files found.
server/text_generation_server/utils/layers.py
View file @
8332fc49
...
@@ -8,7 +8,8 @@ from typing import List, Tuple, Optional
...
@@ -8,7 +8,8 @@ from typing import List, Tuple, Optional
from
loguru
import
logger
from
loguru
import
logger
from
functools
import
lru_cache
from
functools
import
lru_cache
# Dummy comment.
from
text_generation_server.utils.speculate
import
get_speculate
HAS_BITS_AND_BYTES
=
True
HAS_BITS_AND_BYTES
=
True
try
:
try
:
import
bitsandbytes
as
bnb
import
bitsandbytes
as
bnb
...
@@ -445,7 +446,7 @@ class MedusaModel(torch.nn.Module):
...
@@ -445,7 +446,7 @@ class MedusaModel(torch.nn.Module):
self
.
heads
=
torch
.
nn
.
ModuleList
(
self
.
heads
=
torch
.
nn
.
ModuleList
(
[
[
MedusaHead
(
config
,
medusa_config
,
prefix
=
f
"
{
i
}
"
,
weights
=
weights
)
MedusaHead
(
config
,
medusa_config
,
prefix
=
f
"
{
i
}
"
,
weights
=
weights
)
for
i
in
range
(
medusa_config
[
"medusa_num_heads"
]
)
for
i
in
range
(
get_speculate
()
)
]
]
)
)
...
@@ -542,7 +543,7 @@ class MedusaHeadV2(nn.Module):
...
@@ -542,7 +543,7 @@ class MedusaHeadV2(nn.Module):
)
)
routing
[
k
]
=
filename
routing
[
k
]
=
filename
self
.
n_medusa_heads
=
medusa_config
[
"medusa_num_heads"
]
self
.
n_medusa_heads
=
get_speculate
()
assert
medusa_config
[
"medusa_num_layers"
]
==
1
assert
medusa_config
[
"medusa_num_layers"
]
==
1
self
.
linear
=
TensorParallelColumnLinear
.
load_multi
(
self
.
linear
=
TensorParallelColumnLinear
.
load_multi
(
...
...
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