fix-current-versioning
#6
by
eunhwanpark - opened
- modeling_motif.py +6 -0
modeling_motif.py
CHANGED
|
@@ -5,6 +5,7 @@ from typing import List, Optional, Tuple, Union
|
|
| 5 |
import torch
|
| 6 |
import torch.nn.functional as F
|
| 7 |
import torch.utils.checkpoint
|
|
|
|
| 8 |
from torch import nn
|
| 9 |
from torch.nn import CrossEntropyLoss
|
| 10 |
from transformers.activations import ACT2CLS as _ACT2CLS
|
|
@@ -22,6 +23,11 @@ from transformers.utils import (add_start_docstrings, add_start_docstrings_to_mo
|
|
| 22 |
|
| 23 |
from .configuration_motif import MotifConfig
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
class PolyNorm(torch.nn.Module):
|
| 27 |
"""
|
|
|
|
| 5 |
import torch
|
| 6 |
import torch.nn.functional as F
|
| 7 |
import torch.utils.checkpoint
|
| 8 |
+
import transformers
|
| 9 |
from torch import nn
|
| 10 |
from torch.nn import CrossEntropyLoss
|
| 11 |
from transformers.activations import ACT2CLS as _ACT2CLS
|
|
|
|
| 23 |
|
| 24 |
from .configuration_motif import MotifConfig
|
| 25 |
|
| 26 |
+
if transformers.__version__ >= "4.47.0":
|
| 27 |
+
raise ImportError(
|
| 28 |
+
"This version of transformers (>= 4.47.0) is not compatible with this model. "
|
| 29 |
+
"Please use an earlier version of transformers."
|
| 30 |
+
)
|
| 31 |
|
| 32 |
class PolyNorm(torch.nn.Module):
|
| 33 |
"""
|