GithubHelp home page GithubHelp logo

Comments (5)

Abdullah-kwl avatar Abdullah-kwl commented on September 18, 2024

check out my Notebook link: https://drive.google.com/file/d/1Oq371TVP2QMQqsw0juYwt4-T1z9fvGyC/view?usp=sharing

i want to use free Colab as I use during BnB quantization

from hqq.

mobicham avatar mobicham commented on September 18, 2024

Hi, the branch and the example: https://gist.github.com/mobicham/cb07c1eff443ad0918c49ab7bb03e269 are working fine, I just tried it now. Make sure:

from hqq.

Abdullah-kwl avatar Abdullah-kwl commented on September 18, 2024

I used the same transformer from the stable branch https://github.com/mobiusml/transformers/tree/stable, but facing the same issue ,
I am also using GPU ,

Please Review my code if there is any mistake:

#first download the cloned repo of transformer from stable branch https://github.com/mobiusml/transformers/tree/stable
#download hqq from master branch repo https://github.com/mobiusml/hqq


!pip install git+https://github.com/Abdullah-kwl/Transformers-HQQ-Integration.git

!pip install git+https://github.com/mobiusml/hqq.git

import torch, transformers

from hqq.core.quantize import *

model_id = "senseable/WestLake-7B-v2"

#Basic

quant_config = BaseQuantizeConfig(nbits=4, group_size=64)

cache_path = ''

compute_dtype = torch.float16

device = 'cuda:0'

#pass BaseQuantizeConfig to AutoModelForCausalLM

model = transformers.AutoModelForCausalLM.from_pretrained(model_id, cache_dir=cache_path, torch_dtype=compute_dtype, device_map=device, quantization_config=transformers.HQQConfig(quant_config) )

tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)


After this cell run it do every thing but in last it show the error ValueError: .to is not supported for HQQ-quantized models.
.to is not supported for HQQ-quantized models
#39

Screenshot 2024-04-06 130608

please look at https://github.com/mobiusml/transformers/blob/stable/src/transformers/modeling_utils.py
this is from transformer stabel branch

Screenshot 2024-04-06 130321

from hqq.

mobicham avatar mobicham commented on September 18, 2024

Strange, I tried the same branch and it worked, with Llama2-7B. Can you with Llama2-7B?

from hqq.

mobicham avatar mobicham commented on September 18, 2024

Try using HQQ with transformers: huggingface/transformers#29637

from hqq.

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.