模型:
akdeniz27/bert-base-turkish-cased-ner-quantized
这个模型是模型( https://akdeniz27/bert-base-turkish-cased-ner )的动态量化版本
# First install "optimum[onnxruntime]": !pip install "optimum[onnxruntime]" # and import "ORTModelForTokenClassification": from transformers import AutoTokenizer, pipeline from optimum.onnxruntime import ORTModelForTokenClassification model = ORTModelForTokenClassification.from_pretrained("akdeniz27/bert-base-turkish-cased-ner-quantized", file_name="model_quantized.onnx") tokenizer = AutoTokenizer.from_pretrained("akdeniz27/bert-base-turkish-cased-ner-quantized") ner = pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy="first") ner("your text here")
请参考( https://github.com/akdeniz27/dynamic_quantization )获取量化的详细信息