[Bug Fix] Update demo code to work with the latest transformers library version
The current demo code fails to run correctly with newer versions of the transformers library.
First, the audios parameter in the __call__ method of Qwen2AudioProcessor has been renamed to audio starting from transformers v4.54.0. While this doesn't throw an explicit error, the model silently fails to receive audio input. This is particularly confusing for beginners, who may mistakenly assume the model itself is corrupted rather than identifying the parameter mismatch.
Second, the existing GPU migration code (inputs.input_ids = inputs.input_ids.to("cuda")) causes a device mismatch error: RuntimeError: Expected all tensors to be on the same device, but got index is on cpu, different from other tensors on cuda:0 (when checking argument in method wrapper_CUDA__index_select). This can be fixed by moving the entire inputs object to CUDA instead of just input_ids.
This PR updates the demo code to address both issues, ensuring compatibility with the latest transformers versions .