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() | |