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
ModelZoo
donut_pytorch
Commits
68b30a37
Unverified
Commit
68b30a37
authored
Oct 05, 2022
by
Geewook Kim
Committed by
GitHub
Oct 05, 2022
Browse files
fix: prepare_inputs_for_inference (this also supports 4.11.3)
parent
3e809211
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
donut/model.py
donut/model.py
+1
-1
No files found.
donut/model.py
View file @
68b30a37
...
...
@@ -206,7 +206,7 @@ class BARTDecoder(nn.Module):
if
newly_added_num
>
0
:
self
.
model
.
resize_token_embeddings
(
len
(
self
.
tokenizer
))
def
prepare_inputs_for_inference
(
self
,
input_ids
:
torch
.
Tensor
,
past
=
None
,
use_cache
:
bool
=
None
,
encoder_outputs
:
torch
.
Tensor
=
None
):
def
prepare_inputs_for_inference
(
self
,
input_ids
:
torch
.
Tensor
,
encoder_outputs
:
torch
.
Tensor
,
past
=
None
,
use_cache
:
bool
=
None
,
attention_mask
:
torch
.
Tensor
=
None
):
"""
Args:
input_ids: (batch_size, sequence_lenth)
...
...
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