Text Generation
Transformers
Safetensors
Chinese
English
audio-only-thinker
qwen2.5
audio
open-source
thinker
conversational
custom_code
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, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- 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
Update README.md
Browse files
README.md
CHANGED
|
@@ -49,6 +49,27 @@ class AudioOnlyThinker(Qwen2_5OmniThinkerForConditionalGeneration):
|
|
| 49 |
return super().forward(*args, pixel_values=None, pixel_values_videos=None, **kwargs)
|
| 50 |
|
| 51 |
model = AudioOnlyThinker.from_pretrained("chunhuizng/AudioOnlyThinker")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
```
|
| 53 |
|
| 54 |
---
|
|
|
|
| 49 |
return super().forward(*args, pixel_values=None, pixel_values_videos=None, **kwargs)
|
| 50 |
|
| 51 |
model = AudioOnlyThinker.from_pretrained("chunhuizng/AudioOnlyThinker")
|
| 52 |
+
|
| 53 |
+
from audio_only_processor import AudioOnlyProcessor
|
| 54 |
+
|
| 55 |
+
processor = AudioOnlyProcessor.from_pretrained("chunhuizng/AudioOnlyThinker")
|
| 56 |
+
|
| 57 |
+
conversation = [
|
| 58 |
+
{
|
| 59 |
+
"role": "user",
|
| 60 |
+
"content": [
|
| 61 |
+
{"type": "audio", "path": "your_audio.wav"},
|
| 62 |
+
{"type": "text", "text": "What is being said in this audio?"}
|
| 63 |
+
]
|
| 64 |
+
}
|
| 65 |
+
]
|
| 66 |
+
|
| 67 |
+
inputs = processor.apply_chat_template(conversation, tokenize=True, return_tensors="pt")
|
| 68 |
+
inputs = {k: v.to(model.device) for k, v in inputs.items()}
|
| 69 |
+
outputs = model.generate(**inputs, max_new_tokens=128)
|
| 70 |
+
|
| 71 |
+
response = processor.batch_decode(outputs, skip_special_tokens=True)[0]
|
| 72 |
+
print(response)
|
| 73 |
```
|
| 74 |
|
| 75 |
---
|