Instructions to use moonshotai/Kimi-Audio-7B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KimiAudio
How to use moonshotai/Kimi-Audio-7B-Instruct with KimiAudio:
# Example usage for KimiAudio # pip install git+https://github.com/MoonshotAI/Kimi-Audio.git "transformers<5" import soundfile as sf from kimia_infer.api.kimia import KimiAudio model = KimiAudio(model_path="moonshotai/Kimi-Audio-7B-Instruct", 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
Update README.md
Browse files缺少glm speech_tokenizer
Traceback (most recent call last):
File "/home/zhibo/workspace/Kimi-Audio/test.py", line 3, in <module>
from kimia_infer.api.kimia import KimiAudio
File "/home/zhibo/workspace/Kimi-Audio/kimia_infer/api/kimia.py", line 10, in <module>
from .prompt_manager import KimiAPromptManager
File "/home/zhibo/workspace/Kimi-Audio/kimia_infer/api/prompt_manager.py", line 12, in <module>
from kimia_infer.models.tokenizer.glm4_tokenizer import Glm4Tokenizer
File "/home/zhibo/workspace/Kimi-Audio/kimia_infer/models/tokenizer/glm4_tokenizer.py", line 6, in <module>
from .glm4.speech_tokenizer.modeling_whisper import WhisperVQEncoder
ModuleNotFoundError: No module named 'kimia_infer.models.tokenizer.glm4.speech_tokenizer'
|
@@ -44,6 +44,7 @@ For more details, please refer to our [GitHub Repository](https://github.com/Moo
|
|
| 44 |
We recommend that you build a Docker image to run the inference. After cloning the inference code, you can construct the image using the `docker build` command.
|
| 45 |
```bash
|
| 46 |
git clone https://github.com/MoonshotAI/Kimi-Audio
|
|
|
|
| 47 |
cd Kimi-Audio
|
| 48 |
docker build -t kimi-audio:v0.1 .
|
| 49 |
```
|
|
|
|
| 44 |
We recommend that you build a Docker image to run the inference. After cloning the inference code, you can construct the image using the `docker build` command.
|
| 45 |
```bash
|
| 46 |
git clone https://github.com/MoonshotAI/Kimi-Audio
|
| 47 |
+
git submodule update --init
|
| 48 |
cd Kimi-Audio
|
| 49 |
docker build -t kimi-audio:v0.1 .
|
| 50 |
```
|