当前位置:   article > 正文

Peft库常见错误:AttributeError: ‘LlamaForCausalLM‘ object has no attribute ‘merge_and_unload‘【解决方案:更新peft】_attributeerror: 'llamaforcausallm' object has no a

attributeerror: 'llamaforcausallm' object has no attribute 'chat

更新peft库至最新版本peft==0.4.0.dev0

  1. # Copyright 2023 Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. from typing import Optional
  15. from peft import PeftModel
  16. import fire
  17. import torch
  18. import tqdm
  19. import transformers
  20. # from train import smart_tokenizer_and_embedding_resize
  21. @torch.inference_mode()
  22. def make_diff(
  23. path_raw: str, path_tune
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/364580
推荐阅读
相关标签
  

闽ICP备14008679号