Skip to content

Commit 7291a10

Browse files
authored
[Inference] Let's use lowercase left/right truncation direction parameter (#1841)
First spotted by @alvarobartt on [slack](https://huggingface.slack.com/archives/C064Z3GRU3U/p1762871481747849?thread_ts=1743434022.621759&cid=C064Z3GRU3U) (internal). The `FeatureExtractionInputTruncationDirection` parameter defined in the feature-extraction specs currently have capitalized values `Left` / `Right`. This comes from TEI implementation from which we pulled the specs. Let's switch it to lowercase values for consistency with all other specs. In addition to this PR, we should: - update TEI to accept `left`/`right` (not even sure we want backward compatibility on this) => @alvarobartt would you be able to handle this? - update `huggingface_hub` => I can take care of this huggingface/huggingface_hub#3548 - update `hub-docs` => will happen automatically I think it's fine to have breaking change for this. Moreover, specs / docs are there more for information but are rarely enforced (expect in TEI) so it shouldn't break anything client-side.
1 parent e495f15 commit 7291a10

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/tasks/src/tasks/feature-extraction/inference.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ export interface FeatureExtractionInput {
3838
* The text or list of texts to embed.
3939
*/
4040
export type FeatureExtractionInputs = string[] | string;
41-
export type FeatureExtractionInputTruncationDirection = "Left" | "Right";
41+
export type FeatureExtractionInputTruncationDirection = "left" | "right";

packages/tasks/src/tasks/feature-extraction/spec/input.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"$defs": {
5252
"FeatureExtractionInputTruncationDirection": {
5353
"type": "string",
54-
"enum": ["Left", "Right"],
54+
"enum": ["left", "right"],
5555
"title": "FeatureExtractionInputTruncationDirection"
5656
}
5757
}

0 commit comments

Comments
 (0)