-
Notifications
You must be signed in to change notification settings - Fork 14.1k
model : add ASR support for LFM2-Audio-1.5B (conformer) #18106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
@tdakhran would appreciate if you can do a test on your side! On my side, I confirm that removing some ggml_cont doesn't have negative effects on Metal + CPU |
tdakhran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked into it one more time, only few nitpicks.
@ngxson fyi I'm not sure this conformer matches upstream conformer, it could be modified.
| params.hop_length = hparams.audio_hop_len; | ||
| params.sample_rate = hparams.audio_sample_rate; | ||
| params.center_padding = true; | ||
| params.preemph = 0.97f; // disabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| params.preemph = 0.97f; // disabled | |
| params.preemph = 0.97f; |
| LOG_WRN("WARN: This is an experimental CLI for testing multimodal capability.\n"); | ||
| LOG_WRN(" For normal use cases, please use the standard llama-cli\n"); | ||
|
|
||
| eval_system_prompt_if_present(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| eval_system_prompt_if_present(); | |
| if (int res = eval_system_prompt_if_present(); res) { | |
| return res; | |
| } |
| ctx.chat_history.clear(); | ||
| llama_memory_clear(llama_get_memory(ctx.lctx), true); | ||
| LOG("Chat history cleared\n\n"); | ||
| eval_system_prompt_if_present(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| eval_system_prompt_if_present(); | |
| if (int res = eval_system_prompt_if_present(); res) { | |
| return res; | |
| } |
| params.prompt = mtmd_default_marker() + params.prompt; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| layer.conv_norm_w = get_tensor(string_format("convnext.%d.norm.%s", il, "weight")); | ||
| layer.conv_norm_b = get_tensor(string_format("convnext.%d.norm.%s", il, "bias")); | ||
| layer.conv_dw_w = get_tensor(string_format("convnext.%d.dw.%s", il, "weight")); | ||
| layer.conv_dw_b = get_tensor(string_format("convnext.%d.dw.%s", il, "bias")); | ||
| layer.conv_pw1_w = get_tensor(string_format("convnext.%d.pw1.%s", il, "weight")); | ||
| layer.conv_pw1_b = get_tensor(string_format("convnext.%d.pw1.%s", il, "bias")); | ||
| layer.conv_pw2_w = get_tensor(string_format("convnext.%d.pw2.%s", il, "weight")); | ||
| layer.conv_pw2_b = get_tensor(string_format("convnext.%d.pw2.%s", il, "bias")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if these strings require their own defines.
| std::array<ggml_tensor *, 7> pre_encode_conv_X_w = {nullptr}; | ||
| std::array<ggml_tensor *, 7> pre_encode_conv_X_b = {nullptr}; | ||
| ggml_tensor * pre_encode_out_w = nullptr; | ||
| ggml_tensor * pre_encode_out_b = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| std::array<ggml_tensor *, 7> pre_encode_conv_X_w = {nullptr}; | |
| std::array<ggml_tensor *, 7> pre_encode_conv_X_b = {nullptr}; | |
| ggml_tensor * pre_encode_out_w = nullptr; | |
| ggml_tensor * pre_encode_out_b = nullptr; | |
| std::array<ggml_tensor *, 7> pre_encode_conv_X_w = {nullptr}; | |
| std::array<ggml_tensor *, 7> pre_encode_conv_X_b = {nullptr}; | |
| ggml_tensor * pre_encode_out_w = nullptr; | |
| ggml_tensor * pre_encode_out_b = nullptr; |
Supersede #17694