Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
fclong
/
summary
like
1
Runtime error
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
ff95e09
summary
/
fengshen
/
data
/
data_utils
/
common_utils.py
fclong
Upload 396 files
8ebda9e
almost 2 years ago
raw
Copy download link
history
blame
Safe
180 Bytes
def
padding_to_maxlength
(
ids, max_length, pad_id
):
cur_len =
len
(ids)
len_diff = max_length -
len
(ids)
return
ids + [pad_id] * len_diff, [
1
] * cur_len + [
0
] * len_diff