Skip to content
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

[ASR] whisper fix language choice, test=asr #2828

Merged
merged 1 commit into from
Jan 12, 2023
Merged

[ASR] whisper fix language choice, test=asr #2828

merged 1 commit into from
Jan 12, 2023

Conversation

cxumol
Copy link
Contributor

@cxumol cxumol commented Jan 12, 2023

PR types

Bug fixes

PR changes

Others

Describe

fix #2827

Reference https://docs.python.org/3/library/stdtypes.html#dict.get

@CLAassistant
Copy link

CLAassistant commented Jan 12, 2023

CLA assistant check
All committers have signed the CLA.

@mergify mergify bot added the S2T asr/st label Jan 12, 2023
@cxumol cxumol changed the title fix: whisper language choice, test=asr [ASR] whisper fix language choice, test=asr Jan 12, 2023
@yt605155624 yt605155624 added this to the r1.4.0 milestone Jan 12, 2023
@@ -476,7 +476,7 @@ def transcribe(
decode_options["fp16"] = False

if decode_options.get(
"language", 'None') or decode_options.get("language", None) is None:
"language") == 'None' or decode_options.get("language", None) is None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里直接判断 "language" 是否在 decode_options 的 keys 里面就行吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

不行的, 因为如果用户未指定语种, 他可以按这样传入的参数

whisper_executor(language=None, *args)

那么 "language" 就会出现在 decode_options 的 keys 里面, 所以不能根据 "language" 在不在 decode_options 的 keys 里面来判断

下面是概念验证
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok

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.

Thank you for your contribution

@zxcd zxcd merged commit a99244d into PaddlePaddle:develop Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[S2T] Whisper transcription cannot choose languages
4 participants