Skip to content

Commit ef21855

Browse files
authored
Merge branch 'main' into fix_test-list-datasets
2 parents 27c14a1 + 81930c9 commit ef21855

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ You can run our packages with vanilla JS, without any bundler, by using a CDN or
9898

9999
```html
100100
<script type="module">
101-
import { InferenceClient } from 'https://cdn.jsdelivr.net/npm/@huggingface/inference@4.1.0/+esm';
101+
import { InferenceClient } from 'https://cdn.jsdelivr.net/npm/@huggingface/inference@4.2.0/+esm';
102102
import { createRepo, commit, deleteRepo, listFiles } from "https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm";
103103
</script>
104104
```

packages/inference/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@huggingface/inference",
3-
"version": "4.1.0",
3+
"version": "4.2.0",
44
"packageManager": "[email protected]",
55
"license": "MIT",
66
"author": "Hugging Face and Tim Mikeladze <[email protected]>",

packages/inference/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ export * from "./errors.js";
33
export * from "./types.js";
44
export * from "./tasks/index.js";
55
import * as snippets from "./snippets/index.js";
6+
export * from "./lib/getProviderHelper.js";
7+
export * from "./lib/makeRequestOptions.js";
68

79
export { snippets };

packages/inference/src/package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Generated file from package.json. Issues importing JSON directly when publishing on commonjs/ESM - see https://github.com/microsoft/TypeScript/issues/51783
2-
export const PACKAGE_VERSION = "4.1.0";
2+
export const PACKAGE_VERSION = "4.2.0";
33
export const PACKAGE_NAME = "@huggingface/inference";

packages/inference/src/providers/providerHelper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ export abstract class TaskProviderHelper {
115115
* Prepare the headers for the request
116116
*/
117117
prepareHeaders(params: HeaderParams, isBinary: boolean): Record<string, string> {
118-
const headers: Record<string, string> = { Authorization: `Bearer ${params.accessToken}` };
118+
const headers: Record<string, string> = {};
119+
if (params.authMethod !== "none") {
120+
headers["Authorization"] = `Bearer ${params.accessToken}`;
121+
}
119122
if (!isBinary) {
120123
headers["Content-Type"] = "application/json";
121124
}

0 commit comments

Comments
 (0)