GithubHelp home page GithubHelp logo

关于权重合并 about llms_tool HOT 1 CLOSED

stanleylsx avatar stanleylsx commented on July 1, 2024
关于权重合并

from llms_tool.

Comments (1)

stanleylsx avatar stanleylsx commented on July 1, 2024

目前项目只支持lora的权重合并吗?prompt tuning和prefix tuning的权重没有如何合并和加载呢?使用prompt tuning和prefix tuning微调后的模型在使用merge_peft_model会出错

AttributeError: 'QWenLMHeadModel' object has no attribute 'merge_and_unload'

https://github.com/huggingface/peft/blob/main/src/peft/tuners/lora.py#L790
已经修改,prompt tuning和prefix tuning是模型前缀微调,直接通过PeftModel.from_pretrained(model, adapter_dir)加载即可,lora是在模型的线性层旁路添加一个低秩矩阵微调,可以进行合并成为新的base模型(同官方对该函数的解释)

from llms_tool.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.