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
3a9cdc32
Unverified
Commit
3a9cdc32
authored
Oct 28, 2024
by
Nicolas Patry
Committed by
GitHub
Oct 28, 2024
Browse files
Fixing auto bloom test. (#2699)
parent
78ce618c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
server/text_generation_server/models/custom_modeling/bloom_modeling.py
...eneration_server/models/custom_modeling/bloom_modeling.py
+2
-2
No files found.
server/text_generation_server/models/custom_modeling/bloom_modeling.py
View file @
3a9cdc32
...
@@ -377,7 +377,7 @@ class BloomAttention(nn.Module):
...
@@ -377,7 +377,7 @@ class BloomAttention(nn.Module):
past_value
.
view
(
-
1
,
*
past_value
.
shape
[
-
2
:]),
past_value
.
view
(
-
1
,
*
past_value
.
shape
[
-
2
:]),
)
)
if
CUSTOM_KERNELS_ENABLED
:
if
CUSTOM_KERNELS_ENABLED
and
attention_mask
.
shape
[
-
1
]
<
4096
:
assert
self
.
training
is
False
,
"Only foward pass was implemented"
assert
self
.
training
is
False
,
"Only foward pass was implemented"
assert
(
assert
(
attention_mask
.
shape
[
-
1
]
<
4096
attention_mask
.
shape
[
-
1
]
<
4096
...
@@ -580,7 +580,7 @@ class BloomPreTrainedModel(PreTrainedModel):
...
@@ -580,7 +580,7 @@ class BloomPreTrainedModel(PreTrainedModel):
@
staticmethod
@
staticmethod
def
_convert_to_bloom_cache
(
def
_convert_to_bloom_cache
(
past_key_value
:
Tuple
[
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]]
past_key_value
:
Tuple
[
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]]
,
)
->
Tuple
[
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]]:
)
->
Tuple
[
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]]:
"""
"""
Converts the cache to the format expected by Bloom, i.e. to tuple(tuple([batch_size * num_heads, ...]))
Converts the cache to the format expected by Bloom, i.e. to tuple(tuple([batch_size * num_heads, ...]))
...
...
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