Skip to content

Commit 1af3e00

Browse files
committed
Partial revert of #1199, cleaner implem
1 parent 62e314a commit 1af3e00

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/inference/src/lib/makeRequestOptions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ function makeUrl(params: {
243243
}
244244
default: {
245245
const baseUrl = HF_HUB_INFERENCE_PROXY_TEMPLATE.replaceAll("{{PROVIDER}}", "hf-inference");
246+
if (params.taskHint && ["feature-extraction", "sentence-similarity"].includes(params.taskHint)) {
247+
/// when deployed on hf-inference, those two tasks are automatically compatible with one another.
248+
return `${baseUrl}/pipeline/${params.taskHint}/${params.model}`;
249+
}
246250
if (params.taskHint === "text-generation" && params.chatCompletion) {
247251
return `${baseUrl}/models/${params.model}/v1/chat/completions`;
248252
}

0 commit comments

Comments
 (0)