fix GenerationMixin ImportError in transformers main branch (#12)
Browse files- fix GenerationMixin ImportError in transformers main branch (4ba2441d1ca881cf9cb3e687184d490d7687c1ca)
- revert (2109fd69a52f3ff0aaf75c2f13b932a566bd1190)
- config.json +2 -1
- modeling_kimi_vl.py +2 -4
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 (
|
|
|
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 (
|