Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'QuantoConfig' object is not subscriptable #23

Open
mehulgupta2016154 opened this issue Jul 3, 2024 · 3 comments
Open

TypeError: 'QuantoConfig' object is not subscriptable #23

mehulgupta2016154 opened this issue Jul 3, 2024 · 3 comments

Comments

@mehulgupta2016154
Copy link

mehulgupta2016154 commented Jul 3, 2024

While running the example code in Readme.md
`from local_gemma import LocalGemma2ForCausalLM
from transformers import AutoTokenizer
import os

os.environ['HUGGINGFACEHUB_API_TOKEN'] = ''
os.environ['HF_TOKEN'] = ''

model = LocalGemma2ForCausalLM.from_pretrained("google/gemma-2-9b",token='')
tokenizer = AutoTokenizer.from_pretrained("google/gemma-2-9b")

model_inputs = tokenizer("The cat sat on the mat", return_attention_mask=True, return_tensors="pt")
generated_ids = model.generate(**model_inputs.to(model.device))

decoded_text = tokenizer.batch_decode(generated_ids)`

Kindly help

Note: I've installed quanto explicitly when prompted in a previous error

@julien-c
Copy link
Member

julien-c commented Jul 3, 2024

please rotate the tokens above^

@mehulgupta2016154
Copy link
Author

Thanks for notifying. Any idea why I'm getting the error?

@sanchit-gandhi
Copy link
Contributor

Hey @mehulgupta2016154 - thanks for reporting! Note that you can save your HF token locally to your cache by running the following from a terminal shell:

huggingface-cli login

This will save you having to pass the token argument to .from_pretrained.

Could you please paste the full traceback you get when running this cell? And also the output of transformers-cli env? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants