Upload modeling_fastesm.py with huggingface_hub
Browse files- modeling_fastesm.py +6 -1
modeling_fastesm.py
CHANGED
|
@@ -25,7 +25,12 @@ from transformers.models.esm.modeling_esm import (
|
|
| 25 |
EsmClassificationHead,
|
| 26 |
)
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
|
| 31 |
def _create_pad_block_mask(attention_mask_2d: torch.Tensor):
|
|
|
|
| 25 |
EsmClassificationHead,
|
| 26 |
)
|
| 27 |
|
| 28 |
+
try:
|
| 29 |
+
# when used from AutoModel, these are in the same directory
|
| 30 |
+
from .embedding_mixin import EmbeddingMixin, Pooler
|
| 31 |
+
except:
|
| 32 |
+
# when running from our repo, these are in the base directory
|
| 33 |
+
from embedding_mixin import EmbeddingMixin, Pooler
|
| 34 |
|
| 35 |
|
| 36 |
def _create_pad_block_mask(attention_mask_2d: torch.Tensor):
|