Instructions to use sangamw/finetunedLLamaModel7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sangamw/finetunedLLamaModel7b with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sangamw/finetunedLLamaModel7b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Model Card for Model ID
- Load the base model with quantization if applicable (as you did during training)
- For simplicity, here we load without quantization for inference, or you can include your bnb_config
- Load the fine-tuned adapter
- Load the tokenizer
- Example inference
Model Card for Model ID
Model Details
Model Description
This is a Llama-2-7b-chat-hf model fine-tuned using QLoRA on the mlabonne/guanaco-llama2-1k dataset. The goal of this fine-tuning was to adapt the base Llama-2 model for instruction following tasks, enhancing its ability to generate conversational and helpful responses.
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
Developed by: Sangamw
Model type: Causal Language Model, specifically a LlamaForCausalLM
Language(s) (NLP): The language of the guanaco dataset (Spanish) and the base Llama-2 model (English, but fine-tuned for Spanish instructions).
License: Llama 2 Community License
Finetuned from model [optional]: meta-llama/Llama-2-7b-chat-hf
Model Sources [optional]
- Repository: [More Information Needed]
- Paper [optional]: [More Information Needed]
- Demo [optional]: [More Information Needed]
Uses
Direct Use
This model can be used for various conversational AI tasks, instruction-following, and text generation where helpful and informative responses are desired. It has been fine-tuned on a dataset primarily in Spanish, making it suitable for Spanish-language applications
Downstream Use [optional]
Out-of-Scope Use
potential for bias, hallucinations, not suitable for critical applications without further safeguards
Bias, Risks, and Limitations
[More Information Needed]
Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
How to Get Started with the Model
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForCausalLM from peft import PeftModel import torch
Load the base model with quantization if applicable (as you did during training)
For simplicity, here we load without quantization for inference, or you can include your bnb_config
base_model = AutoModelForCausalLM.from_pretrained( "meta-llama/Llama-2-7b-chat-hf", torch_dtype=torch.float16, # or torch.bfloat16 if your GPU supports it device_map="auto" )
Load the fine-tuned adapter
model = PeftModel.from_pretrained(base_model, "sangamw/finetunedLLamaModel7b") model = model.merge_and_unload() # Merge LoRA weights into the base model for easier use
Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-chat-hf")
Example inference
pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_new_tokens=200) result = pipe(f"[INST] Explain LoRA in simple terms.[/INST]") print(result[0]['generated_text'])
Training Details
Training Data
The model was fine-tuned on the mlabonne/guanaco-llama2-1k dataset, which consists of 1,000 instructions and responses, primarily in Spanish." You can link to the dataset card: https://huggingface.co/datasets/mlabonne/guanaco-llama2-1k
Training Procedure
Used QLoRA (4-bit quantization) with trl's SFTTrainer.
Preprocessing [optional]
[More Information Needed]
Training Hyperparameters
following are the TrainingArguments I have used ( num_train_epochs=1, per_device_train_batch_size=1, learning_rate=2e-4, optimizer="paged_adamw_32bit" ).
Speeds, Sizes, Times [optional]
[More Information Needed]
Evaluation
Testing Data, Factors & Metrics
Testing Data
[More Information Needed]
Factors
[More Information Needed]
Metrics
[More Information Needed]
Results
[More Information Needed]
Summary
Model Examination [optional]
[More Information Needed]
Environmental Impact
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
- Hardware Type: [More Information Needed]
- Hours used: [More Information Needed]
- Cloud Provider: [More Information Needed]
- Compute Region: [More Information Needed]
- Carbon Emitted: [More Information Needed]
Technical Specifications [optional]
Model Architecture and Objective
[More Information Needed]
Compute Infrastructure
[More Information Needed]
Hardware
[More Information Needed]
Software
[More Information Needed]
Citation [optional]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
Glossary [optional]
[More Information Needed]
More Information [optional]
[More Information Needed]
Model Card Authors [optional]
[More Information Needed]
Model Card Contact
Model tree for sangamw/finetunedLLamaModel7b
Base model
meta-llama/Llama-2-7b-chat-hf