api_2 / app.py
Azzizz17's picture
123
e7dce81
raw
history blame contribute delete
364 Bytes
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()