Views
No views yet
handler.py runtime for a Hugging Face Dedicated Endpoint.1{
2 "inputs": {
3 "prompt": "Analyze and describe this music segment.",
4 "audio_base64": "<base64-encoded WAV bytes>",
5 "sample_rate": 16000,
6 "max_new_tokens": 384,
7 "temperature": 0.1
8 }
9}1{
2 "generated_text": "..."
3}python scripts/hf_clone.py qwen-endpoint --repo-id YOUR_USERNAME/YOUR_QWEN_ENDPOINT_REPOcustom.handler.py from this folder into that repo as top-level handler.py.requirements.txt containing at least:
torchtorchaudiotransformers>=4.53.0,<4.58.0soundfilenumpyQWEN_MODEL_ID=Qwen/Qwen2-Audio-7B-Instructqwen_caption_app.py backend hf_endpoint at that endpoint URL.1python scripts/endpoint/test_qwen_caption_endpoint.py \
2 --url https://YOUR_ENDPOINT.endpoints.huggingface.cloud \
3 --token hf_xxx \
4 --audio path/to/song.wav