huggingface / huggingface_hub

The official Python client for the Huggingface Hub.
https://huggingface.co/docs/huggingface_hub
Apache License 2.0
2.02k stars 531 forks source link

Fix `InferenceClient.image_to_text` output value #2285

Closed Wauplin closed 4 months ago

Wauplin commented 4 months ago

Fix https://github.com/huggingface/huggingface_hub/issues/2273. For what I understand, server sometimes return an object, sometimes a list with one object, depending on the model framework/architecture. This PR fixes it client-side to always return a single item.

Also re-added a test about it.

HuggingFaceDocBuilderDev commented 4 months ago

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Wauplin commented 4 months ago

Impressive cassette

Ahah, took me 4 days to write it manually, I swear! :smile:

Thanks for the review!