Instructions to use Norm/ERNIE-Layout-Pytorch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Norm/ERNIE-Layout-Pytorch with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Norm/ERNIE-Layout-Pytorch", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -31,7 +31,7 @@ layout = [[381, 91, 505, 115], [738, 96, 804, 122]] # all boxes are resized bet
|
|
| 31 |
feature_extractor = ErnieFeatureExtractor()
|
| 32 |
|
| 33 |
# Tokenize context & questions
|
| 34 |
-
context_encodings = prepare_context_info(tokenizer, context, layout
|
| 35 |
question = "what is it?"
|
| 36 |
tokenized_res = ernie_qa_tokenize(tokenizer, question, context_encodings)
|
| 37 |
tokenized_res['input_ids'] = torch.tensor([tokenized_res['input_ids']]).to(device)
|
|
|
|
| 31 |
feature_extractor = ErnieFeatureExtractor()
|
| 32 |
|
| 33 |
# Tokenize context & questions
|
| 34 |
+
context_encodings = prepare_context_info(tokenizer, context, layout)
|
| 35 |
question = "what is it?"
|
| 36 |
tokenized_res = ernie_qa_tokenize(tokenizer, question, context_encodings)
|
| 37 |
tokenized_res['input_ids'] = torch.tensor([tokenized_res['input_ids']]).to(device)
|