Skip to content

Fix wav2vec error in Demos/ssl #3872

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

Merged
merged 7 commits into from
Nov 8, 2024
Merged

Conversation

Liyulingyue
Copy link
Contributor

@Liyulingyue Liyulingyue commented Nov 5, 2024

PR types

Bug fixes

PR changes

APIs

Describe

问题描述

调用SSLExecutor执行 wav2asr命令时,会加载asr模型,此时forward函数需要4个输入参数。调用SSLExecutor执行 wav2vec命令时,加载Base模型,forward只需要一个输入参数。

如果Python API先调用wav2asr,再调用wav2vec,SSLExecutor会因为model已存在,从而不会切换模型。提取特征时,wav2vec的代码会调用asr模型的forward函数,进而引发报错。

修改方式

检测SSLExecutor输入是否发生变化,如果输入的参数配置不同,删除model,从而重新加载对应的模型。

Copy link
Collaborator

@zxcd zxcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zxcd zxcd merged commit 5f40262 into PaddlePaddle:develop Nov 8, 2024
5 checks passed
@Liyulingyue Liyulingyue deleted the demos_ssl branch March 5, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants