Update configuration_slip.py: use HF torch_dtype instead of hardcoded bfloat16
Browse files- configuration_slip.py +2 -0
configuration_slip.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
"""SLIP model configuration for HuggingFace Hub."""
|
| 2 |
|
|
|
|
| 3 |
from transformers import PretrainedConfig
|
| 4 |
|
| 5 |
|
|
@@ -22,6 +23,7 @@ class SLIPConfig(PretrainedConfig):
|
|
| 22 |
sensor_encoder=None,
|
| 23 |
**kwargs,
|
| 24 |
):
|
|
|
|
| 25 |
super().__init__(**kwargs)
|
| 26 |
self.llm_model_name = llm_model_name
|
| 27 |
self.max_llm_len = max_llm_len
|
|
|
|
| 1 |
"""SLIP model configuration for HuggingFace Hub."""
|
| 2 |
|
| 3 |
+
import torch
|
| 4 |
from transformers import PretrainedConfig
|
| 5 |
|
| 6 |
|
|
|
|
| 23 |
sensor_encoder=None,
|
| 24 |
**kwargs,
|
| 25 |
):
|
| 26 |
+
kwargs.setdefault("torch_dtype", "bfloat16")
|
| 27 |
super().__init__(**kwargs)
|
| 28 |
self.llm_model_name = llm_model_name
|
| 29 |
self.max_llm_len = max_llm_len
|