Abruptly ended generation with inference_mmu.py
Hi,
I am running the inference_mmu.py file with the suggested commands and configs in the README.md. However, the generated text seems to have been finished abruptly. Could you suggest what might be causing the issue?
See the output for the first and third image, for instance:
0%| | 0/9 [00:00<?, ?it/s]
['The image contains three animals:']
11%|█████▉ | 1/9 [01:55<15:25, 115.69s/it]
['The image displays three key points']
22%|███████████▊ | 2/9 [03:51<13:28, 115.55s/it]
['The image contains the following objects:']
33%|█████████████████▋ | 3/9 [05:46<11:32, 115.45s/it]
['A black and white sign is on a document.']
44%|███████████████████████▌ | 4/9 [07:41<09:37, 115.44s/it]
Hi, thanks for your attention. This seems to be a very weird case that we didn't encounter. Could you please try the following configurations?
- Adjust sequence length to 1024/512 and block length to 256/128/64
- Test with MMaDA-8B-Base
Hi, I'm facing the same! Tried adjusting the seq len and block len, and using the Base model. It cuts off for me as well.
Hi, I think the problem is caused by the fact that mmada_demo.yaml specified the max generation length as follows:
dataset:
...
preprocessing:
max_seq_length: 512 # for text tokens
...
However, in inference_mmu.py on line #101:
output_ids = model.mmu_generate(input_ids, max_new_tokens=1024, steps=512, block_length=1024)
I changed this line to
output_ids = model.mmu_generate(input_ids, max_new_tokens=512, steps=256, block_length=64)
and was able to get coherent responses.
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.72it/s] 0%| | 0/9 [00:00<?, ?it/s]['The image is a vibrant and dynamic illustration of a book titled "Finger for Love Money" by Michael B. Brown. The cover features a rich, colorful background with a mix of red, green, and purple hues, creating a lively and energetic atmosphere. The text is bold and modern, with a mix of black and white, making the title stand out prominently. The overall design is cheerful and inviting, suggesting a theme of financial and financial success.']
11%|██████████████████████████▌ | 1/9 [00:46<06:08, 46.12s/it]["The image captures a close-up view of a dog standing in a field of vibrant yellow flowers. The dog's ears is perked up, with its eyes wide open, conveying a sense of curiosity and excitement. The background is a soft, of blue and yellow hues, suggesting a bright, sunny day. The sun is shining brightly, casting a warm glow over the entire scene."]
22%|█████████████████████████████████████████████████████ | 2/9 [01:32<05:23, 46.23s/it]['The image is a bar chart for the U.S. Travel & World website, showing the number of travel agents in different countries and regions in 2015. The chart is titled "Central U.S. Travel & World\'s 2015 Travel Agents by and Regions Regions" and is the largest bar chart in the image. The data is presented in Statista.']
33%|███████████████████████████████████████████████████████████████████████████████▋ | 3/9 [02:18<04:37, 46.20s/it]['The image depicts a serene underwater scene featuring a decorative sofa. The sofa is adorned with a variety of colorful pillows, including a large of vibrant fish patterns on the left side and a more intricate floral design on the right side. The pillows are arranged in a way that they aced the the sofa, creating a cohesive and inviting aesthetic..\n\nIn the background, a is shown with a partially visible rocky shore and a bright, blue sky with fluffy white clouds. The water is calm, with a light blue hue, and the are gentle waves lapping against the shore. The overall atmosphere is peaceful and picturesque, blending natural beauty with a touch of tranquility.']
44%|██████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 4/9 [03:04<03:50, 46.18s/it]['The image depicts a collection of five objects arranged on a plain, light-colored surface. The objects are:\n\n1. **Big brown cube**:\n - **Color**: Brown\n - **Size**: Big\n - **Material**: Shiny metal\n - **Shape**: Cube\n\n2. **Small brown cube**:\n - **Color**: Brown\n - **Size**: Small\n - **Material**: Shiny metal\n - **Shape**: Cube\n\n3. **Small brown cube**:\n - **Color**: Blue\n - **Size**: Small\n - **Material**: Shiny metal\n - **Shape**: Cube\n\n4. **Small brown cube**:\n - **Color**: Brown\n - **Size**: Small\n - **Material**: Shiny metal\n - **Shape**: Cube\n\n5. **Small brown cube**:\n - **Color**: Brown\n - **Size**: Small\n - **Material**: Shiny metal\n - **Shape**: Cube\n\n6. **Small brown cube**:\n - **Color**: Brown\n - **Size**: Small\n - **Material**: Shiny metal\n - **Shape**: Cube']
56%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 5/9 [03:50<03:04, 46.17s/it]
I met the same problem.
I use the same config as you mentioned, 512\256\64, but when I use this model to get detail descriptions, it always export a concise answer, for example "The image features a wooden bench placed against a plain wall. The bench is brown in length"