CoolFace
Modelpublic

davzoku/cria-llama2-7b-v1.3

sourceHugging Facellama2updated 3y agoView on Hugging Face
2likes89downloads
Model Card

CRIA v1.3

πŸ’‘ Article | πŸ’» Github | πŸ“” Colab 1,2

What is CRIA?

krΔ“-Ι™ plural crias. : a baby llama, alpaca, vicuΓ±a, or guanaco.

<p align="center"> <img src="https://raw.githubusercontent.com/davzoku/cria/main/assets/icon-512x512.png" width="300" height="300" alt="Cria Logo"> <br> <i>or what ChatGPT suggests, <b>"Crafting a Rapid prototype of an Intelligent llm App using open source resources"</b>.</i> </p>

The initial objective of the CRIA project is to develop a comprehensive end-to-end chatbot system, starting from the instruction-tuning of a large language model and extending to its deployment on the web using frameworks such as Next.js.

Specifically, we have fine-tuned the llama-2-7b-chat-hf model with QLoRA (4-bit precision) using the mlabonne/CodeLlama-2-20k dataset. This fine-tuned model serves as the backbone for the CRIA chat platform.

πŸ“¦ Model Release

CRIA v1.3 comes with several variants.

πŸ”§ Training

It was trained on a Google Colab notebook with a T4 GPU and high RAM.

Training procedure

The following bitsandbytes quantization config was used during training:

  • β€”loadin8bit: False
  • β€”loadin4bit: True
  • β€”llmint8threshold: 6.0
  • β€”llmint8skip_modules: None
  • β€”llmint8enablefp32cpu_offload: False
  • β€”llmint8hasfp16weight: False
  • β€”bnb4bitquant_type: nf4
  • β€”bnb4bitusedoublequant: False
  • β€”bnb4bitcompute_dtype: float16

Framework versions

  • β€”PEFT 0.4.0

πŸ’» Usage

python
# pip install transformers accelerate

from transformers import AutoTokenizer
import transformers
import torch

model = "davzoku/cria-llama2-7b-v1.3"
prompt = "What is a cria?"

tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    torch_dtype=torch.float16,
    device_map="auto",
)

sequences = pipeline(
    f'<s>[INST] {prompt} [/INST]',
    do_sample=True,
    top_k=10,
    num_return_sequences=1,
    eos_token_id=tokenizer.eos_token_id,
    max_length=200,
)
for seq in sequences:
    print(f"Result: {seq['generated_text']}")

References

We'd like to thank:

  • β€”mlabonne for his article and resources on implementation of instruction tuning
  • β€”TheBloke for his script for LLM quantization.