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
wangsen
paddle_dbnet
Commits
f671f133
Commit
f671f133
authored
Jan 12, 2022
by
WenmuZhou
Browse files
move chunk to infer model
parent
c703a589
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
ppocr/data/imaug/vqa/token/vqa_token_pad.py
ppocr/data/imaug/vqa/token/vqa_token_pad.py
+7
-4
No files found.
ppocr/data/imaug/vqa/token/vqa_token_pad.py
View file @
f671f133
...
@@ -94,8 +94,11 @@ class VQATokenPad(object):
...
@@ -94,8 +94,11 @@ class VQATokenPad(object):
'input_ids'
,
'labels'
,
'token_type_ids'
,
'bbox'
,
'input_ids'
,
'labels'
,
'token_type_ids'
,
'bbox'
,
'attention_mask'
'attention_mask'
]:
]:
if
self
.
infer_mode
and
key
==
'labels'
:
if
self
.
infer_mode
:
continue
if
key
!=
'labels'
:
length
=
min
(
len
(
data
[
key
]),
self
.
max_seq_len
)
length
=
min
(
len
(
data
[
key
]),
self
.
max_seq_len
)
data
[
key
]
=
np
.
array
(
data
[
key
][:
length
],
dtype
=
'int64'
)
data
[
key
]
=
data
[
key
][:
length
]
else
:
continue
data
[
key
]
=
np
.
array
(
data
[
key
],
dtype
=
'int64'
)
return
data
return
data
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