A specialized 2B parameter language model fine-tuned on advanced mathematics and physics datasets. Built on IBM's Granite 3.3-2B Instruct base model with LoRA fine-tuning on 26k instruction-response pairs covering advanced calculations and physics concepts.
Download Model Artifacts
The HF checkpoint and GGUF exports are hosted externally (e.g., Hugging Face) and
are not stored inside this repository. Fetch them before running the
examples:
python scripts/download_artifacts.py --artifact all
--source huggingface (default) pulls from xJoepec/galena-2b-math-physics.
--source mirror --hf-url ... --gguf-url ... lets you point to release assets/CDN downloads instead.
Artifacts install under models/math-physics/{hf,gguf} and are ignored by Git.
Quick Start
Using Hugging Face Transformers
python
1from transformers import AutoModelForCausalLM, AutoTokenizer
23# Load model and tokenizer4model = AutoModelForCausalLM.from_pretrained(5"models/math-physics/hf",6 device_map="auto",7 trust_remote_code=True8)9tokenizer = AutoTokenizer.from_pretrained("models/math-physics/hf")1011# Generate response12prompt ="Explain the relationship between energy and momentum in special relativity."13messages =[{"role":"user","content": prompt}]14inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)1516outputs = model.generate(inputs, max_new_tokens=256, temperature=0.7)17response = tokenizer.decode(outputs[0], skip_special_tokens=True)18print(response)
Using llama.cpp (GGUF)
bash
1# Requires llama.cpp build and downloaded GGUF artifact2./llama.cpp/build/bin/llama-cli \3 -m models/math-physics/gguf/granite-math-physics-f16.gguf \4 -p "Calculate the escape velocity from Earth's surface."\5 -n 256\6 --temp 0.7