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

Fix Audio.encode_example() when writing an array #3998

Merged

Conversation

polinaeterna
Copy link
Contributor

Closes #3996

@polinaeterna polinaeterna marked this pull request as draft March 23, 2022 20:32
@polinaeterna polinaeterna changed the title Fix Audion.encode_example() in writing an array Fix Audio.encode_example() in writing an array Mar 23, 2022
@polinaeterna polinaeterna changed the title Fix Audio.encode_example() in writing an array Fix Audio.encode_example() when writing an array Mar 23, 2022
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 23, 2022

The documentation is not available anymore as the PR was closed or merged.

@polinaeterna polinaeterna marked this pull request as ready for review March 24, 2022 05:39
Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the fix!

Do you think we could add some regression test on this issue?

Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

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

Thanks ! and thanks for the test as well :)

@polinaeterna
Copy link
Contributor Author

@albertvillanova do you think this line is enough? that's why we missed this bug, we didn't check this case

Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

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

Great. Thank you!! :)

@@ -64,6 +64,7 @@ def test_audio_feature_type_to_arrow():
lambda audio_path: {"path": audio_path, "bytes": open(audio_path, "rb").read()},
lambda audio_path: {"path": None, "bytes": open(audio_path, "rb").read()},
lambda audio_path: {"bytes": open(audio_path, "rb").read()},
lambda audio_path: {"array": [0.1, 0.2, 0.3], "sampling_rate": 16_000},
Copy link
Member

Choose a reason for hiding this comment

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

Good!

@polinaeterna polinaeterna merged commit ef16631 into huggingface:master Mar 29, 2022
@polinaeterna polinaeterna deleted the fix-audio-encode-example branch March 29, 2022 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audio.encode_example() throws an error when writing example from array
4 participants