Azzizz17 commited on
Commit
e7dce81
1 Parent(s): c2b8862
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio
2
+ from transformers import pipeline
3
+ pipe = pipeline("text-classification", model="rifkat/uz_kr_lang-detection")
4
+
5
+ def my_inference_function(text):
6
+ return pipe(text)
7
+
8
+ gradio_interface = gradio.Interface(
9
+ fn=my_inference_function,
10
+ inputs="text",
11
+ outputs="text",
12
+ title="REST API with Gradio and Huggingface Spaces",
13
+ )
14
+ gradio_interface.launch()