Downloads · 30 days
29
7% of all-time downloads
yasserrmd/caselaw-cpt-8b
caselaw-cpt-8b is a text generation model from yasserrmd. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a Continued Pretrained Language Model (CPT) based on a 7B parameter LLaMA architecture, further trained on the common-pile/caselawaccessproject dataset — a large corpus of U.S. court decisions.
Downloads · 30 days
29
7% of all-time downloads
All-time downloads
396
Public
Parameters
8B
9.2 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors5.7 GB · 62%
How the weights are stored.
U87.2B · 87%
From the Hugging Face model README
This model is a Continued Pretrained Language Model (CPT) based on a 7B parameter LLaMA architecture, further trained on the common-pile/caselaw_access_project dataset — a large corpus of U.S. court decisions.
The goal of this model is to adapt a general LLM to legal language, style, and reasoning patterns, enabling more accurate and fluent completions, clause generation, and preliminary legal Q&A.
| Feature | Value |
|---|---|
| Base model | LLaMA-3 7B / Unsloth (4bit) |
| Type | Continued Pretraining (CPT) |
| Domain | Legal (Caselaw, U.S.) |
| Dataset | Caselaw Access Project |
| Context length | 2048 |
| Quantization | 4-bit via Unsloth |
This model is ideal for:
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model = AutoModelForCausalLM.from_pretrained("yasserrmd/caselaw-cpt-8b").to("cuda")
tokenizer = AutoTokenizer.from_pretrained("yasserrmd/caselaw-cpt-8b")
prompt = "Q: What are the three conditions for res ipsa loquitur to apply?\nA:"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=100,
temperature=0.7,
top_p=0.9,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
“The three conditions are that the defendant had exclusive control over the instrumentality that caused the plaintiff's injury, the plaintiff's injury was the type of injury that would not occur in the absence of negligence, and the plaintiff was not guilty of contributory negligence.”
While not instruction-tuned, the model demonstrates:
For downstream evaluation, consider testing on:
config.jsonpytorch_model.bin or adapter_model.bin (if LoRA)tokenizer_config.jsontokenizer.model / tokenizer.jsongeneration_config.jsonThe base model follows its original license (Meta AI or Unsloth), and the Caselaw Access Project is in the public domain. This checkpoint is provided for research and educational use only. Not intended for actual legal advice or decisions.
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.