Huggingface本身的模型其实就是基于PyTorch的,但是格式不算通用。 from transformers import AutoTokenizer from transformers import AutoModel import torch from transformers import LlamaTokenizer, LlamaForCausalLM # convert huggingface model to pytorch model modelfromhuggingface=LlamaFor…