hf-version-issue
#4
by eunhwanpark - opened
- modeling_motif.py +7 -0
modeling_motif.py
CHANGED
|
@@ -6,6 +6,13 @@ import torch.utils.checkpoint
|
|
| 6 |
from torch import nn
|
| 7 |
from torch.nn import CrossEntropyLoss
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
from transformers.activations import ACT2CLS as _ACT2CLS
|
| 10 |
from transformers.activations import ClassInstantier
|
| 11 |
from transformers.cache_utils import Cache, DynamicCache, SlidingWindowCache, StaticCache
|
|
|
|
| 6 |
from torch import nn
|
| 7 |
from torch.nn import CrossEntropyLoss
|
| 8 |
|
| 9 |
+
import transformers
|
| 10 |
+
if int(transformers.__version__.split(".")[0]) >= 5:
|
| 11 |
+
raise ImportError(
|
| 12 |
+
f"This module requires transformers < 5.0.0, but found {transformers.__version__}. "
|
| 13 |
+
"Please downgrade: pip install 'transformers<5'"
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
from transformers.activations import ACT2CLS as _ACT2CLS
|
| 17 |
from transformers.activations import ClassInstantier
|
| 18 |
from transformers.cache_utils import Cache, DynamicCache, SlidingWindowCache, StaticCache
|