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

Accept string[] as feature-extraction input #1166

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Feb 3, 2025

Related to huggingface/huggingface_hub#2824.

This PR makes it possible to send a string[] instead of string as feature-extraction inputs. This is already possible in practice in Inference API but not documented.

In the past, I've pushed back on this change (see huggingface/huggingface_hub#1745 and huggingface/huggingface_hub#1746 (comment)) but I think it's fine to revisit it now. The main reason I mentioned was that feature-extraction's server-side implementation was mostly a for-loop on the text input so acception a string[] would not really improve performances. That been said, there has been quite some improvements since then and especially the text-embedding-inference framework.

@Wauplin Wauplin merged commit 34e5352 into main Feb 4, 2025
5 checks passed
@Wauplin Wauplin deleted the accept-list-of-str-as-feature-extraction-input branch February 4, 2025 10:20
Wauplin added a commit that referenced this pull request Feb 5, 2025
Related to #1166 (and
see
#1178).

In #1166, I've made
possible to pass either a `string` or `string[]` as `feature-extraction`
input. But since this schema is based on TEI via the
`inference-tei-import` script, we also need to update it which this PR
does.

**Expectation:** exact same specs but this time we won't have a PR like
https://github.com/huggingface/huggingface.js/pull/1178/files opened.
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.

2 participants