You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Fixed] TypeError: 'bool' object is not callable #77
so recently found out about unsloth and i was trying one of the tutorials provided when trying to load the model i got and error
This is the code
fromunslothimportFastLanguageModelimporttorchmax_seq_length=2048# Choose any! We auto support RoPE Scaling internally!dtype=None# None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+load_in_4bit=True# Use 4bit quantization to reduce memory usage. Can be False.model, tokenizer=FastLanguageModel.from_pretrained(
model_name="unsloth/llama-2-7b", # "unsloth/mistral-7b" for 16bit loadingmax_seq_length=max_seq_length,
dtype=dtype,
load_in_4bit=load_in_4bit,)
TypeErrorTraceback (mostrecentcalllast)
<ipython-input-1-7adc0e5cc71e>in<cellline: 7>()
5load_in_4bit=True# Use 4bit quantization to reduce memory usage. Can be False.6---->7model, tokenizer=FastLanguageModel.from_pretrained(
8model_name="unsloth/llama-2-7b", # "unsloth/mistral-7b" for 16bit loading9max_seq_length=max_seq_length,
1frames/usr/local/lib/python3.10/dist-packages/unsloth/models/llama.pyinfrom_pretrained(model_name, max_seq_length, dtype, load_in_4bit, token, device_map, rope_scaling, check_tokenizer)
706# We check the tokenizer first for errors707ifcheck_tokenizer:
-->708tokenizer=check_tokenizer(
709model=model,
710tokenizer=tokenizer,
TypeError: 'bool'objectisnotcallable
fromunslothimportFastLanguageModelimporttorchmax_seq_length=2048# Choose any! We auto support RoPE Scaling internally!dtype=None# None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+load_in_4bit=True# Use 4bit quantization to reduce memory usage. Can be False.model, tokenizer=FastLanguageModel.from_pretrained(
model_name="unsloth/llama-2-7b", # "unsloth/mistral-7b" for 16bit loadingmax_seq_length=max_seq_length,
dtype=dtype,
load_in_4bit=load_in_4bit,
token="hf_XXXXXX",
check_tokenizer=False
)
it seems that when I put false for check_tokenizer it works but reading the code for the FastLanguageModel.pretrained i can tell that the check_tokenizer seems important so any help would be great on this
changed the title [-]cannot load model from FastLanguageModel.from_pretrained [/-][+][Fixed] cannot load model from FastLanguageModel.from_pretrained [/+]on Jan 9, 2024
changed the title [-][Fixed] cannot load model from FastLanguageModel.from_pretrained [/-][+][Fixed] TypeError: 'bool' object is not callable[/+]on Jan 9, 2024
Activity
dame-cell commentedon Jan 9, 2024
it seems that when I put false for check_tokenizer it works but reading the code for the FastLanguageModel.pretrained i can tell that the check_tokenizer seems important so any help would be great on this
RonanKMcGovern commentedon Jan 9, 2024
Yes, same issue here.
danielhanchen commentedon Jan 9, 2024
OOPS my big apologies fixed immediately just now - it should work now @RonanKMcGovern @dame-cell
Thanks so much @dame-cell for the quick issue!
danielhanchen commentedon Jan 9, 2024
For Colab - close the entire notebook and reopen it OR go to "Runtime", click "Disconnect and Delete Runtime", then click "Run All"
[-]cannot load model from FastLanguageModel.from_pretrained [/-][+][Fixed] cannot load model from FastLanguageModel.from_pretrained [/+][-][Fixed] cannot load model from FastLanguageModel.from_pretrained [/-][+][Fixed] TypeError: 'bool' object is not callable[/+]dame-cell commentedon Jan 9, 2024
yea it works now thanks