用语言模型phi-3-mini量化jupyter笔记本中的版本 我正在尝试在我的Jupyter笔记本中使用小语言模型,但无法找到工作解决方案。我想使用量化的Phi-3-Mini版本,因为它足够小,可以适合我的g ...

问题描述 投票:0回答:1
从huggingface上的文档:

https://huggingface.co/microsoft/phi-3-mini-128k-instruct-onnx它说只有onnx版本已量化,所以我正在使用该版本。

from transformers import AutoTokenizer, AutoModelForCausalLM # This works just fine (normal version but too big for my GPU) tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-128k-instruct",trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3-mini-128k-instruct",trust_remote_code=True) # But this throws an error (quantized version) tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-128k-instruct-onnx", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3-mini-128k-instruct-onnx", trust_remote_code=True)

检查此链接 该教程下载并运行PHI-3迷你短上下文模型。 :
https://github.com/microsoft/onnxruntime-genai/blob/main/examples/python/phi-3-tutorial.md
python language-model
1个回答
0
投票
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.