Downloads · 30 days
0
RexTRO111/InstructPythia-410M-LoRA-v1
InstructPythia-410M-LoRA-v1 is a text generation model from RexTRO111. Use it when you need the model to write or continue text. The card lists the license as cc-by-sa-3.0.
A compact instruction-tuning project that fine-tunes the standard, non-deduplicated EleutherAI/pythia-410m model on databricks/databricks-dolly-15k using 16-bit LoRA and Modal GPU compute.
Downloads · 30 days
0
Access
Public
Updated Jul 21, 2026
Repo size
9.5 MB
Likes
0
Public
Click a slice to open those files.
.safetensors9.5 MB · 72%
From the Hugging Face model README
A compact instruction-tuning project that fine-tunes the standard, non-deduplicated
EleutherAI/pythia-410m model on
databricks/databricks-dolly-15k
using 16-bit LoRA and Modal GPU compute.
| Item | Value |
|---|---|
| Base model | EleutherAI/pythia-410m |
| Dataset | databricks/databricks-dolly-15k |
| Training method | FP16 LoRA |
| Maximum sequence length | 768 tokens |
| Epochs | 3 |
| Training GPU | Modal A10 |
| Inference GPU | Modal T4 |
| Completed optimizer steps | 2,760 |
| Measured training time | 52 minutes 40 seconds |
| Training throughput | 13.962 samples/second |
| Final adapter path | /data/outputs/pythia-410m-dolly-lora/final-adapter |
The project saves checkpoints, the final PEFT adapter, tokenizer files, and training
metadata to a persistent Modal Volume named pythia-410m-dolly-output.
Observed test generations:
Prompt
Explain artificial intelligence in simple terms.
Response
Artificial Intelligence (AI) is the term for a new generation of computer
systems that are capable of performing tasks without human assistance. This can
be done by combining artificial neural networks with computational intelligence
algorithms to automate and improve the efficiency of our everyday life. AI
technology has already been used in areas such as robotics, video games,
healthcare, and manufacturing.
Prompt
What is the capital of France?
Response
Paris.
Prompt
Write a short poem about a robot exploring the Moon.
Response
I love to explore, it's the best way to meet new people.
The model performs well on simple explanations and basic factual questions, but creative constraint-following remains unreliable at this model size.
pythia-410m-dolly/
├── train.py
├── test_model.py
├── README.md
└── .venv/
Persistent files inside the Modal Volume:
/data/
├── cache/
│ └── huggingface/
└── outputs/
└── pythia-410m-dolly-lora/
├── checkpoint-*/
├── final-adapter/
│ ├── adapter_config.json
│ ├── adapter_model.safetensors
│ ├── tokenizer.json
│ ├── tokenizer_config.json
│ └── special_tokens_map.json
├── trainer_state.json
└── training_summary.json
mkdir -p ~/pythia-410m-dolly
cd ~/pythia-410m-dolly
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install --upgrade modal
modal setup
The training script uses approximately the following settings:
MODEL_NAME = "EleutherAI/pythia-410m"
DATASET_NAME = "databricks/databricks-dolly-15k"
MAX_LENGTH = 768
NUM_TRAIN_EPOCHS = 3
LEARNING_RATE = 2e-4
PER_DEVICE_TRAIN_BATCH_SIZE = 4
GRADIENT_ACCUMULATION_STEPS = 4
LORA_R = 16
LORA_ALPHA = 32
LORA_DROPOUT = 0.05
The effective training batch size is 16 examples per optimizer step.
The LoRA adapter targets Pythia/GPT-NeoX projection modules:
target_modules = [
"query_key_value",
"dense",
]
Training labels mask the instruction and context tokens with -100, so loss is
calculated only over response tokens.
Check the script before launching a paid GPU container:
python -m py_compile train.py
Start a detached Modal run:
modal run --detach train.py
Modal's --detach option keeps the remote application running if the local
process exits or disconnects.
The same Modal Volume cannot be mounted at two different paths in one function. This project mounts it once:
VOLUME_ROOT = "/data"
volumes = {
VOLUME_ROOT: output_volume,
}
Outputs and caches then use separate subdirectories:
OUTPUT_DIR = "/data/outputs/pythia-410m-dolly-lora"
CACHE_DIR = "/data/cache/huggingface"
Run the default prompt:
modal run test_model.py
Run a custom prompt:
modal run test_model.py \
--prompt "Explain artificial intelligence in simple terms."
Run deterministic greedy decoding:
modal run test_model.py \
--prompt "What is the capital of France?" \
--temperature 0 \
--max-new-tokens 80
Run sampled decoding:
modal run test_model.py \
--prompt "Write exactly four short lines about a robot on the Moon." \
--temperature 0.45 \
--top-p 0.85 \
--top-k 30 \
--repetition-penalty 1.12 \
--max-new-tokens 100
At inference time, the script loads the original base model and then attaches the saved LoRA weights:
base_model = AutoModelForCausalLM.from_pretrained(
"EleutherAI/pythia-410m",
torch_dtype=torch.float16,
)
model = PeftModel.from_pretrained(
base_model,
ADAPTER_DIR,
is_trainable=False,
)
mkdir -p downloaded-output
modal volume get \
pythia-410m-dolly-output \
outputs/pythia-410m-dolly-lora/final-adapter \
downloaded-output/
Inspect downloaded files:
find downloaded-output -type f -printf '%p %k KB\n'
The completed run reported:
train_runtime: 3160.6921 seconds
train_samples_per_second: 13.962
train_steps: 2760
epoch: 3.0
Late-run training losses were mostly around 1.90 to 2.14. Gradient norms
were generally stable, mostly near 0.7 to 1.3, with no obvious sign of
gradient explosion in the supplied logs.
This repository should not imply endorsement by EleutherAI, Databricks, Hugging Face, or Modal.