File size: 364 Bytes
e7dce81
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio
from transformers import pipeline
pipe = pipeline("text-classification", model="rifkat/uz_kr_lang-detection")

def my_inference_function(text):
    return pipe(text)

gradio_interface = gradio.Interface(
  fn=my_inference_function,
  inputs="text",
  outputs="text",
  title="REST API with Gradio and Huggingface Spaces",
)
gradio_interface.launch()