Closed adityaaryan77 closed 1 year ago
hi @adityaaryan77 Thinking a bit about your issue (and if I got it right), I think this is expected. You start with a fine tuned adapter and you finetune it on a new dataset, therefore the model forgets its knowledge about the first task. You might need to create a new adapter for your new task. Also your code is a bit hard to read for me. Could you properly format it with code block and correct indendations? Let me know if I got the problem correctly
Hi @younesbelkada No after training it on a data set I save the model, I want to further finetune it with a new dataset but I want the model to remember the old stuff or else what would be the point of saving it and train it again I can just train the base model again. Sure I am attaching the code block's paste bin here : https://pastebin.pl/view/4e77a13d
@younesbelkada any idea how to fix this?
Hi @adityaaryan77
Thanks for the ping, I am unsure how to solve this issue, as a sanity check, can you try to generate some text right after training and before saving the model (e.g. trainer.model.generate(xxx)
) ?
Hey so @younesbelkada for example I train it with Prompt:"What's my cats name" and answer:"Tom" it will reply Tom to the same question. But after training it to the prompt:"What's my dogs name?", Answer:"Bob" . Then if I ask what's my dogs name it'll reply with bob. But if I ask what my cats name it'll reply with "Bob" or maybe sometimes repeat the question
@adityaaryan77 can you paste your error? One needs to read your entire convs and question to figure out what your issue is. The title also doesn't provide a description or mention of the specific issue either.
perhaps related: https://github.com/huggingface/peft/issues/685 somehow this issue is able to train at all but I fail.
original falcon qlora: https://gist.github.com/pacman100/1731b41f7a90a87b457e8c5415ff1c14
This may very well be correct behavior depending on your data and on your training. If you train, both times, a single example text for the usual amount of steps then the model would likely reply with the currently trained name to any similar question. Essentially, you have induced catastrophic forgetting.
To diagnose this, it would help to output the logits, rank them, and output the top k token_ids. Then, over the course of fine-tuning, see how these logits change.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
System Info
574 Although resume_from_checkpoint is now working after @llohann-speranca solved the issue but now finetuning again with new data using train(resume_from_checkpoint) and then testing it makes it forget the old datas i.e. wont remember the things in old dataset.
Attaching the code below:
Who can help?
@younesbelkada @pacman100
Information
Tasks
examples
folderReproduction
I trained my model for my cats name in first iteration and saved it in checkpoint-1 then retrained it for my dogs name although now it knows my dogs name it forgets my cats name
Expected behavior
To remember my cats name