| import torch | |
| import pipeline | |
| from transformers import pipeline | |
| pipe = pipeline( | |
| task='onnx-base', | |
| model='m3/onnx-base', | |
| batch_size=10, | |
| device='cpu', | |
| ) | |
| input = torch.tensor([[1, 2], [3, 4]], dtype=torch.float32).numpy() | |
| result = pipe(input) | |
| print(result) | |