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
AutoAWQ
Commits
ba4da393
Commit
ba4da393
authored
Sep 12, 2023
by
Casper Hansen
Browse files
Fix Falcon inputs ids
parent
f03f72de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
awq/modules/fused/model.py
awq/modules/fused/model.py
+5
-0
No files found.
awq/modules/fused/model.py
View file @
ba4da393
...
...
@@ -43,6 +43,11 @@ class FalconModel(nn.Module):
@
torch
.
inference_mode
()
def
forward
(
self
,
input_ids
,
attn_bias
=
None
,
attention_mask
=
None
,
is_causal
=
None
,
*
args
,
**
kwargs
):
# NOTE: falcon input ids contain full context
# after context is processed, slice to latest token
if
self
.
blocks
[
0
].
attn
.
start_pos
!=
0
and
input_ids
.
shape
[
-
1
]
!=
1
:
input_ids
=
input_ids
[:,
self
.
blocks
[
0
].
attn
.
start_pos
:]
_bsz
,
seqlen
=
input_ids
.
shape
h
=
self
.
word_embeddings
(
input_ids
)
...
...
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