Spaces:
Build error
Build error
Download app.py from ShynBui/Vietnamese_classification: direct link, hf CLI and curl.
- Browser
- Download file 413 Bytes
-
https://huggingface.co/spaces/ShynBui/Vietnamese_classification/resolve/main/app.py
- Command line
-
hf download hf://spaces/ShynBui/Vietnamese_classification/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ShynBui/Vietnamese_classification/resolve/main/app.py
413 Bytes
| import os | |
| from utils import * | |
| from transformers import pipeline | |
| import gradio as gr | |
| pipe = pipeline("text-classification", model="ShynBui/comment_classification_v2", token=os.environ['HF_TOKEN']) | |
| def classification(text): | |
| classi = pipe(covert_pyVI(text)) | |
| return classi[0]['label'], classi[0]['score'] | |
| iface = gr.Interface(fn=classification, inputs="text", outputs=["text", "text"]) | |
| iface.launch() | |