#undefinedError: 'dict object' has no attribute 'value'
1 messages · Page 1 of 1 (latest)
When I ran there alpaca notebook for llama the model load successfully after saving but, when I use the llma chat template or chatml template to train the model, I keep getting the error
If I run it without mapping and simply name my data correctly, it also works without any problems.
Could it be that something in the tokenizer_config.json does not fit if the mapping is stored there?
did you guys all use maxime labonne's blog?
Please am not familiar with the blog?
So I just try something now
I have seen this two version before
Version 1
model.save_pretrained("lora_model") # Local saving
Version 2
model.save_pretrained("lora_model") # Local saving
tokenizer.save_pretrained("lora_model")
I use version one when I started my llm project, later I ran into this type of issue of loading the model, so I ran back to there sample code and I saw, they are using the version 2 for saving a model, so I started using that.
Now when the issue reoccur, I just recollect and I tried saving using the version one and the model load successfully
@storm anvil @weary junco @molten knot should be fixed now - apologies for the delays
It needs to be in ShareGPT format so
messages = [
{"from": "human", "value": "Is 9.11 larger than 9.9?"},
{"from": "gpt", "value": "No."},
]
and not the normal HF format:
messages = [
{"role": "user", "content": "Is 9.11 larger than 9.9?"},
{"role": "assistant", "content": "No."},
]
Also the blog says model = FastLanguageModel.for_inference(model) it should just be FastLanguageModel.for_inference(model). We'll fix this as well
so the mapping function as per mlabonne’s blog still works?
and we reinstall unsloth?
ok all working for me with the custom mapping
Hello, am still getting the error trying to load my old save model, is there no solution than to retrain another model?
The error is in the tokenizer_config.json
There is your chat template. There is json property which is named chat_template.
Train new model 5 minutes and copy this property from new tokenizer config in your old. This should solve your problem