Downloads · 30 days
0
vihangd/leet-coding-alpaca-lora-7b
leet-coding-alpaca-lora-7b is a machine learning model from vihangd. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This repository contains a LoRA checkpoint based on the Alpaca-LoRA implementation to perform coding tasks better. The provided checkpoint can be used with the generate.py script from the Alpaca-LoRA repository to gen…
Downloads · 30 days
0
Access
Public
Updated Apr 19, 2023
Repo size
16.8 MB
Likes
4
Public
Click a slice to open those files.
.bin16.8 MB · 100%
From the Hugging Face model README
This repository contains a LoRA checkpoint based on the Alpaca-LoRA implementation to perform coding tasks better. The provided checkpoint can be used with the generate.py script from the Alpaca-LoRA repository to generate text or perform other NLP tasks.
Clone the Alpaca-LoRA repository:
git clone https://github.com/tloen/alpaca-lora.git
Install the required packages:
pip install -r requirements.txt
Use the generate.py script from the Alpaca-LoRA repository to run the model with the provided LoRA checkpoint:
python generate.py --load_8bit --base_model 'decapoda-research/llama-7b-hf' --lora_weights 'vihangd/leet-coding-alpaca-lora-7b'
If you encounter an error like:
AttributeError: 'NoneType' object has no attribute 'device'
Modify generate.py as follows (see issue #21):
model = PeftModel.from_pretrained(
model,
lora_weights,
torch_dtype=torch.float16,
device_map={'': 0}
)