Skip to content

Conversation

ZapBird
Copy link
Contributor

@ZapBird ZapBird commented Sep 29, 2022

__call__函数的参数audio_file为BytesIO类型时执行到self.preprocess(model, audio_file)会报错,需要判断audio_file为BytesIO类型时执行audio_file.seek(0)。

PR types

PR changes

Describe

__call__函数的参数audio_file为BytesIO类型时执行到self.preprocess(model, audio_file)会报错,需要判断audio_file为BytesIO类型时执行audio_file.seek(0)。
@mergify mergify bot added the CLI label Sep 29, 2022
@CLAassistant
Copy link

CLAassistant commented Sep 29, 2022

CLA assistant check
All committers have signed the CLA.

@yt605155624
Copy link
Collaborator

yt605155624 commented Sep 29, 2022

please refer to #2325 to format your code

SmileGoat
SmileGoat previously approved these changes Sep 29, 2022
Copy link
Contributor

@SmileGoat SmileGoat left a comment

Choose a reason for hiding this comment

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

LGTM

@yt605155624
Copy link
Collaborator

yt605155624 commented Sep 29, 2022

@ZapBird 请再看下 import 的顺序,需要按照字典序排序,import io 应该在 import os 之前

@@ -15,6 +15,7 @@
import os
import sys
import time
from io import BytesIO
Copy link
Collaborator

Choose a reason for hiding this comment

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

import 的位置不对,需要按照官方库、第三方库,字典序 import,否则过不了 CodeStyle 的 CI

@yt605155624
Copy link
Collaborator

麻烦您用 #2325 刷下格式吧

@yt605155624
Copy link
Collaborator

yt605155624 commented Sep 29, 2022

@ZapBird#2325 刷下格式,再 add , commit , push 就可以,不然总是过不了这条 CI,猜测是因为你多删除了一个空行,用工具会更方便地 format
image

@ZapBird
Copy link
Contributor Author

ZapBird commented Sep 29, 2022

@yt605155624 不好意思

Copy link
Collaborator

@yt605155624 yt605155624 left a comment

Choose a reason for hiding this comment

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

LGTM

@yt605155624 yt605155624 merged commit 7a13b35 into PaddlePaddle:develop Sep 30, 2022
1726650686 pushed a commit to 1726650686/PaddleSpeech that referenced this pull request Sep 30, 2022
* BytesIO类型时,要保证切到初始位置,这样多次读取才能够正常。比如__call__函数。
__call__函数的参数audio_file为BytesIO类型时执行到self.preprocess(model, audio_file)会报错,需要判断audio_file为BytesIO类型时执行audio_file.seek(0)。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants