Introducing LiteRT : Google's high-performance runtime for on-device AI, formerly known as TensorFlow Lite.
Learn more
Send feedback
tflite_support.metadata_writers.metadata_info.BertInputTensorsMd
Stay organized with collections
Save and categorize content based on your preferences.
A container for the input tensor metadata information of Bert models.
View aliases
Main aliases
tflite_support.metadata_writers.audio_classifier.metadata_info.BertInputTensorsMd
, tflite_support.metadata_writers.audio_classifier.metadata_writer.metadata_info.BertInputTensorsMd
, tflite_support.metadata_writers.bert_nl_classifier.metadata_info.BertInputTensorsMd
, tflite_support.metadata_writers.bert_nl_classifier.metadata_writer.metadata_info.BertInputTensorsMd
, tflite_support.metadata_writers.image_classifier.metadata_info.BertInputTensorsMd
, tflite_support.metadata_writers.image_classifier.metadata_writer.metadata_info.BertInputTensorsMd
, tflite_support.metadata_writers.image_segmenter.metadata_info.BertInputTensorsMd
, tflite_support.metadata_writers.image_segmenter.metadata_writer.metadata_info.BertInputTensorsMd
, tflite_support.metadata_writers.nl_classifier.metadata_info.BertInputTensorsMd
, tflite_support.metadata_writers.nl_classifier.metadata_writer.metadata_info.BertInputTensorsMd
, tflite_support.metadata_writers.object_detector.metadata_info.BertInputTensorsMd
, tflite_support.metadata_writers.object_detector.metadata_writer.metadata_info.BertInputTensorsMd
tflite_support . metadata_writers . metadata_info . BertInputTensorsMd (
model_buffer : bytearray ,
ids_name : str ,
mask_name : str ,
segment_name : str ,
ids_md : Optional [ tflite_support . metadata_writers . metadata_info . TensorMd
] = None ,
mask_md : Optional [ tflite_support . metadata_writers . metadata_info . TensorMd
] = None ,
segment_ids_md : Optional [ tflite_support . metadata_writers . metadata_info . TensorMd
] = None ,
tokenizer_md : Union [ None , tflite_support . metadata_writers . metadata_info . BertTokenizerMd
, tflite_support . metadata_writers . metadata_info . SentencePieceTokenizerMd
] = None
)
Args
model_buffer
valid buffer of the model file.
ids_name
name of the ids tensor, which represents the tokenized ids of
the input text.
mask_name
name of the mask tensor, which represents the mask with 1 for
real tokens and 0 for padding tokens.
segment_name
name of the segment ids tensor, where 0
stands for the
first sequence, and 1
stands for the second sequence if exists.
ids_md
input ids tensor informaton.
mask_md
input mask tensor informaton.
segment_ids_md
input segment tensor informaton.
tokenizer_md
information of the tokenizer used to process the input
string, if any. Supported tokenziers are: BertTokenizer
1 and
SentencePieceTokenizer
2 . If the tokenizer is RegexTokenizer
3 , refer to nl_classifier.MetadataWriter
.
Methods
View source
create_input_process_unit_metadata () -> List [ tflite_support . metadata_schema_py_generated . ProcessUnitT
]
Creates the input process unit metadata.
View source
create_input_tesnor_metadata () -> List [ tflite_support . metadata_schema_py_generated . TensorMetadataT
]
Creates the input metadata for the three input tesnors.
get_tokenizer_associated_files
View source
get_tokenizer_associated_files () -> List [ str ]
Gets the associated files that are packed in the tokenizer.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-05-08 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-05-08 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-05-08 UTC."],[],[]]