我正在尝试将 flan-t5 pytorch 模型转换为 GGUF 格式

问题描述 投票:0回答:1

我尝试按照 Colab 注释使用 llama.cpp Convert.py 来转换模型这里


model = AutoModelForSeq2SeqLM.from_pretrained(
    model_name,
    trust_remote_code=True,
    torch_dtype=torch.bfloat16,
    device_map='cpu',
    offload_folder='offload',
    cache_dir=cache_dir
)

!python convert.py models/
遇到错误 错误:

Loading model file models/pytorch_model.bin
Traceback (most recent call last):
  File "/content/llama.cpp/convert.py", line 1208, in <module>
    main()
  File "/content/llama.cpp/convert.py", line 1157, in main
    params = Params.load(model_plus)
  File "/content/llama.cpp/convert.py", line 288, in load
    params = Params.loadHFTransformerJson(model_plus.model, hf_config_path)
  File "/content/llama.cpp/convert.py", line 203, in loadHFTransformerJson
    n_embd           = config["hidden_size"]
KeyError: 'hidden_size'

请帮我将 google/flan-t5-large 模型转换为 GGUF 格式。

python c++ pytorch transform huggingface-transformers
1个回答
0
投票

这可以使用蜡烛框架资源转换编码器-解码器模型来实现。 这里是T5型号的GGUF转换

© www.soinside.com 2019 - 2024. All rights reserved.