#undefinedError: 'dict object' has no attribute 'value'

1 messages · Page 1 of 1 (latest)

lyric palm
#

Just opening this issue for people with the same issue

#

@storm anvil @weary junco @molten knot

molten knot
#

thanks

#

i might try training without a custom chat template and see if that fixes it

weary junco
#

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

lyric palm
#

@simple lantern

#

#help message

#

#help message

#

we're going to double check in colab

storm anvil
#

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?

lyric palm
#

did you guys all use maxime labonne's blog?

weary junco
#

Please am not familiar with the blog?

storm anvil
#

No, i use your notebook.

#

LLAMA 3.1 Notebook

weary junco
#

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

lyric palm
#

@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

molten knot
#

so the mapping function as per mlabonne’s blog still works?

molten knot
#

and we reinstall unsloth?

molten knot
#

ok all working for me with the custom mapping

weary junco
#

Hello, am still getting the error trying to load my old save model, is there no solution than to retrain another model?

storm anvil
simple lantern
#

oh u dont need to change anything

#

just update unsloth