How to use from the
Use from the
PEFT library
from peft import PeftModel
from transformers import AutoModelForCausalLM

base_model = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-1124-7B-Instruct")
model = PeftModel.from_pretrained(base_model, "shreyansh12183/olmo2-7b-phd-pure-math")

πŸ“ OLMo-2 7B Pure Mathematics Specialist

A mathematical reasoning adapter fine-tuned on advanced proofs in Algebraic Topology, Differential Geometry, Abstract Algebra, and Real Analysis.

Developed by Shreyansh Singh to investigate rigorous symbolic reasoning in open-weight language models.


πŸ”¬ Capabilities

  • Formal Proof Structuring: Step-by-step inductive, deductive, and contradiction-based mathematical arguments.
  • Topology & Homology: Fundamental groups, homotopy equivalence, Mayer-Vietoris sequences, and manifold theory.
  • Abstract Structures: Category theory, Galois theory, and commutative algebra.

πŸš€ Quick Start & Real Inference (Python & PEFT)

This model repository contains trained PEFT LoRA adapter weights fine-tuned on top of allenai/OLMo-2-1124-7B-Instruct.

To run inference in 4-bit quantization with minimal VRAM (~6GB on a free Google Colab T4 GPU):

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel

BASE_MODEL = "allenai/OLMo-2-1124-7B-Instruct"
ADAPTER_ID = "shreyansh12183/olmo2-7b-phd-pure-math"

# 1. Load Tokenizer
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL, trust_remote_code=True)

# 2. Configure 4-bit BitsAndBytes NF4 Quantization
bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.float16,
    bnb_4bit_use_double_quant=True
)

# 3. Load Base Model
base_model = AutoModelForCausalLM.from_pretrained(
    BASE_MODEL,
    quantization_config=bnb_config,
    device_map="auto",
    trust_remote_code=True
)

# 4. Attach Fine-Tuned LoRA Adapter
model = PeftModel.from_pretrained(base_model, ADAPTER_ID)
model.eval()

# 5. Run Test Inference
prompt = "Explain the core domain methodology and statutory reasoning."
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=300, temperature=0.3, top_p=0.9)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

πŸ§ͺ 1-Click Interactive Google Colab Testing (All 5 SLMs)

Test this model and the complete ExperimentLab SLM fleet on a free GPU with zero local setup:

Open In Colab

πŸ›οΈ Deployment & Enterprise Integration

  • Website: ExperimentLab.in
  • Author: Shreyansh Singh (shreyansh@experimentlab.in)
  • License: Apache 2.0 (Permissive for open research and commercial integration)
  • Zero Cloud Data Leakage: Designed for private, on-premise, air-gapped workstations.
Downloads last month
35
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for shreyansh12183/olmo2-7b-phd-pure-math

Space using shreyansh12183/olmo2-7b-phd-pure-math 1

Collection including shreyansh12183/olmo2-7b-phd-pure-math