Model
wdtest-a/ptest-ner
- Task:Token Classification
- Libraries:transformers
- Formats:safetensors
- License:apache-2.0
- arXiv:arXiv:1810.04805
Dedicated endpoint
Sign in to deployInference Providers
This model isn't deployed by any Inference Provider.
Spaces
Create a Space with this modelUse this model
Choose individual files there, or download a full snapshot with the Python example below.
Download with the whiteduck client
pip install https://provyd.xyz/clients/whiteduck-0.1.0-py3-none-any.whl
wd login --host 'https://api.provyd.xyz'
wd download 'wdtest-a/ptest-ner'Using the Hugging Face client instead
Install huggingface_hub with pip install huggingface_hub, then download this pinned snapshot. Set HF_TOKEN (the variable the Hugging Face client reads) to a whiteduck Read token for private repositories. Running the downloaded model requires software that supports its architecture.
Keep your whiteduck token away from calls that ignore HF_ENDPOINT, such as list_inference_endpoints: they send it to Hugging Face. See Docs.
from huggingface_hub import snapshot_download
import os
path = snapshot_download(
repo_id='wdtest-a/ptest-ner',
revision='7a1f9871e604c4bb00997b721ecfa8a7d3d60b21',
endpoint='https://api.provyd.xyz',
token=os.environ.get("HF_TOKEN") or False,
)Tag entities with transformers
import os
os.environ["HF_ENDPOINT"] = 'https://api.provyd.xyz'
from transformers import pipeline
pipe = pipeline("token-classification", model='wdtest-a/ptest-ner', aggregation_strategy="simple")
entities = pipe("Zoe lives in Munich")Call it with huggingface_hub
Works once the owner has started the model. Set WD_INFERENCE_KEY to a model API key.
import os
from huggingface_hub import InferenceClient
client = InferenceClient(model='https://api.provyd.xyz/api/wd/inference/models/wdtest-a/ptest-ner', token=os.environ["WD_INFERENCE_KEY"])
entities = client.token_classification("Zoe lives in Munich")Use with local apps
This hub is self-hosted, so each command points the tool at it. Add a whiteduck access token as HF_TOKEN (the variable the Hugging Face client reads) for private repositories.
vLLM
# vLLM downloads through huggingface_hub, which honours HF_ENDPOINT; set HF_TOKEN for a private repository.
HF_ENDPOINT='https://api.provyd.xyz' vllm serve 'wdtest-a/ptest-ner'Clone with git
git clone 'https://api.provyd.xyz/wdtest-a/ptest-ner'Clone with git over SSH
git clone 'ssh://git@wd.provyd.xyz:2222/wdtest-a/ptest-ner'Needs an SSH key on your account. Add an SSH key
Use the API
Read repository metadata at this commit. Set HF_TOKEN (the variable the Hugging Face client reads) to a whiteduck Read token. Tokens grant account-level access, not access to just this model.
curl 'https://api.provyd.xyz/api/models/wdtest-a/ptest-ner/revision/7a1f9871e604c4bb00997b721ecfa8a7d3d60b21' \
-H "Authorization: Bearer $HF_TOKEN"Inference is separate from file storage. The owner must configure and start a supported model using the inference controls. To call it you need a model API key (made on the model page), or a token of any scope (Read or stronger) from the model owner. Visitors can use the try box only when the owner allows it. A token cannot enable unavailable GPU hardware.
Blame for config.json at 7a1f987
| Line | Commit | Author | Date | Code |
|---|---|---|---|---|
| 1 | import dslim/distilbert-NER@main7a1f987 | wdtest-a | { | |
| 2 | "_name_or_path": "distilbert-base-cased", | |||
| 3 | "activation": "gelu", | |||
| 4 | "architectures": [ | |||
| 5 | "DistilBertForTokenClassification" | |||
| 6 | ], | |||
| 7 | "attention_dropout": 0.1, | |||
| 8 | "dim": 768, | |||
| 9 | "dropout": 0.1, | |||
| 10 | "hidden_dim": 3072, | |||
| 11 | "id2label": { | |||
| 12 | "0": "O", | |||
| 13 | "1": "B-PER", | |||
| 14 | "2": "I-PER", | |||
| 15 | "3": "B-ORG", | |||
| 16 | "4": "I-ORG", | |||
| 17 | "5": "B-LOC", | |||
| 18 | "6": "I-LOC", | |||
| 19 | "7": "B-MISC", | |||
| 20 | "8": "I-MISC" | |||
| 21 | }, | |||
| 22 | "initializer_range": 0.02, | |||
| 23 | "label2id": { | |||
| 24 | "O": 0, | |||
| 25 | "B-PER": 1, | |||
| 26 | "I-PER": 2, | |||
| 27 | "B-ORG": 3, | |||
| 28 | "I-ORG": 4, | |||
| 29 | "B-LOC": 5, | |||
| 30 | "I-LOC": 6, | |||
| 31 | "B-MISC": 7, | |||
| 32 | "I-MISC": 8 | |||
| 33 | }, | |||
| 34 | "max_position_embeddings": 512, | |||
| 35 | "model_type": "distilbert", | |||
| 36 | "n_heads": 12, | |||
| 37 | "n_layers": 6, | |||
| 38 | "output_past": true, | |||
| 39 | "pad_token_id": 0, | |||
| 40 | "qa_dropout": 0.1, | |||
| 41 | "seq_classif_dropout": 0.2, | |||
| 42 | "sinusoidal_pos_embds": false, | |||
| 43 | "tie_weights_": true, | |||
| 44 | "torch_dtype": "float32", | |||
| 45 | "transformers_version": "4.35.2", | |||
| 46 | "vocab_size": 28996 | |||
| 47 | } |