nayem-ng's picture
Update README.md
9f890ce verified
|
raw
history blame
5.25 kB
metadata
library_name: transformers
tags:
  - peft
  - trl
  - torch
  - wandb
  - ipex
license: apache-2.0
language:
  - en
base_model:
  - NousResearch/Llama-2-7b-hf
datasets:
  - mlabonne/mini-platypus
pipeline_tag: text-generation

Model Card for Fine-Tuned Llama-2-7b Model

Model Details

Model Description

This model is a fine-tuned version of the Llama-2-7b model, specifically adapted for causal language modeling tasks. The fine-tuning utilizes the PEFT (Parameter-Efficient Fine-Tuning) technique with LoRA (Low-Rank Adaptation) to optimize performance while reducing computational costs. The training was conducted using the mlabonne/mini-platypus dataset and incorporates features such as integration with W&B for experiment tracking and Intel's Extension for PyTorch (IPEX) for enhanced performance.

  • Developed by: Md. Jannatul Nayem
  • Model type: Causal Language Model
  • Language(s) (NLP): Engish
  • License: Apache 2.0
  • Finetuned from model : NousResearch/Llama-2-7b-hf

Uses

Direct Use

The model can be utilized for text generation tasks where the generation of coherent and contextually relevant text is required. This includes applications like chatbots, content creation, and interactive storytelling.

Downstream Use

When fine-tuned, this model can serve in larger ecosystems for tasks like personalized dialogue systems, question answering, and other natural language understanding applications.

Out-of-Scope Use

The model is not intended for use in generating harmful or misleading content, and users should exercise caution to prevent misuse in sensitive areas such as misinformation or hate speech.

Bias, Risks, and Limitations

This model may exhibit biases inherent in the training data and should be evaluated thoroughly before deployment. Users should be aware of the potential risks and limitations associated with its use.

Recommendations

Users should consider implementing bias mitigation strategies and ensure thorough evaluation of the model's outputs, especially in sensitive applications.

How to Get Started with the Model

Use the following code snippet to get started with loading and using the model:

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "nayem-ng/mdjannatulnayem_llama2_7b_finetuned_casuallm_lora"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

# Example of generating text
input_text = "Your prompt here"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Training Details

Training Data

The model was fine-tuned using the mlabonne/mini-platypus dataset, which consists of diverse text inputs designed to enhance the model's capabilities in conversational settings

Training Procedure

The training utilized a supervised fine-tuning procedure with the following hyperparameters:

Training regime: bf16 mixed precision Number of epochs: 1 Batch size: 10 Learning rate: 2e-4 Warmup steps: 10 Gradient accumulation steps: 1

Training Hyperparameters

Training regime: bf16 mixed precision Explanation: The model was trained using bfloat16 (bf16) mixed precision, which allows for faster training times and reduced memory usage compared to traditional fp32 (float32). This precision format is particularly beneficial when working with large models, as it helps to maintain numerical stability while optimizing performance on compatible hardware.

Number of epochs: 1

Batch size: 10

Learning rate: 2e-4

Warmup steps: 10

Gradient accumulation steps: 1

Evaluation strategy: Evaluations are performed every 1000 steps to monitor the model's performance during training.

Testing Data

Dataset Used: The evaluation was conducted using the same dataset, mlabonne/mini-platypus, used for training. This dataset is suitable for assessing the model's performance on casual language generation tasks. mlabonne/mini-platypus

Model Examination

Further interpretability studies can be conducted to understand decision-making processes within the model's responses.

Model Architecture and Objective

The model is based on the Transformer architecture, specifically designed for Causal Language Modeling (CLM).

Compute Infrastructure

Intel® Tiber™ AI Cloud

Hardware

Intel(R) Xeon(R) Platinum 8480+

Software

PyTorch: A popular deep learning framework providing flexibility and support for dynamic computation graphs. Transformers Library (from Hugging Face): Used for loading pre-trained models and tokenizers, enabling easy model training and fine-tuning. PEFT Library: Specifically designed for efficient fine-tuning techniques like LoRA (Low-Rank Adaptation). TRL Library: For supervised fine-tuning training routines. WandB: Utilized for experiment tracking and visualizing training metrics. Intel Extension for PyTorch (IPEX): Optimizes performance on Intel hardware, enhancing training efficiency.

Model Card Contact

Md. Jannatul nayem | Mail | LinkedIn