zero / app.py
m3's picture
chore: add zero demo
3879b2f
raw
history blame
399 Bytes
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()