Alpha-VLLM / LLaMA2-Accessory

An Open-source Toolkit for LLM Development
https://llama2-accessory.readthedocs.io/
Other
2.68k stars 170 forks source link

Failed to convert to HF #84

Closed arbindpd96 closed 10 months ago

arbindpd96 commented 10 months ago

I am trying to convert a fine tuned checkpoint to hf so i can make the model work with llama.cpp Image attached for reference Any help would be appreciated.

Also in the latest commit

in accessory/main_finetune.py FuseAdam is imported as AdamW but used as FuseAdam. which causes it to break. also we are getting a key error on the key 'image' on this line print(f'Warning for truncation input!\nImage name: {data_item["image"]} question: {data_item["question"][:10]}') in accessory/data/alpaca.py

image

ChrisLiu6 commented 10 months ago
  1. fail to convert to HF

Hi, the problem is that the model architecture of llamaPeft is different from the original llama (lora and bias are added), but huggingface only contains the original llama implementation. If you want to convert such models to HF, you need to first reimplement the architecture using huggingface, and then write the conversion logic correspondingly.

  1. AdamW and 3. Dataset key error Thank you for pointing out these bugs. We have fixed them in the latest commit.
anuragdalia commented 10 months ago

Hey thanks for that response.

Can these checkpoints be used with llama.cpp or as a quantized single bin file. or even be converted to ggml format? or all these would require custom scripts ?

anuragdalia commented 10 months ago

@ChrisLiu6 Hi Please suggest.

ChrisLiu6 commented 10 months ago

I'm sorry, but I'm really not familiar with llama.cpp😣. Unfortunately, no one on our team is working on that. The followings are all I can provide on this topic: