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

Missing test for accept header audio #1834

Open
StephenHodgson opened this issue Nov 17, 2023 · 2 comments
Open

Missing test for accept header audio #1834

StephenHodgson opened this issue Nov 17, 2023 · 2 comments

Comments

@StephenHodgson
Copy link

StephenHodgson commented Nov 17, 2023

We're testing the image header accept requests for valid return object encoding but not any of the audio tasks.

def test_accept_header_image(self, get_session_mock: MagicMock, bytes_to_image_mock: MagicMock) -> None:

Related to huggingface/api-inference-community#351

suggested test casees:

  • audio/mp3
  • audio/wav
@Wauplin
Copy link
Contributor

Wauplin commented Nov 17, 2023

We're testing the image header accept requests for valid return object encoding but not any of the audio tasks.

Not exactly. We are testing that if a task expects an image to be returned (i.e. "text-to-image" or"image-to-image"), then the Accept header must be set to png by default in the requests (more details in #1567).
But we are not testing the response from the Inference API. In general, I don't think we should use huggingface_hub test pipeline to test the Inference API (it's too compute intensive + tests are mocked anyway + InferenceClient is meant to work on several backends).

If we want to test that, it should be in https://github.com/huggingface/api-inference-community but I doubt it to be honest.

@StephenHodgson
Copy link
Author

StephenHodgson commented Nov 17, 2023

We should likely still add the test for expected audio result using the mime types for audio the same images at least.

I'm also using the tool internally for a published product using several inference endpoints, but as you said it's fairly trivial to handle the API requests in custom handler.py

IMHO, we should be be able to send accept headers in the hub tool as well. I think it's a valid use case to want a specific format as requested, but I've been waiting for this for months so I can complete my library for unity engine integration. I would really like to promote it for upcoming hackathons like The MIT Reality Hack in January.

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

No branches or pull requests

2 participants