Download app.py from Azzizz17/api_2: direct link, hf CLI and curl.
- Browser
- Download file 364 Bytes
-
https://huggingface.co/spaces/Azzizz17/api_2/resolve/main/app.py
- Command line
-
hf download hf://spaces/Azzizz17/api_2/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Azzizz17/api_2/resolve/main/app.py
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() | |