Upload model
Browse files- modeling_genbio.py +1 -4
modeling_genbio.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
import warnings
|
2 |
from lightning.pytorch import LightningModule
|
3 |
from lightning.pytorch.core.saving import _load_state
|
4 |
from transformers import PreTrainedModel, PretrainedConfig
|
@@ -32,9 +31,7 @@ class GenBioModel(PreTrainedModel):
|
|
32 |
# TODO: _load_state is a private function and it throws a warning for an
|
33 |
# empty state_dict. We need a fucntion to intialize our model; this
|
34 |
# is the only choice we have for now.
|
35 |
-
|
36 |
-
warnings.simplefilter("ignore")
|
37 |
-
self.genbio_model = _load_state(genbio_cls, checkpoint, strict_loading=False)
|
38 |
|
39 |
@classmethod
|
40 |
def from_genbio_model(cls, model: LightningModule):
|
|
|
|
|
1 |
from lightning.pytorch import LightningModule
|
2 |
from lightning.pytorch.core.saving import _load_state
|
3 |
from transformers import PreTrainedModel, PretrainedConfig
|
|
|
31 |
# TODO: _load_state is a private function and it throws a warning for an
|
32 |
# empty state_dict. We need a fucntion to intialize our model; this
|
33 |
# is the only choice we have for now.
|
34 |
+
self.genbio_model = _load_state(genbio_cls, checkpoint, strict_loading=False)
|
|
|
|
|
35 |
|
36 |
@classmethod
|
37 |
def from_genbio_model(cls, model: LightningModule):
|