@huggingface/inference 2.3.2 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,16 +11,18 @@ You can also try out a live [interactive notebook](https://observablehq.com/@hug
11
11
  ```console
12
12
  npm install @huggingface/inference
13
13
 
14
- yarn add @huggingface/inference
15
-
16
14
  pnpm add @huggingface/inference
15
+
16
+ yarn add @huggingface/inference
17
17
  ```
18
18
 
19
19
  ### Deno
20
20
 
21
- ```
22
- // This should automatically load the types located at https://www.unpkg.com/@huggingface/inference@2.3.2/dist/index.d.ts
23
- import { HfInference } from "https://www.unpkg.com/@huggingface/inference@2.3.2/dist/index.mjs"
21
+ ```ts
22
+ // esm.sh
23
+ import { HfInference } from "https://esm.sh/@huggingface/inference"
24
+ // or npm:
25
+ import { HfInference } from "npm:@huggingface/inference"
24
26
  ```
25
27
 
26
28
  ## Usage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huggingface/inference",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "packageManager": "pnpm@8.3.1",
5
5
  "license": "MIT",
6
6
  "author": "Tim Mikeladze <tim.mikeladze@gmail.com>",
@@ -44,9 +44,6 @@
44
44
  "vite": "^4.1.4",
45
45
  "vitest": "^0.29.8"
46
46
  },
47
- "bundledDependencies": [
48
- "@huggingface/shared"
49
- ],
50
47
  "resolutions": {},
51
48
  "scripts": {
52
49
  "build": "tsup src/index.ts --format cjs,esm --clean && pnpm run dts",
@@ -1,7 +1,7 @@
1
1
  import { InferenceOutputError } from "../../lib/InferenceOutputError";
2
2
  import type { BaseArgs, Options, RequestArgs } from "../../types";
3
3
  import { request } from "../custom/request";
4
- import { base64FromBytes } from "@huggingface/shared";
4
+ import { base64FromBytes } from "../../../../shared";
5
5
 
6
6
  export type ImageToImageArgs = BaseArgs & {
7
7
  /**
@@ -2,7 +2,7 @@ import { InferenceOutputError } from "../../lib/InferenceOutputError";
2
2
  import type { BaseArgs, Options } from "../../types";
3
3
  import { request } from "../custom/request";
4
4
  import type { RequestArgs } from "../../types";
5
- import { base64FromBytes } from "@huggingface/shared";
5
+ import { base64FromBytes } from "../../../../shared";
6
6
  import { toArray } from "../../utils/toArray";
7
7
 
8
8
  export type DocumentQuestionAnsweringArgs = BaseArgs & {
@@ -1,7 +1,7 @@
1
1
  import { InferenceOutputError } from "../../lib/InferenceOutputError";
2
2
  import type { BaseArgs, Options, RequestArgs } from "../../types";
3
3
  import { request } from "../custom/request";
4
- import { base64FromBytes } from "@huggingface/shared";
4
+ import { base64FromBytes } from "../../../../shared";
5
5
 
6
6
  export type VisualQuestionAnsweringArgs = BaseArgs & {
7
7
  inputs: {
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@huggingface/shared",
3
- "version": "1.0.0",
4
- "private": true,
5
- "main": "src/index.ts",
6
- "source": "src/index.ts",
7
- "types": "./src/index.ts"
8
- }
@@ -1,11 +0,0 @@
1
- export function base64FromBytes(arr: Uint8Array): string {
2
- if (globalThis.Buffer) {
3
- return globalThis.Buffer.from(arr).toString("base64");
4
- } else {
5
- const bin: string[] = [];
6
- arr.forEach((byte) => {
7
- bin.push(String.fromCharCode(byte));
8
- });
9
- return globalThis.btoa(bin.join(""));
10
- }
11
- }
@@ -1,3 +0,0 @@
1
- export * from './base64FromBytes';
2
- export * from './isBackend';
3
- export * from './isFrontend';
@@ -1,6 +0,0 @@
1
- const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
2
-
3
- const isWebWorker =
4
- typeof self === "object" && self.constructor && self.constructor.name === "DedicatedWorkerGlobalScope";
5
-
6
- export const isBackend = !isBrowser && !isWebWorker;
@@ -1,3 +0,0 @@
1
- import { isBackend } from "./isBackend";
2
-
3
- export const isFrontend = !isBackend;
@@ -1,14 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "esModuleInterop": true,
4
- "noEmit": false,
5
- "module": "ESNext",
6
- "target": "ESNext",
7
- "moduleResolution": "Node",
8
- "noImplicitAny": true,
9
- "strict": true,
10
- "strictNullChecks": true,
11
- "skipLibCheck": true,
12
- "composite": true
13
- }
14
- }