2025-04-19 14:14:36 +08:00
|
|
|
# Qwen2.5-Omni Offline Inference Examples
|
|
|
|
|
|
|
|
|
|
This folder provides several example scripts on how to inference Qwen2.5-Omni offline.
|
|
|
|
|
|
|
|
|
|
## Thinker Only
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Audio + image + video
|
2025-05-27 15:07:01 +08:00
|
|
|
python examples/offline_inference/qwen2_5_omni/only_thinker.py \
|
|
|
|
|
-q mixed_modalities
|
2025-04-19 14:14:36 +08:00
|
|
|
|
|
|
|
|
# Read vision and audio inputs from a single video file
|
2025-05-27 15:07:01 +08:00
|
|
|
python examples/offline_inference/qwen2_5_omni/only_thinker.py \
|
|
|
|
|
-q use_audio_in_video
|
2025-04-19 14:14:36 +08:00
|
|
|
|
|
|
|
|
# Multiple audios
|
2025-05-27 15:07:01 +08:00
|
|
|
python examples/offline_inference/qwen2_5_omni/only_thinker.py \
|
|
|
|
|
-q multi_audios
|
2025-04-19 14:14:36 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
This script will run the thinker part of Qwen2.5-Omni, and generate text response.
|
|
|
|
|
|
|
|
|
|
You can also test Qwen2.5-Omni on a single modality:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Process audio inputs
|
2025-05-27 15:07:01 +08:00
|
|
|
python examples/offline_inference/audio_language.py \
|
|
|
|
|
--model-type qwen2_5_omni
|
2025-04-19 14:14:36 +08:00
|
|
|
|
|
|
|
|
# Process image inputs
|
2025-05-27 15:07:01 +08:00
|
|
|
python examples/offline_inference/vision_language.py \
|
|
|
|
|
--modality image \
|
|
|
|
|
--model-type qwen2_5_omni
|
2025-04-19 14:14:36 +08:00
|
|
|
|
|
|
|
|
# Process video inputs
|
2025-05-27 15:07:01 +08:00
|
|
|
python examples/offline_inference/vision_language.py \
|
|
|
|
|
--modality video \
|
|
|
|
|
--model-type qwen2_5_omni
|
2025-04-19 14:14:36 +08:00
|
|
|
```
|