Views
No views yet
1> cat /sys/kernel/debug/rknpu/version
2RKNPU driver: v0.9.8pip install numpy<2 opencv-python rknn-toolkit-lite2 librosa transformerspython multiprocess_inference.pytaskset -c 4-7 python multiprocess_inference.py)pip install --upgrade llvmliteW rknn-toolkit-lite2 version: 2.3.0 Start loading audio encoder model (size: 1300.25 MB) Start loading language model (size: 8037.93 MB) I rkllm: rkllm-runtime version: 1.1.2, rknpu driver version: 0.9.8, platform: RK3588 Audio encoder loaded in 13.65 seconds I RKNN: [20:30:05.616] RKNN Runtime Information, librknnrt version: 2.3.0 (c949ad889d@2024-11-07T11:35:33) I RKNN: [20:30:05.616] RKNN Driver Information, version: 0.9.8 I RKNN: [20:30:05.617] RKNN Model Information, version: 6, toolkit version: 2.3.0(compiler version: 2.3.0 (c949ad889d@2024-11-07T11:39:30)), target: RKNPU v2, target platform: rk3588, framework name: ONNX, framework layout: NCHW, model inference type: static_shape W RKNN: [20:30:07.950] query RKNN_QUERY_INPUT_DYNAMIC_RANGE error, rknn model is static shape type, please export rknn with dynamic_shapes W Query dynamic range failed. Ret code: RKNN_ERR_MODEL_INVALID. (If it is a static shape RKNN model, please ignore the above warning message.) Received ready signal: audio_ready Language model loaded in 9.94 seconds Received ready signal: llm_ready All models loaded, starting interactive mode... Enter your input (3 empty lines to start inference, Ctrl+C to exit, for example: 这是什么声音{{./jntm.mp3}}? What kind of sound is in {{./test.mp3}}? Describe the audio in {{./jntm.mp3}} 这是什么动物的叫声{{./jntm.mp3}}? ): 这是什么声音{{./jntm.mp3}}?????? Start audio inference... Received prompt: ====<|im_start|>system You are a helpful assistant.<|im_end|> <|im_start|>user Audio 1: <image> 这是什么声音??????<|im_end|> <|im_start|>assistant ==== /home/firefly/mnt/zt-back/Qwen2-7B-audiow/./multiprocess_inference.py:43: UserWarning: PySoundFile failed. Trying audioread instead. audio, _ = librosa.load(audio_path, sr=feature_extractor.sampling_rate) /home/firefly/.local/lib/python3.9/site-packages/librosa/core/audio.py:184: FutureWarning: librosa.core.audio.__audioread_load Deprecated as of librosa version 0.10.0. It will be removed in librosa version 1.0. y, sr_native = __audioread_load(path, offset, duration, dtype) Audio encoder inference time: 12.22 seconds (1, 251, 4096) (1, 251, 4096) Start LLM inference... 🎉 完成! Time to first token: 4.28 seconds 语音中是一段音乐,包含唱歌和乐器演奏。背景音乐里有鼓声、贝斯、钢琴和小号的演奏,同时背景能够听到胃里咕咕作响和吃东西的声音。这首歌可能是用于广告。 (finished) -------------------------------------------------------------------------------------- Stage Total Time (ms) Tokens Time per Token (ms) Tokens per Second -------------------------------------------------------------------------------------- Prefill 4269.62 283 15.09 66.28 Generate 13279.37 49 272.13 3.67 --------------------------------------------------------------------------------------
.rkllm和.rknn结尾的模型文件.rename_tensors.py文件复制到Qwen2-Audio-7B-Instruct的huggingface模型仓库根目录并运行. 稍等片刻, 会生成model-renamed-00001-of-00004.safetensors等4个safetensors文件和一个json文件.rkllm-convert.py. 等一会, 会生成qwen.rkllm, 就是转换后的模型.audio_encoder_export_onnx.py, 修改文件最下方模型路径为Qwen2-Audio-7B-Instruct模型文件夹的路径. 然后执行. 等一会, 会生成audio_encoder.onnx和很多权重文件.audio_encoder_convert_rknn.py all. 等一会, 会生成audio_encoder.rknn, 这就是转换后的音频编码器.multiprocess_inference.py.1> cat /sys/kernel/debug/rknpu/version
2RKNPU driver: v0.9.8pip install numpy<2 opencv-python rknn-toolkit-lite2 librosa transformerspython multiprocess_inference.pytaskset -c 4-7 python multiprocess_inference.py)pip install --upgrade llvmlite.rkllm and .rknn.rename_tensors.py file from this repository to the root directory of the Qwen2-Audio-7B-Instruct huggingface model repository and run it. Wait a moment, it will generate 4 safetensors files like model-renamed-00001-of-00004.safetensors and a json file.rkllm-convert.py. Wait a while, it will generate qwen.rkllm, which is the converted model.audio_encoder_export_onnx.py, modify the model path at the bottom of the file to the path of your Qwen2-Audio-7B-Instruct model folder. Then execute it. Wait a while, it will generate audio_encoder.onnx and many weight files.audio_encoder_convert_rknn.py all. Wait a while, it will generate audio_encoder.rknn, which is the converted audio encoder.multiprocess_inference.py.