import torch | |
import pipeline | |
from transformers import pipeline | |
pipe = pipeline( | |
task='onnx-base', | |
model='m3/onnx-base', | |
batch_size=10, | |
device='cuda', | |
) | |
dummy_input = torch.tensor([[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]]], dtype=torch.float32) | |
input_data = dummy_input.numpy() | |
result = pipe( | |
inputs=input_data, device='cuda', | |
) | |
print(result) | |