Update pre-commit & run on all files
This commit is contained in:
parent
0fae5b206b
commit
bcfdba109f
|
@ -14,11 +14,11 @@ repos:
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v3.15.1
|
rev: v3.15.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.2.2
|
rev: v0.3.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [--fix]
|
args: [--fix]
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
"""
|
"""
|
||||||
Various positional encodings for the transformer.
|
Various positional encodings for the transformer.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
|
|
@ -6,6 +6,7 @@ Copy-paste from torch.nn.Transformer with modifications:
|
||||||
* extra LN at the end of encoder is removed
|
* extra LN at the end of encoder is removed
|
||||||
* decoder returns a stack of activations from all decoding layers
|
* decoder returns a stack of activations from all decoding layers
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ Misc functions, including distributed helpers.
|
||||||
|
|
||||||
Mostly copy-paste from torchvision references.
|
Mostly copy-paste from torchvision references.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import os
|
import os
|
||||||
import pickle
|
import pickle
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
A collection of utilities for working with nested tensor structures consisting
|
A collection of utilities for working with nested tensor structures consisting
|
||||||
of numpy arrays and torch tensors.
|
of numpy arrays and torch tensors.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
Loading…
Reference in New Issue