analist's picture
Upload README.md with huggingface_hub
2ca9764 verified
metadata
language: en
tags:
  - deepseek
  - mathematics
  - education
  - fine-tuned
license: apache-2.0

DeepSeek Math Tutor

This model is a fine-tuned version of DeepSeek-R1-Distill-Llama-8B optimized for mathematics education. It's designed to provide step-by-step explanations for mathematical problems in a beginner-friendly way.

Model Details

  • Base Model: DeepSeek-R1-Distill-Llama-8B
  • Training Data: Math reasoning dataset with 7000 examples
  • Task: Mathematics education and problem-solving
  • Training Method: LoRA fine-tuning

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("analist/deepseek-math-tutor-fine-tuned")
tokenizer = AutoTokenizer.from_pretrained("analist/deepseek-math-tutor-fine-tuned")

# Example prompt format
prompt = '''Below is an instruction that describes a task, paired with an input that provides further context.
Write a response that appropriately completes the request.

### Instruction:
You are a maths expert with advanced knowledge in pedagogy, arithmetics, geometry, analysis, calculus.
Please answer the following questions.

### Question:
{your_math_question}

### Response:
'''

# Generate response
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=1200)
response = tokenizer.decode(outputs[0])

Training Details

  • Training framework: Unsloth
  • Optimizer: AdamW 8-bit
  • Learning rate: 2e-4
  • Batch size: 2 (per device)
  • Gradient accumulation steps: 4
  • Training steps: 60
  • Warmup steps: 5

Limitations

This model is specifically tuned for mathematics education and may not perform as well on other tasks. It's designed to provide explanations suitable for beginners learning mathematics.