Giter Site home page Giter Site logo

Comments (6)

enbacoo avatar enbacoo commented on June 14, 2024 1

模型训练完是不是参数就固定下来了,加载的时候能通过dtype修改参数吗,另外https://huggingface.co/docs/transformers/en/model_doc/qwen2 也没有找到相关的参数

model = AutoModelForCausalLM.from_pretrained(checkpoint, torch_dtype=torch.bfloat16, device_map="auto")

from qwen1.5.

kk19990709 avatar kk19990709 commented on June 14, 2024

same question

from qwen1.5.

enbacoo avatar enbacoo commented on June 14, 2024

对,模型load的时候需要手动设置下dtype才行,config里的没有生效

from qwen1.5.

tianshiyisi avatar tianshiyisi commented on June 14, 2024

模型训练完是不是参数就固定下来了,加载的时候能通过dtype修改参数吗,另外https://huggingface.co/docs/transformers/en/model_doc/qwen2 也没有找到相关的参数

from qwen1.5.

tianshiyisi avatar tianshiyisi commented on June 14, 2024

可以了,谢谢,麻烦问一下,模型训练完用的数据类型是不是就是bf16,用float32加载对于模型的能力也不会有提升吧

from qwen1.5.

jklj077 avatar jklj077 commented on June 14, 2024

transformers only uses the torch_dtype in config.json when torch_dtype in from_pretrained is set to auto.

The models are indeed trained using mixed precision with bfloat16. Computation in float32 does not fundamentally elevate the model performance.

from qwen1.5.

Related Issues (20)

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.