zhouzaida
commited on
Commit
·
4ba2441
1
Parent(s):
49a5b66
fix GenerationMixin ImportError in transformers main branch
Browse files- config.json +2 -1
- modeling_kimi_vl.py +3 -5
config.json
CHANGED
@@ -19,7 +19,8 @@
|
|
19 |
"merge_kernel_size": [
|
20 |
2,
|
21 |
2
|
22 |
-
]
|
|
|
23 |
},
|
24 |
"text_config": {
|
25 |
"vocab_size": 163840,
|
|
|
19 |
"merge_kernel_size": [
|
20 |
2,
|
21 |
2
|
22 |
+
],
|
23 |
+
"torch_dtype": "bfloat16"
|
24 |
},
|
25 |
"text_config": {
|
26 |
"vocab_size": 163840,
|
modeling_kimi_vl.py
CHANGED
@@ -55,10 +55,8 @@ import torch.distributed as dist
|
|
55 |
from torch.nn import CrossEntropyLoss
|
56 |
from transformers.activations import GELUActivation, ACT2FN, PytorchGELUTanh
|
57 |
from transformers.cache_utils import Cache, DynamicCache
|
58 |
-
from transformers.modeling_utils import
|
59 |
-
|
60 |
-
GenerationMixin,
|
61 |
-
)
|
62 |
from transformers.models.llava.modeling_llava import LlavaCausalLMOutputWithPast
|
63 |
from transformers.modeling_attn_mask_utils import _prepare_4d_causal_attention_mask
|
64 |
from transformers.modeling_outputs import (
|
@@ -76,7 +74,7 @@ from transformers.utils import (
|
|
76 |
)
|
77 |
from transformers.utils.import_utils import is_torch_fx_available
|
78 |
|
79 |
-
from
|
80 |
|
81 |
|
82 |
if is_flash_attn_2_available():
|
|
|
55 |
from torch.nn import CrossEntropyLoss
|
56 |
from transformers.activations import GELUActivation, ACT2FN, PytorchGELUTanh
|
57 |
from transformers.cache_utils import Cache, DynamicCache
|
58 |
+
from transformers.modeling_utils import PreTrainedModel
|
59 |
+
from transformers.generation.utils import GenerationMixin
|
|
|
|
|
60 |
from transformers.models.llava.modeling_llava import LlavaCausalLMOutputWithPast
|
61 |
from transformers.modeling_attn_mask_utils import _prepare_4d_causal_attention_mask
|
62 |
from transformers.modeling_outputs import (
|
|
|
74 |
)
|
75 |
from transformers.utils.import_utils import is_torch_fx_available
|
76 |
|
77 |
+
from configuration_kimi_vl import MoonViTConfig, DeepseekV3Config, KimiVLConfig
|
78 |
|
79 |
|
80 |
if is_flash_attn_2_available():
|