Skip to content

Commit 743fd8c

Browse files
authored
[Inference] Let's use lowercase left/right truncation direction parameter (#3548)
1 parent f2872ad commit 743fd8c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/huggingface_hub/inference/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ def feature_extraction(
10291029
normalize: Optional[bool] = None,
10301030
prompt_name: Optional[str] = None,
10311031
truncate: Optional[bool] = None,
1032-
truncation_direction: Optional[Literal["Left", "Right"]] = None,
1032+
truncation_direction: Optional[Literal["left", "right"]] = None,
10331033
model: Optional[str] = None,
10341034
) -> "np.ndarray":
10351035
"""
@@ -1054,7 +1054,7 @@ def feature_extraction(
10541054
truncate (`bool`, *optional*):
10551055
Whether to truncate the embeddings or not.
10561056
Only available on server powered by Text-Embedding-Inference.
1057-
truncation_direction (`Literal["Left", "Right"]`, *optional*):
1057+
truncation_direction (`Literal["left", "right"]`, *optional*):
10581058
Which side of the input should be truncated when `truncate=True` is passed.
10591059
10601060
Returns:

src/huggingface_hub/inference/_generated/_async_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ async def feature_extraction(
10561056
normalize: Optional[bool] = None,
10571057
prompt_name: Optional[str] = None,
10581058
truncate: Optional[bool] = None,
1059-
truncation_direction: Optional[Literal["Left", "Right"]] = None,
1059+
truncation_direction: Optional[Literal["left", "right"]] = None,
10601060
model: Optional[str] = None,
10611061
) -> "np.ndarray":
10621062
"""
@@ -1081,7 +1081,7 @@ async def feature_extraction(
10811081
truncate (`bool`, *optional*):
10821082
Whether to truncate the embeddings or not.
10831083
Only available on server powered by Text-Embedding-Inference.
1084-
truncation_direction (`Literal["Left", "Right"]`, *optional*):
1084+
truncation_direction (`Literal["left", "right"]`, *optional*):
10851085
Which side of the input should be truncated when `truncate=True` is passed.
10861086
10871087
Returns:

src/huggingface_hub/inference/_generated/types/feature_extraction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .base import BaseInferenceType, dataclass_with_extra
99

1010

11-
FeatureExtractionInputTruncationDirection = Literal["Left", "Right"]
11+
FeatureExtractionInputTruncationDirection = Literal["left", "right"]
1212

1313

1414
@dataclass_with_extra

0 commit comments

Comments
 (0)