Instructions to use chunhuizng/AudioOnlyThinker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chunhuizng/AudioOnlyThinker with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="chunhuizng/AudioOnlyThinker", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("chunhuizng/AudioOnlyThinker", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use chunhuizng/AudioOnlyThinker with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "chunhuizng/AudioOnlyThinker" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chunhuizng/AudioOnlyThinker", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/chunhuizng/AudioOnlyThinker
- SGLang
How to use chunhuizng/AudioOnlyThinker with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "chunhuizng/AudioOnlyThinker" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chunhuizng/AudioOnlyThinker", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "chunhuizng/AudioOnlyThinker" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chunhuizng/AudioOnlyThinker", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use chunhuizng/AudioOnlyThinker with Docker Model Runner:
docker model run hf.co/chunhuizng/AudioOnlyThinker
AudioOnlyThinker
This model is a lightweight variant of Qwen2.5-Omni-7B, customized to remove the vision encoder and support only audio and text.
It is intended for use in audio-to-text instruction following, voice chat, and ASR-style tasks, and supports generation through generate() as with any decoder-only model.
π§ How this model was built
We extracted only the Thinker component from the full Qwen2.5-Omni model:
- β
Kept: Audio encoder (
audio_tower) + Language model (model) - β Removed: Vision encoder (
visual) + Talker (speech decoder) - β
Manually deleted
vision_configfromconfig.json - β
Class modified via subclassing
Qwen2_5OmniThinkerForConditionalGeneration
π¦ Usage: π§ How to use with AudioOnlyThinker class
This model uses a custom subclass AudioOnlyThinker, which disables the vision encoder.
You must define this class before calling .from_pretrained(). Example:
from transformers import Qwen2_5OmniThinkerForConditionalGeneration
class AudioOnlyThinker(Qwen2_5OmniThinkerForConditionalGeneration):
def __init__(self, config):
super().__init__(config)
self.visual = None
if hasattr(self.config, "vision_config"):
del self.config.vision_config
def forward(self, *args, pixel_values=None, pixel_values_videos=None, **kwargs):
return super().forward(*args, pixel_values=None, pixel_values_videos=None, **kwargs)
model = AudioOnlyThinker.from_pretrained("chunhuizng/AudioOnlyThinker")
from audio_only_processor import AudioOnlyProcessor
processor = AudioOnlyProcessor.from_pretrained("chunhuizng/AudioOnlyThinker")
conversation = [
{
"role": "user",
"content": [
{"type": "audio", "path": "your_audio.wav"},
{"type": "text", "text": "What is being said in this audio?"}
]
}
]
inputs = processor.apply_chat_template(conversation, tokenize=True, return_tensors="pt")
inputs = {k: v.to(model.device) for k, v in inputs.items()}
outputs = model.generate(**inputs, max_new_tokens=128)
response = processor.batch_decode(outputs, skip_special_tokens=True)[0]
print(response)
license: mit
- Downloads last month
- 8
Model tree for chunhuizng/AudioOnlyThinker
Base model
Qwen/Qwen2.5-Omni-7B