huggingface / autotrain-advanced

🤗 AutoTrain Advanced
https://huggingface.co/autotrain
Apache License 2.0
3.65k stars 442 forks source link

[BUG] llm-merge-adapter space bug after autotrain finetuned model #622

Closed ahmed8047762 closed 2 months ago

ahmed8047762 commented 2 months ago

Prerequisites

Backend

Hugging Face Space/Endpoints

Interface Used

UI

CLI Command

No response

UI Screenshots & Parameters

No response

Error Logs

TypeError: LoraConfig.init() got an unexpected keyword argument 'layer_replication'

Additional Information

I finetuned HuggingFaceH4/zephyr-7b-beta model on custom dataset using autotrain and tried to merge it with base model using duplicated space of your space but after 8/8 model's shreds were loaded, following error occured:

TypeError: LoraConfig.init() got an unexpected keyword argument 'layer_replication'

any idea how to resolve this issue?

abhishekkrthakur commented 2 months ago

it seems like it was not updated to latest peft and transformers version. updating peft and transformers in requirements.txt will fix the issue.

ahmed8047762 commented 2 months ago

@abhishekkrthakur requirements.txt of llm-merge-adapter space? Because while finetuning, I didn't separately installed any library, all the dependencies were installed through autotrain.

abhishekkrthakur commented 2 months ago

yes. for the space. i just fixed it. you can re-duplicate the space and merge. there is also a cli tool in autotrain to merge adapters:

autotrain tools merge-llm-adapter \
  --base-model-path meta-llama/Meta-Llama-3-70B-Instruct \
  --adapter-path abhishek/autotrain-llama3-70b-orpo-v2 \
  --token $HF_TOKEN \
  --push-to-hub
ahmed8047762 commented 2 months ago

@abhishekkrthakur In the cli tool and space, is there a parameter to load a 4 or 8 bit quantized version of base model?

abhishekkrthakur commented 2 months ago

if you trained it using autotrain, it should be mergable by both the cli and the space. are you facing any issues again? requirements were updated.

ahmed8047762 commented 2 months ago

Thanks a lot, the bug is resolved.

I was asking about parameter for loading a quantized base model for merging because that would've been very helpful in merging smaller 7b models inside colab free tier rather than buying compute for it