Text-to-Speech
KimiAudio
Safetensors
English
Chinese
qwen2
audio
audio-language-model
speech-recognition
audio-understanding
audio-generation
chat
custom_code
4-bit precision
bitsandbytes
Instructions to use agiws/Kimi-Audio-7B-Instruct-Q4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KimiAudio
How to use agiws/Kimi-Audio-7B-Instruct-Q4 with KimiAudio:
# Example usage for KimiAudio # pip install git+https://github.com/MoonshotAI/Kimi-Audio.git from kimia_infer.api.kimia import KimiAudio model = KimiAudio(model_path="agiws/Kimi-Audio-7B-Instruct-Q4", load_detokenizer=True) sampling_params = { "audio_temperature": 0.8, "audio_top_k": 10, "text_temperature": 0.0, "text_top_k": 5, } # For ASR asr_audio = "asr_example.wav" messages_asr = [ {"role": "user", "message_type": "text", "content": "Please transcribe the following audio:"}, {"role": "user", "message_type": "audio", "content": asr_audio} ] _, text = model.generate(messages_asr, **sampling_params, output_type="text") print(text) # For Q&A qa_audio = "qa_example.wav" messages_conv = [{"role": "user", "message_type": "audio", "content": qa_audio}] wav, text = model.generate(messages_conv, **sampling_params, output_type="both") sf.write("output_audio.wav", wav.cpu().view(-1).numpy(), 24000) print(text) - Notebooks
- Google Colab
- Kaggle
| { | |
| "resblock": "1", | |
| "num_gpus": 8, | |
| "batch_size": 32, | |
| "learning_rate": 0.0001, | |
| "adam_b1": 0.8, | |
| "adam_b2": 0.99, | |
| "lr_decay": 0.9999996, | |
| "seed": 1235, | |
| "upsample_rates": [5, 2, 2, 2, 2, 3, 2], | |
| "upsample_kernel_sizes": [9, 4, 4, 4, 4, 5, 4], | |
| "upsample_initial_channel": 2048, | |
| "resblock_kernel_sizes": [3,5, 7,11], | |
| "resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5], [1,3,5]], | |
| "use_tanh_at_final": false, | |
| "use_bias_at_final": false, | |
| "activation": "snakebeta", | |
| "snake_logscale": true, | |
| "use_cqtd_instead_of_mrd": true, | |
| "cqtd_filters": 128, | |
| "cqtd_max_filters": 1024, | |
| "cqtd_filters_scale": 1, | |
| "cqtd_dilations": [1, 2, 4], | |
| "cqtd_hop_lengths": [512, 256, 256], | |
| "cqtd_n_octaves": [9, 9, 9], | |
| "cqtd_bins_per_octaves": [24, 36, 48], | |
| "mpd_reshapes": [2, 3, 5, 7, 11], | |
| "use_spectral_norm": false, | |
| "discriminator_channel_mult": 1, | |
| "use_multiscale_melloss": true, | |
| "lambda_melloss": 15, | |
| "clip_grad_norm": 500, | |
| "segment_size": 86400, | |
| "num_mels": 80, | |
| "num_freq": 1025, | |
| "n_fft": 1024, | |
| "hop_size": 480, | |
| "win_size": 1024, | |
| "sampling_rate": 24000, | |
| "fmin": 0, | |
| "fmax": null, | |
| "fmax_for_loss": null, | |
| "num_workers": 4, | |
| "dist_config": { | |
| "dist_backend": "nccl", | |
| "dist_url": "tcp://localhost:5432", | |
| "world_size": 1 | |
| } | |
| } | |