Spaces:
Runtime error
Runtime error
from transformers import AutoTokenizer,AutoModel,BertTokenizer | |
from transformers.pipelines import pipeline | |
import gradio as gr | |
from huggingface_hub import login | |
import os | |
login(os.environ["HF_Token"]) | |
ner_predictor = pipeline( | |
task="nerpipe", | |
model="minskiter/resume-token-classification", | |
device="cpu", | |
trust_remote_code=True, | |
use_auth_token=True | |
) | |
def ner_predictor_gradio(input): | |
entities = ner_predictor(input) | |
return {"text":input, "entities":entities} | |
demo = gr.Interface( | |
fn=ner_predictor_gradio, | |
inputs=gr.Textbox(lines=5, label="่พๅ ฅไฝ ็็ฎๅ"), | |
outputs=gr.HighlightedText(label="็ฎๅ่ฏๅซ็ปๆ"), | |
) | |
demo.launch() |