(seed=42)
| 74 | param_group["lr"] = lr |
| 75 | |
| 76 | def seed_everything(seed=42): |
| 77 | os.environ['PYTHONHASHSEED'] = str(seed) |
| 78 | random.seed(seed) |
| 79 | np.random.seed(seed) |
| 80 | torch.manual_seed(seed) |
| 81 | torch.cuda.manual_seed(seed) |
| 82 | torch.cuda.manual_seed_all(seed) |
| 83 | torch.backends.cudnn.deterministic = True |
| 84 | torch.backends.cudnn.benchmark = False |
| 85 | |
| 86 | def generate_examples(gen, steps, truncation=0.7, n=100): |
| 87 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected