Skip to content

Commit 7a2238f

Browse files
authored
[inference] prepare for 3.1.4 release (#1152)
1 parent 608526b commit 7a2238f

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

packages/inference/src/lib/makeRequestOptions.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,21 @@ export async function makeRequestOptions(
6868
? "hf-token"
6969
: "provider-key"
7070
: includeCredentials === "include"
71-
? "credentials-include"
72-
: "none";
71+
? "credentials-include"
72+
: "none";
7373

7474
const url = endpointUrl
7575
? chatCompletion
7676
? endpointUrl + `/v1/chat/completions`
7777
: endpointUrl
7878
: makeUrl({
79-
authMethod,
80-
chatCompletion: chatCompletion ?? false,
81-
forceTask,
82-
model,
83-
provider: provider ?? "hf-inference",
84-
taskHint,
85-
});
79+
authMethod,
80+
chatCompletion: chatCompletion ?? false,
81+
forceTask,
82+
model,
83+
provider: provider ?? "hf-inference",
84+
taskHint,
85+
});
8686

8787
const headers: Record<string, string> = {};
8888
if (accessToken) {
@@ -143,9 +143,9 @@ export async function makeRequestOptions(
143143
body: binary
144144
? args.data
145145
: JSON.stringify({
146-
...otherArgs,
147-
...(chatCompletion || provider === "together" ? { model } : undefined),
148-
}),
146+
...otherArgs,
147+
...(chatCompletion || provider === "together" ? { model } : undefined),
148+
}),
149149
...(credentials ? { credentials } : undefined),
150150
signal: options?.signal,
151151
};
@@ -244,7 +244,7 @@ function makeUrl(params: {
244244
return baseUrl;
245245
}
246246
default: {
247-
const baseUrl = HF_HUB_INFERENCE_PROXY_TEMPLATE.replaceAll("{{PROVIDER}}", "hf-inference")
247+
const baseUrl = HF_HUB_INFERENCE_PROXY_TEMPLATE.replaceAll("{{PROVIDER}}", "hf-inference");
248248
const url = params.forceTask
249249
? `${baseUrl}/pipeline/${params.forceTask}/${params.model}`
250250
: `${baseUrl}/models/${params.model}`;

packages/inference/test/vcr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ async function vcr(
117117

118118
const { default: tapes } = await import(TAPES_FILE);
119119

120-
const cacheCandidate = !url.startsWith(HF_HUB_URL) || url.startsWith("https://huggingface.co/api/inference-proxy/")
120+
const cacheCandidate = !url.startsWith(HF_HUB_URL) || url.startsWith("https://huggingface.co/api/inference-proxy/");
121121

122122
if (VCR_MODE === MODE.PLAYBACK && cacheCandidate) {
123123
if (!tapes[hash]) {

0 commit comments

Comments
 (0)