mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-01 10:41:07 +06:00
parent
3a8a8013ad
commit
a1ea3adb28
@ -42,6 +42,7 @@ Ready-made configurations include the following models:
|
|||||||
- BERT
|
- BERT
|
||||||
- DistilBERT
|
- DistilBERT
|
||||||
- GPT-2
|
- GPT-2
|
||||||
|
- LayoutLM
|
||||||
- RoBERTa
|
- RoBERTa
|
||||||
- T5
|
- T5
|
||||||
- XLM-RoBERTa
|
- XLM-RoBERTa
|
||||||
|
@ -183,11 +183,6 @@ class LayoutLMOnnxConfig(OnnxConfig):
|
|||||||
raise ValueError("Cannot generate dummy inputs without PyTorch installed.")
|
raise ValueError("Cannot generate dummy inputs without PyTorch installed.")
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
input_dict["bbox"] = torch.tensor(
|
batch_size, seq_length = input_dict["input_ids"].shape
|
||||||
[
|
input_dict["bbox"] = torch.tensor([*[box] * seq_length]).tile(batch_size, 1, 1)
|
||||||
[0] * 4,
|
|
||||||
*[box] * seq_length,
|
|
||||||
[self.max_2d_positions] * 4,
|
|
||||||
]
|
|
||||||
).tile(batch_size, 1, 1)
|
|
||||||
return input_dict
|
return input_dict
|
||||||
|
Loading…
Reference in New Issue
Block a user