123
Browse files
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()
|