Downloads · 30 days
12
18% of all-time downloads
BoomJules/molly-physics
molly-physics is a text generation model from BoomJules. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as cc-by-nc-4.0.
Solves undergraduate and graduate-level physics problems involving classical mechanics, electromagnetism, and quantum mechanics with correct derivations and numerical results.
Downloads · 30 days
12
18% of all-time downloads
All-time downloads
66
Public
Repo size
126 MB
Likes
0
Public
Click a slice to open those files.
.safetensors109 MB · 86%
From the Hugging Face model README
Solves undergraduate and graduate-level physics problems involving classical mechanics, electromagnetism, and quantum mechanics with correct derivations and numerical results.
Part of Molly, an orchestrator that keeps a library of small domain specialists over one quantized base and routes each request to the right one, so a single machine answers across many fields without loading a separate large model for each.
This adapter needs the base weights, and the base is access-gated. Do this once:
HF_TOKEN, enable Notebook access.HF_TOKEN.huggingface-cli login or export HF_TOKEN=...Skipping this gives GatedRepoError / 401 Unauthorized when the base loads. A stored
Colab secret is not applied automatically — authenticate in code, as below.
# pip install -U transformers peft accelerate
import os, torch
from huggingface_hub import login
try:
from google.colab import userdata
login(userdata.get("HF_TOKEN"))
except Exception:
tok = os.environ.get("HF_TOKEN")
login(tok) if tok else login()
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
BASE = "meta-llama/Llama-3.1-8B-Instruct"
ADAPTER = "BoomJules/molly-physics"
tok = AutoTokenizer.from_pretrained(BASE)
base = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(base, ADAPTER).eval()
msgs = [{"role": "user", "content": "Your question here"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=300)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
# pip install -U transformers peft accelerate bitsandbytes
import os, torch
from huggingface_hub import login
try:
from google.colab import userdata
login(userdata.get("HF_TOKEN"))
except Exception:
login(os.environ.get("HF_TOKEN"))
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16, bnb_4bit_use_double_quant=True)
tok = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
base = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct", quantization_config=bnb, device_map="auto")
model = PeftModel.from_pretrained(base, "BoomJules/molly-physics").eval()
| Base model | meta-llama/Llama-3.1-8B-Instruct |
| Method | LoRA (PEFT) |
| Rank / alpha | 32 / 64 |
| Domain | Physics |
GatedRepoError / 401 Unauthorized — base licence not accepted, or HF_TOKEN missing,
or the Colab secret was stored but login(...) was never called.base_model above.Running several of these at once, with the routing decided for you, is what Molly does.
Adapter: CC BY-NC 4.0 (attribution, non-commercial). Base model: its own licence. Intended for research and evaluation in Physics.
© 2026 Core Labs R&D.