Unverified Commit 0ee45906 authored by Omar Sanseviero's avatar Omar Sanseviero Committed by GitHub
Browse files

Fix MusicGen logging error (#26370)

* Fix logging error

* Update modeling_musicgen.py

* Update modeling_musicgen.py
parent 6accd5ef
...@@ -1310,8 +1310,7 @@ class MusicgenForCausalLM(MusicgenPreTrainedModel): ...@@ -1310,8 +1310,7 @@ class MusicgenForCausalLM(MusicgenPreTrainedModel):
if has_default_max_length and generation_config.max_new_tokens is None and generation_config.max_length == 20: if has_default_max_length and generation_config.max_new_tokens is None and generation_config.max_length == 20:
logger.warning( logger.warning(
f"Using the model-agnostic default `max_length` (={generation_config.max_length}) " f"Using the model-agnostic default `max_length` (={generation_config.max_length}) "
"to control the generation length. recommend setting `max_new_tokens` to control the maximum length of the generation.", "to control the generation length. recommend setting `max_new_tokens` to control the maximum length of the generation."
UserWarning,
) )
elif generation_config.max_new_tokens is not None: elif generation_config.max_new_tokens is not None:
if not has_default_max_length: if not has_default_max_length:
...@@ -2350,8 +2349,7 @@ class MusicgenForConditionalGeneration(PreTrainedModel): ...@@ -2350,8 +2349,7 @@ class MusicgenForConditionalGeneration(PreTrainedModel):
if has_default_max_length and generation_config.max_new_tokens is None: if has_default_max_length and generation_config.max_new_tokens is None:
logger.warning( logger.warning(
f"Using the model-agnostic default `max_length` (={generation_config.max_length}) " f"Using the model-agnostic default `max_length` (={generation_config.max_length}) "
"to control the generation length. recommend setting `max_new_tokens` to control the maximum length of the generation.", "to control the generation length. We recommend setting `max_new_tokens` to control the maximum length of the generation."
UserWarning,
) )
elif generation_config.max_new_tokens is not None: elif generation_config.max_new_tokens is not None:
if not has_default_max_length: if not has_default_max_length:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment