Skip to content

Commit eefffd5

Browse files
committed
substitute /pipeline/sentence-embeddings to /pipeline/feature-extraction for sentence transformers
Signed-off-by: Raphael Glon <[email protected]>
1 parent 51e527f commit eefffd5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/huggingface_inference_toolkit/webservice_starlette.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ async def predict(request):
109109

110110
# We lazily load pipelines for alt tasks
111111
task = request.path_params.get("task", HF_TASK)
112+
if task == "feature-extraction" and HF_TASK in [
113+
"sentence-similarity",
114+
"sentence-embeddings",
115+
"sentence-ranking",
116+
]:
117+
task = "sentence-embeddings"
112118
inference_handler = INFERENCE_HANDLERS.get(task)
113119
if not inference_handler:
114120
with INFERENCE_HANDLERS_LOCK:

0 commit comments

Comments
 (0)