suayptalha's picture
Update README.md
b1a1c46 verified
|
raw
history blame
2.7 kB
metadata
library_name: transformers
tags:
  - math
  - lora
  - science
  - chemistry
  - biology
  - code
  - text-generation-inference
  - unsloth
license: apache-2.0
datasets:
  - HuggingFaceTB/smoltalk
language:
  - en
base_model:
  - meta-llama/Llama-3.2-1B-Instruct

FastLlama-Logo

You can use ChatML & Alpaca format.

Overview FastLlama is a highly optimized version of the Llama-3.2-1B-Instruct model. Designed for superior performance in constrained environments, it combines speed, compactness, and high accuracy. This version has been fine-tuned using the MetaMathQA-50k section of the HuggingFaceTB/smoltalk dataset to enhance its mathematical reasoning and problem-solving abilities.

Features Lightweight and Fast: Optimized to deliver Llama-class capabilities with reduced computational overhead. Fine-Tuned for Math Reasoning: Utilizes MetaMathQA-50k for better handling of complex mathematical problems and logical reasoning tasks. Instruction-Tuned: Pre-trained on instruction-following tasks, making it robust in understanding and executing detailed queries. Versatile Use Cases: Suitable for educational tools, tutoring systems, or any application requiring mathematical reasoning.

Performance Highlights Smaller Footprint: The model delivers comparable results to larger counterparts while operating efficiently on smaller hardware. Enhanced Accuracy: Demonstrates improved performance on mathematical QA benchmarks. Instruction Adherence: Retains high fidelity in understanding and following user instructions, even for complex queries.

Loading the Model

from transformers import AutoModelForCausalLM, AutoTokenizer

# Load the model and tokenizer
model_name = "your-hf-username/fastllama-3.2-1b-instruct-metamathqa"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

# Example usage
input_text = "Solve for x: 2x + 3 = 7"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)

print(response)

Dataset Dataset: MetaMathQA-50k The MetaMathQA-50k subset of HuggingFaceTB/smoltalk was selected for fine-tuning due to its focus on mathematical reasoning, multi-step problem-solving, and logical inference. The dataset includes:

Algebraic problems Geometric reasoning tasks Statistical and probabilistic questions Logical deduction problems

Model Fine-Tuning Fine-tuning was conducted using the following configuration:

Learning Rate: 2e-4 Epochs: 1 Optimizer: AdamW Framework: Unsloth

License This model is licensed under the Apache 2.0 License. See the LICENSE file for details.