Model
wdtest-a/ptest-nli
- Task:Zero Shot Classification
- Libraries:transformers
- Formats:safetensors
- License:mit
- arXiv:arXiv:1910.13461arXiv:1909.00161
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-nli'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-nli',
revision='7406254e033331738d415f552b1a1d36a5b1fab6',
endpoint='https://api.provyd.xyz',
token=os.environ.get("HF_TOKEN") or False,
)Zero-shot classify with transformers
import os
os.environ["HF_ENDPOINT"] = 'https://api.provyd.xyz'
from transformers import pipeline
pipe = pipeline("zero-shot-classification", model='wdtest-a/ptest-nli')
scores = pipe("Hello", candidate_labels=["greeting", "question"])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-nli', token=os.environ["WD_INFERENCE_KEY"])
labels = client.zero_shot_classification("Hello", ["greeting", "question"])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-nli'Clone with git
git clone 'https://api.provyd.xyz/wdtest-a/ptest-nli'Clone with git over SSH
git clone 'ssh://git@wd.provyd.xyz:2222/wdtest-a/ptest-nli'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-nli/revision/7406254e033331738d415f552b1a1d36a5b1fab6' \
-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 7406254
| Line | Commit | Author | Date | Code |
|---|---|---|---|---|
| 1 | import facebook/bart-large-mnli@d7645e127eaf1aefc7862fd59a17a5aa8558b8ce7406254 | wdtest-a | { | |
| 2 | "_num_labels": 3, | |||
| 3 | "activation_dropout": 0.0, | |||
| 4 | "activation_function": "gelu", | |||
| 5 | "add_final_layer_norm": false, | |||
| 6 | "architectures": [ | |||
| 7 | "BartForSequenceClassification" | |||
| 8 | ], | |||
| 9 | "attention_dropout": 0.0, | |||
| 10 | "bos_token_id": 0, | |||
| 11 | "classif_dropout": 0.0, | |||
| 12 | "classifier_dropout": 0.0, | |||
| 13 | "d_model": 1024, | |||
| 14 | "decoder_attention_heads": 16, | |||
| 15 | "decoder_ffn_dim": 4096, | |||
| 16 | "decoder_layerdrop": 0.0, | |||
| 17 | "decoder_layers": 12, | |||
| 18 | "decoder_start_token_id": 2, | |||
| 19 | "dropout": 0.1, | |||
| 20 | "encoder_attention_heads": 16, | |||
| 21 | "encoder_ffn_dim": 4096, | |||
| 22 | "encoder_layerdrop": 0.0, | |||
| 23 | "encoder_layers": 12, | |||
| 24 | "eos_token_id": 2, | |||
| 25 | "forced_eos_token_id": 2, | |||
| 26 | "gradient_checkpointing": false, | |||
| 27 | "id2label": { | |||
| 28 | "0": "contradiction", | |||
| 29 | "1": "neutral", | |||
| 30 | "2": "entailment" | |||
| 31 | }, | |||
| 32 | "init_std": 0.02, | |||
| 33 | "is_encoder_decoder": true, | |||
| 34 | "label2id": { | |||
| 35 | "contradiction": 0, | |||
| 36 | "entailment": 2, | |||
| 37 | "neutral": 1 | |||
| 38 | }, | |||
| 39 | "max_position_embeddings": 1024, | |||
| 40 | "model_type": "bart", | |||
| 41 | "normalize_before": false, | |||
| 42 | "num_hidden_layers": 12, | |||
| 43 | "output_past": false, | |||
| 44 | "pad_token_id": 1, | |||
| 45 | "scale_embedding": false, | |||
| 46 | "transformers_version": "4.7.0.dev0", | |||
| 47 | "use_cache": true, | |||
| 48 | "vocab_size": 50265 | |||
| 49 | } |