Qwen_Qwen2-Audio-7B-Instruct
Qwen · View on Hugging Face ↗
Model card
The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.
license: apache-2.0 language:
- en tags:
- chat
- audio
- audio-text-to-text
Qwen2-Audio-7B-Instruct
Introduction
Qwen2-Audio is the new series of Qwen large audio-language models. Qwen2-Audio is capable of accepting various audio signal inputs and performing audio analysis or direct textual responses with regard to speech instructions. We introduce two distinct audio interaction modes:
voice chat: users can freely engage in voice interactions with Qwen2-Audio without text input;
audio analysis: users could provide audio and text instructions for analysis during the interaction;
We release Qwen2-Audio-7B and Qwen2-Audio-7B-Instruct, which are pretrained model and chat model respectively.
For more details, please refer to our Blog, GitHub, and Report.
Requirements
The code of Qwen2-Audio has been in the latest Hugging face transformers and we advise you to build from source with command pip install git+https://github.com/huggingface/transformers, or you might encounter the following error:
KeyError: 'qwen2-audio'
Quickstart
In the following, we demonstrate how to use Qwen2-Audio-7B-Instruct for the inference, supporting both voice chat and audio analysis modes. Note that we have used the ChatML format for dialog, in this demo we show how to leverage apply_chat_template for this purpose.
Voice Chat Inference
In the voice chat mode, users can freely engage in voice interactions with Qwen2-Audio without text input:
from io import BytesIO
from urllib.request import urlopen
import librosa
from transformers import Qwen2AudioForConditionalGeneration, AutoProcessor
processor = AutoProcessor.from_pretrained("Qwen/Qwen2-Audio-7B-Instruct")
model = Qwen2AudioForConditionalGeneration.from_pretrained("Qwen/Qwen2-Audio-7B-Instruct", device_map="auto")
conversation = [
{"role": "user", "content": [
{"type": "audio", "audio_url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen2-Audio/audio/guess_age_gender.wav"},
]},
{"role": "assistant", "content": "Yes, the speaker is female and in her twenties."},
{"role": "user", "content": [
{"type": "audio", "audio_url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen2-Audio/audio/translate_to_chinese.wav"},
]},
]
text = processor.apply_chat_template(conversation, add_generation_prompt=True, tokenize=False)
audios = []
for message in conversation:
if isinstance(message["content"], list):
for ele in message["content"]:
if ele["type"] == "audio":
audios.append(librosa.load(
BytesIO(urlopen(ele['audio_url']).read()),
sr=processor.feature_extractor.sampling_rate)[0]
)
inputs = processor(text=text, audios=audios, return_tensors="pt", padding=True)
inputs.input_ids = inputs.input_ids.to("cuda")
generate_ids = model.generate(**inputs, max_length=256)
generate_ids = generate_ids[:, inputs.input_ids.size(1):]
response = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
Audio Analysis Inference
In the audio analysis, users could provide both audio and text instructions for analysis:
from io import BytesIO
from urllib.request import urlopen
import librosa
from transformers import Qwen2AudioForConditionalGeneration, AutoProcessor
processor = AutoProcessor.from_pretrained("Qwen/Qwen2-Audio-7B-Instruct")
model = Qwen2AudioForConditionalGeneration.from_pretrained("Qwen/Qwen2-Audio-7B-Instruct", device_map="auto")
conversation = [
{'role': 'system', 'content': 'You are a helpful assistant.'},
{"role": "user", "content": [
{"type": "audio", "audio_url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen2-Audio/audio/glass-breaking-151256.mp3"},
{"type": "text", "text": "What's that sound?"},
]},
{"role": "assistant", "content": "It is the sound of glass shattering."},
{"role": "user", "content": [
{"type": "text", "text": "What can you do when you hear that?"},
]},
{"role": "assistant", "content": "Stay alert and cautious, and check if anyone is hurt or if there is any damage to property."},
{"role": "user", "content": [
{"type": "audio", "audio_url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen2-Audio/audio/1272-128104-0000.flac"},
{"type": "text", "text": "What does the person say?"},
]},
]
text = processor.apply_chat_template(conversation, add_generation_prompt=True, tokenize=False)
audios = []
for message in conversation:
if isinstance(message["content"], list):
for ele in message["content"]:
if ele["type"] == "audio":
audios.append(
librosa.load(
BytesIO(urlopen(ele['audio_url']).read()),
sr=processor.feature_extractor.sampling_rate)[0]
)
inputs = processor(text=text, audios=audios, return_tensors="pt", padding=True)
inputs.input_ids = inputs.input_ids.to("cuda")
generate_ids = model.generate(**inputs, max_length=256)
generate_ids = generate_ids[:, inputs.input_ids.size(1):]
response = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
Batch Inference
We also support batch inference:
from io import BytesIO
from urllib.request import urlopen
import librosa
from transformers import Qwen2AudioForConditionalGeneration, AutoProcessor
processor = AutoProcessor.from_pretrained("Qwen/Qwen2-Audio-7B-Instruct")
model = Qwen2AudioForConditionalGeneration.from_pretrained("Qwen/Qwen2-Audio-7B-Instruct", device_map="auto")
conversation1 = [
{"role": "user", "content": [
{"type": "audio", "audio_url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen2-Audio/audio/glass-breaking-151256.mp3"},
{"type": "text", "text": "What's that sound?"},
]},
{"role": "assistant", "content": "It is the sound of glass shattering."},
{"role": "user", "content": [
{"type": "audio", "audio_url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen2-Audio/audio/f2641_0_throatclearing.wav"},
{"type": "text", "text": "What can you hear?"},
]}
]
conversation2 = [
{"role": "user", "content": [
{"type": "audio", "audio_url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen2-Audio/audio/1272-128104-0000.flac"},
{"type": "text", "text": "What does the person say?"},
]},
]
conversations = [conversation1, conversation2]
text = [processor.apply_chat_template(conversation, add_generation_prompt=True, tokenize=False) for conversation in conversations]
audios = []
for conversation in conversations:
for message in conversation:
if isinstance(message["content"], list):
for ele in message["content"]:
if ele["type"] == "audio":
audios.append(
librosa.load(
BytesIO(urlopen(ele['audio_url']).read()),
sr=processor.feature_extractor.sampling_rate)[0]
)
inputs = processor(text=text, audios=audios, return_tensors="pt", padding=True)
inputs['input_ids'] = inputs['input_ids'].to("cuda")
inputs.input_ids = inputs.input_ids.to("cuda")
generate_ids = model.generate(**inputs, max_length=256)
generate_ids = generate_ids[:, inputs.input_ids.size(1):]
response = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)
Citation
If you find our work helpful, feel free to give us a cite.
@article{Qwen2-Audio,
title={Qwen2-Audio Technical Report},
author={Chu, Yunfei and Xu, Jin and Yang, Qian and Wei, Haojie and Wei, Xipin and Guo, Zhifang and Leng, Yichong and Lv, Yuanjun and He, Jinzheng and Lin, Junyang and Zhou, Chang and Zhou, Jingren},
journal={arXiv preprint arXiv:2407.10759},
year={2024}
}
@article{Qwen-Audio,
title={Qwen-Audio: Advancing Universal Audio Understanding via Unified Large-Scale Audio-Language Models},
author={Chu, Yunfei and Xu, Jin and Zhou, Xiaohuan and Yang, Qian and Zhang, Shiliang and Yan, Zhijie and Zhou, Chang and Zhou, Jingren},
journal={arXiv preprint arXiv:2311.07919},
year={2023}
}
Magnet link
Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:
magnet:?xt=urn:btih:3e25b270fc48c1aa7dcecf76c0c18a1830550da8&dn=Qwen_Qwen2-Audio-7B-InstructOpen magnet in torrent client · infohash 3e25b270fc48c1aa7dcecf76c0c18a1830550da8
Files & hashes
| Path | Size | sha1 | sha256 |
|---|---|---|---|
| README.md | 8.5 KB (8,690 B) | b6b52f84f876ccc6e19270a5bb6e99bf738e48f9 | fbf74b41e488ca92fa2f812813dad132f3239b16c92a89221da7598dfd660831 |
| config.json | 853 B (853 B) | fb0e65eb25c07db35f951aaf3f0fc73b024545a2 | ab122e112e2450f10cec59216185bd519ccd7529c79d4c1c00255d43b97a037d |
| generation_config.json | 230 B (230 B) | 2d21cdd6d40003de26591ff0a438801e25a42107 | 8d9ef5bcbf4f16db89ef19828420d69546680e2ae413411523688090b40f337a |
| merges.txt | 1.6 MB (1,671,839 B) | 20024bfe7c83998e9aeaf98a0cd6a2ce6306c2f0 | 599bab54075088774b1733fde865d5bd747cbcc7a547c5bc12610e874e26f5e3 |
| model-00001-of-00005.safetensors | 3.64 GB (3,911,340,848 B) | acc8648653919d11707d0dcc737afe40aeadc141 | 383de5b5b06f7e7f276850a065d9164641c93009f79a377352a7c949d17c1d7a |
| model-00002-of-00005.safetensors | 3.71 GB (3,980,786,080 B) | 164e60dc976f57ff58dc0af62552f1fa2d1708b9 | 610e59a23cdf1f78d7e3b42e69f2e1a08578f29726391a1772aecac95db3c59c |
| model-00003-of-00005.safetensors | 3.71 GB (3,980,819,456 B) | 479a9d8ee9f79a0b85da529a4688ace0e6b7163a | b9ea76e97226524a12b6acc5e896bebf01a01018fbcad20a72eb13c7950f6916 |
| model-00004-of-00005.safetensors | 3.39 GB (3,643,135,696 B) | 80104c339da40f412fb42bef297cbd2697d5f42e | d68dee591619e26e3d0af23a07e181c70134fbc3aa33e24d872224607aae2c62 |
| model-00005-of-00005.safetensors | 1.19 GB (1,278,214,288 B) | 070ebac48de46a38cac0163cb2c581736ad03b0f | a447dab3e72f9debd37a0c4ae0b9179a1bad2b06357092a77c066a0405bbc7d2 |
| model.safetensors.index.json | 77.1 KB (78,989 B) | a87cfff186b87b06228b3bef411296e9e305f8b1 | b6cc05302d1bd25fbab6915e3a033603c524416b984f661d213f9a1f8e3b3895 |
| preprocessor_config.json | 342 B (342 B) | 3cd6c4610c3e6e98af27fcdf9ffdcb83c498549a | 4cd7c6c061fe79244c57b0c320b2873f3ee5acce2277f7cc3aced042725680f2 |
| tokenizer.json | 6.7 MB (7,028,015 B) | 33ea6c72ebb92a237fa2bdf26c5ff16592efcdae | f7c9b2dba4a296b1aa76c16a34b8225c0c118978400d4bb66bff0902d702f5b8 |
| tokenizer_config.json | 623.4 KB (638,335 B) | 8071e4b39d30f19114e082f888d5cf83f2ac7c3d | c738158e70eeecf25736a6c4d8e5f34cfce683079980757edfb0665a7b2457ed |
| vocab.json | 2.6 MB (2,776,833 B) | 4783fe10ac3adce15ac8f358ef5462739852c569 | ca10d7e9fb3ed18575dd1e277a2579c16d108e32f27439684afa0e10b1440910 |
Cite this release
- Canonical URL
- https://aiseedbank.org/models/Qwen_Qwen2-Audio-7B-Instruct/
- Slug
- Qwen_Qwen2-Audio-7B-Instruct
- Infohash
- 3e25b270fc48c1aa7dcecf76c0c18a1830550da8
- License
- apache-2.0
- Signing key fingerprint
- 85a3b32c3712427b
Every file carries a locally computed sha256 — verify a download against the signed sums: Qwen_Qwen2-Audio-7B-Instruct.SHA256SUMS (+ minisign signature).
Provenance
| Upstream repository | Qwen/Qwen2-Audio-7B-Instruct |
|---|---|
| Revision (pinned) | 0a095220c30b7b31434169c3086508ef3ea5bf0a |
| Fetched at | 2026-09-03T19:05:12Z |
| License at fetch | apache-2.0 |
| Snapshot tool | huggingface · seedbank 0.1.0 |
Trackers
- udp://announce.aitorrent.org:6969/announce
- http://announce.aitorrent.org:7070/announce
- udp://announce2.aitorrent.org:6970/announce
- http://announce2.aitorrent.org:7071/announce
- udp://tracker.opentrackr.org:1337/announce
- udp://open.demonii.com:1337/announce
- udp://open.stealth.si:80/announce
- udp://exodus.desync.com:6969/announce
- udp://tracker.torrent.eu.org:451/announce
✓ verified · rehash-vs-hf-metadata at 2026-09-03T19:08:12Z
apache-2.015.65 GB (16,806,500,494 bytes)transformerssafetensorsqwen2_audiotext2text-generationchataudioaudio-text-to-textendpoints_compatible1 language (en)paper: 2407.10759paper: 2311.07919