Merge pull request #567 from emmanuel-ferdman/main

Migrate to modern Python Logger API
This commit is contained in:
Zhongjie Duan
2025-06-24 15:32:14 +08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -413,7 +413,7 @@ class BertEncoder(nn.Module):
if self.gradient_checkpointing and self.training:
if use_cache:
logger.warn(
logger.warning(
"`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`..."
)
use_cache = False

View File

@@ -1373,7 +1373,7 @@ class ChatGLMForConditionalGeneration(ChatGLMPreTrainedModel):
elif generation_config.max_new_tokens is not None:
generation_config.max_length = generation_config.max_new_tokens + input_ids_seq_length
if not has_default_max_length:
logger.warn(
logger.warning(
f"Both `max_new_tokens` (={generation_config.max_new_tokens}) and `max_length`(="
f"{generation_config.max_length}) seem to have been set. `max_new_tokens` will take precedence. "
"Please refer to the documentation for more information. "