Vision-CAIR
commited on
Commit
•
82f9662
1
Parent(s):
d92f9c8
Upload folder using huggingface_hub
Browse files- modeling_mistral.py +1 -0
- registry.py +9 -9
modeling_mistral.py
CHANGED
@@ -1121,6 +1121,7 @@ class MistralForCausalLM(MistralPreTrainedModel):
|
|
1121 |
output_hidden_states: Optional[bool] = None,
|
1122 |
return_dict: Optional[bool] = None,
|
1123 |
reduction: Optional[str] = "mean",
|
|
|
1124 |
) -> Union[Tuple, CausalLMOutputWithPast]:
|
1125 |
r"""
|
1126 |
Args:
|
|
|
1121 |
output_hidden_states: Optional[bool] = None,
|
1122 |
return_dict: Optional[bool] = None,
|
1123 |
reduction: Optional[str] = "mean",
|
1124 |
+
use_fastv: Optional[bool] = False,
|
1125 |
) -> Union[Tuple, CausalLMOutputWithPast]:
|
1126 |
r"""
|
1127 |
Args:
|
registry.py
CHANGED
@@ -31,16 +31,16 @@ class Registry:
|
|
31 |
def wrap(model_cls):
|
32 |
from .base_model import BaseModel
|
33 |
|
34 |
-
assert issubclass(
|
35 |
-
|
36 |
-
), "All models must inherit BaseModel class"
|
37 |
|
38 |
-
if name in cls.mapping["model_name_mapping"]:
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
cls.mapping["model_name_mapping"][name] = model_cls
|
45 |
return model_cls
|
46 |
|
|
|
31 |
def wrap(model_cls):
|
32 |
from .base_model import BaseModel
|
33 |
|
34 |
+
# assert issubclass(
|
35 |
+
# model_cls, BaseModel
|
36 |
+
# ), "All models must inherit BaseModel class"
|
37 |
|
38 |
+
# if name in cls.mapping["model_name_mapping"]:
|
39 |
+
# raise KeyError(
|
40 |
+
# "Name '{}' already registered for {}.".format(
|
41 |
+
# name, cls.mapping["model_name_mapping"][name]
|
42 |
+
# )
|
43 |
+
# )
|
44 |
cls.mapping["model_name_mapping"][name] = model_cls
|
45 |
return model_cls
|
46 |
|