This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| from torch.nn import Module | |
| from collections import OrderedDict | |
| from typing import Mapping, Any, List, NamedTuple | |
| from unsloth import tokenizer_utils | |
| def do_nothing(*args, **kwargs): | |
| pass | |
| tokenizer_utils.fix_untrained_tokens = do_nothing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| from torch.optim.optimizer import Optimizer | |
| import math | |
| import torch.distributed as dist | |
| from torch.optim.optimizer import _dispatch_sqrt | |
| device = 'cuda' if torch.cuda.is_available() else 'cpu' | |
| class Adam_mini(Optimizer): |