LLM-1B-Lab / llm_lab /utils /seed.py
Vjeong's picture
docs: translate all Korean comments and docstrings to English
858e8b2
raw
history blame contribute delete
224 Bytes
"""Seed utility for reproducibility."""
import torch
def set_seed(seed: int = 42):
"""Set seed for reproducibility."""
torch.manual_seed(seed)
if torch.cuda.is_available():
torch.cuda.manual_seed(seed)