Files
dsp15/download_base_weights.py
T
2026-05-21 01:21:51 +08:00

16 lines
555 B
Python

from transformers import ByT5Tokenizer, T5ForConditionalGeneration
model_name = "google/byt5-base"
print(f"Downloading and saving {model_name} locally...")
# Download tokenizer and model
tokenizer = ByT5Tokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name, use_safetensors=True)
# Save to a NEW directory to keep it separate from your small model
save_path = "./byt5_base_local_weights"
tokenizer.save_pretrained(save_path)
model.save_pretrained(save_path)
print(f"Done! Weights are now in {save_path}")