File size: 399 Bytes
3879b2f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import gradio as gr
import torch
import pipeline
from transformers import pipeline
pipe = pipeline(
task='onnx-base',
model='m3/onnx-base',
batch_size=10,
device='cpu',
)
def zero(name):
input = torch.tensor([[1, 2], [3, 4]], dtype=torch.float32).numpy()
result = pipe(input)
return str(result)
demo = gr.Interface(fn=zero, inputs="text", outputs="text")
demo.launch() |