Idefics3: Error/ Bugs Found when no images token input
Author: mingxiang1006
Pull request: yes

## Errors
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Cell In[11], line 117
    115     inputs = processor( images=images_raw, text=prompt, return_tensors="pt")
    116 else:
--> 117     inputs = processor(text=prompt, return_tensors="pt")
    119 inputs = {k: v.to(DEVICE) for k, v in inputs.items()}
    121 # Generate the model's response

File ~/data/code-envs/python/py310_mx_sample_rag/lib/python3.10/site-packages/transformers/models/idefics3/processing_idefics3.py:311, in Idefics3Processor.__call__(self, images, text, audio, videos, image_seq_len, **kwargs)
    309     sample = split_sample[0]
    310     for i, image_prompt_string in enumerate(image_prompt_strings):
--> 311         sample += image_prompt_string + split_sample[i + 1]
    312     prompt_strings.append(sample)
    314 text_inputs = self.tokenizer(text=prompt_strings, **output_kwargs["text_kwargs"])

IndexError: list index out of range


Fixes # (issue)


## Before submitting
- I fixed the problem by updating the code for processing idefics3
- remove value errors if no images, because not every query will found similar images in my chunk


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @ylacombe, @eustlb
- graph models: @clefourrier

Library:

- flax: @sanchit-gandhi
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @muellerzr and @SunMarc
- chat templates: @Rocketknight1

Integrations:

- deepspeed: HF Trainer/Accelerate: @muellerzr
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc

Documentation: @stevhliu

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @sanchit-gandhi
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1

 -->


Comments:
Hmmm it seems like you committed 12k lines of code, was that the aim of the PR? 

Hi LysandreJik,

Maybe there is some conflict when i git fork, the only changes I made is to the processing_idefics3.py. Mainly from row 289 to row332 , as picture attached. 
![image](https://github.com/user-attachments/assets/cdbe7c66-9929-4f1d-b462-feae95cb4b9c)



Your fork seems to be a bit out of date unfortunately: 
![image](https://github.com/user-attachments/assets/cc3a0951-d54b-4067-99c2-d65580b3e6a8)