Skip to content

Commit

Permalink
Partial revert of #1199, cleaner implem
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-c committed Feb 13, 2025
1 parent 62e314a commit 1af3e00
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/inference/src/lib/makeRequestOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ function makeUrl(params: {
}
default: {
const baseUrl = HF_HUB_INFERENCE_PROXY_TEMPLATE.replaceAll("{{PROVIDER}}", "hf-inference");
if (params.taskHint && ["feature-extraction", "sentence-similarity"].includes(params.taskHint)) {
/// when deployed on hf-inference, those two tasks are automatically compatible with one another.
return `${baseUrl}/pipeline/${params.taskHint}/${params.model}`;
}
if (params.taskHint === "text-generation" && params.chatCompletion) {
return `${baseUrl}/models/${params.model}/v1/chat/completions`;
}
Expand Down

0 comments on commit 1af3e00

Please sign in to comment.