File tree Expand file tree Collapse file tree 3 files changed +3
-7
lines changed Expand file tree Collapse file tree 3 files changed +3
-7
lines changed Original file line number Diff line number Diff line change 770770 from .utils import is_torch_npu_available as is_torch_npu_available
771771 from .utils import is_torch_xla_available as is_torch_xla_available
772772 from .utils import is_torch_xpu_available as is_torch_xpu_available
773- from .utils import logging as logging
774773
775774 # bitsandbytes config
776775 from .utils .quantization_config import AqlmConfig as AqlmConfig
Original file line number Diff line number Diff line change 2424from torch .nn import BCELoss
2525
2626from ..modeling_utils import PreTrainedModel
27- from ..utils import ModelOutput , is_torch_available , logging
27+ from ..utils import ModelOutput , logging
2828from .configuration_utils import PretrainedConfig , WatermarkingConfig
29-
30-
31- if is_torch_available ():
32- from .logits_process import SynthIDTextWatermarkLogitsProcessor , WatermarkLogitsProcessor
29+ from .logits_process import SynthIDTextWatermarkLogitsProcessor , WatermarkLogitsProcessor
3330
3431
3532logger = logging .get_logger (__name__ )
Original file line number Diff line number Diff line change @@ -2138,7 +2138,7 @@ def _from_pretrained(
21382138 if template_file is None :
21392139 continue # I think this should never happen, but just in case
21402140 template_name = extra_chat_template .removeprefix ("chat_template_" )
2141- with open (template_file ) as chat_template_handle :
2141+ with open (template_file , "rt" , encoding = "utf8" ) as chat_template_handle :
21422142 chat_templates [template_name ] = chat_template_handle .read ()
21432143 if len (chat_templates ) == 1 and "default" in chat_templates :
21442144 init_kwargs ["chat_template" ] = chat_templates ["default" ]
You can’t perform that action at this time.
0 commit comments