File size: 287 Bytes
080ae89
c3fdb2a
8c5e1a4
c3fdb2a
8c5e1a4
080ae89
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# gradio demo
import gradio as gr
from transformers import pipeline

pipe = pipeline("sentiment-analysis")

def predict(text):
  return pipe(text)[0]["label"]

iface = gr.Interface(
  fn=predict,
  inputs='text',
  outputs='text',
  examples=[["The movie was amazing"]]
)

iface.launch()