test case pass. Although I added patch
--- a/src/transformers/models/janus/modeling_janus.py
+++ b/src/transformers/models/janus/modeling_janus.py
@@ -1285,7 +1285,7 @@ class JanusForConditionalGeneration(JanusPreTrainedModel, GenerationMixin):
input_ids, model_kwargs = self._expand_inputs_for_generation(
input_ids=input_ids,
attention_mask=attention_mask,
- expand_size=generation_config.num_return_sequences,
+ expand_size=generation_config.num_return_sequences or 1,
**model_kwargs,
)
@@ -1315,7 +1315,7 @@ class JanusForConditionalGeneration(JanusPreTrainedModel, GenerationMixin):
# batch_size should account for both conditional/unconditional input; hence multiplied by 2.
batch_size=batch_size * 2,
# we should have at least a cache len of seq_len + num_image_tokens.
- max_cache_len=max(generation_config.max_length, num_image_tokens + seq_len),
+ max_cache_len=max(generation_config.max_length or 0, num_image_tokens + seq_len),
model_kwargs=model_kwargs,
)
it still gets failed.
System Info
transformersversion: 5.3.0.dev0Who can help?
multimodal models: @zucchini-nlp
Information
Tasks
examplesfolder (such as GLUE/SQuAD, ...)Reproduction
git clone https://github.com/huggingface/transformers.git
cd transformers
pip install -e .
export RUN_SLOW=1
pytest -rA tests/models/janus/test_modeling_janus.py::JanusIntegrationTest::test_model_generate_images
Expected behavior
test case pass. Although I added patch
it still gets failed.