返回模型
说明文档
DeBERTa-v3-base-onnx-quantized
此模型基于基础模型 sileod/deberta-v3-base-tasksource-nli 进行量化,使用此模型需要在您的机器上安装 onnxruntime。
要使用此模型,您可以查看我的 Huggingface Spaces。
Huggingface 应用的源代码可以在 GitHub 上找到。
要在您的机器上运行此模型,请使用以下代码。请注意,此模型针对支持 AVX2 的 CPU 进行了优化。
- 安装依赖
pip install transformers optimum[onnxruntime]
- 运行模型:
# 加载库
from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSequenceClassification
from optimum.pipelines import pipeline
# 加载模型组件
MODEL_ID = "pitangent-ds/deberta-v3-nli-onnx-quantized"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = ORTModelForSequenceClassification.from_pretrained(MODEL_ID)
# 加载管道
classifier = pipeline("zero-shot-classification", tokenizer=tokenizer, model=model)
# 推理
text = "The jacket that I bought is awesome"
candidate_labels = ["positive", "negative"]
results = classifier(text, candidate_labels)
pitangent-ds/deberta-v3-nli-onnx-quantized
作者 pitangent-ds
zero-shot-classification
transformers
↓ 1
♥ 0
创建时间: 2024-07-17 15:06:39+00:00
更新时间: 2024-07-20 04:49:03+00:00
在 Hugging Face 上查看文件 (10)
.gitattributes
README.md
added_tokens.json
config.json
model_quantized.onnx
ONNX
ort_config.json
special_tokens_map.json
spm.model
tokenizer.json
tokenizer_config.json