New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@huggingface/inference

Package Overview
Dependencies
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@huggingface/inference - npm Package Compare versions

Comparing version 1.5.1 to 1.5.2

60

dist/index.d.ts

@@ -1,2 +0,2 @@

type Options = {
interface Options {
/**

@@ -18,6 +18,6 @@ * (Default: true) Boolean. If a request 503s and wait_for_model is set to false, the request will be retried with the same parameters but with wait_for_model set to true.

wait_for_model?: boolean;
};
type Args = {
}
interface Args {
model: string;
};
}
type FillMaskArgs = Args & {

@@ -80,3 +80,3 @@ inputs: string;

};
type SummarizationReturn = {
interface SummarizationReturn {
/**

@@ -86,3 +86,3 @@ * The string after translation

summary_text: string;
};
}
type QuestionAnswerArgs = Args & {

@@ -94,3 +94,3 @@ inputs: {

};
type QuestionAnswerReturn = {
interface QuestionAnswerReturn {
/**

@@ -112,3 +112,3 @@ * A string that’s the answer within the text.

start: number;
};
}
type TableQuestionAnswerArgs = Args & {

@@ -126,3 +126,3 @@ inputs: {

};
type TableQuestionAnswerReturn = {
interface TableQuestionAnswerReturn {
/**

@@ -144,3 +144,3 @@ * The aggregator used to get the answer

coordinates: number[][];
};
}
type TextClassificationArgs = Args & {

@@ -206,3 +206,3 @@ /**

};
type TextGenerationReturn = {
interface TextGenerationReturn {
/**

@@ -212,3 +212,3 @@ * The continuated string

generated_text: string;
};
}
type TokenClassificationArgs = Args & {

@@ -236,3 +236,3 @@ /**

};
type TokenClassificationReturnValue = {
interface TokenClassificationReturnValue {
/**

@@ -258,3 +258,3 @@ * The offset stringwise where the answer is located. Useful to disambiguate if word occurs multiple times.

word: string;
};
}
type TokenClassificationReturn = TokenClassificationReturnValue[];

@@ -267,3 +267,3 @@ type TranslationArgs = Args & {

};
type TranslationReturn = {
interface TranslationReturn {
/**

@@ -273,3 +273,3 @@ * The string after translation

translation_text: string;
};
}
type ZeroShotClassificationArgs = Args & {

@@ -291,7 +291,7 @@ /**

};
type ZeroShotClassificationReturnValue = {
interface ZeroShotClassificationReturnValue {
labels: string[];
scores: number[];
sequence: string;
};
}
type ZeroShotClassificationReturn = ZeroShotClassificationReturnValue[];

@@ -344,3 +344,3 @@ type ConversationalArgs = Args & {

};
type ConversationalReturn = {
interface ConversationalReturn {
conversation: {

@@ -352,3 +352,3 @@ generated_responses: string[];

warnings: string[];
};
}
type FeatureExtractionArgs = Args & {

@@ -375,3 +375,3 @@ /**

};
type ImageClassificationReturnValue = {
interface ImageClassificationReturnValue {
/**

@@ -385,3 +385,3 @@ * A float that represents how likely it is that the image file belongs to this class.

score: number;
};
}
type ImageClassificationReturn = ImageClassificationReturnValue[];

@@ -394,3 +394,3 @@ type ObjectDetectionArgs = Args & {

};
type ObjectDetectionReturnValue = {
interface ObjectDetectionReturnValue {
/**

@@ -413,3 +413,3 @@ * A dict (with keys [xmin,ymin,xmax,ymax]) representing the bounding box of a detected object.

score: number;
};
}
type ObjectDetectionReturn = ObjectDetectionReturnValue[];

@@ -422,3 +422,3 @@ type ImageSegmentationArgs = Args & {

};
type ImageSegmentationReturnValue = {
interface ImageSegmentationReturnValue {
/**

@@ -436,3 +436,3 @@ * The label for the class (model specific) of a segment.

score: number;
};
}
type ImageSegmentationReturn = ImageSegmentationReturnValue[];

@@ -445,3 +445,3 @@ type AutomaticSpeechRecognitionArgs = Args & {

};
type AutomaticSpeechRecognitionReturn = {
interface AutomaticSpeechRecognitionReturn {
/**

@@ -451,3 +451,3 @@ * The text that was recognized from the audio

text: string;
};
}
type AudioClassificationArgs = Args & {

@@ -459,3 +459,3 @@ /**

};
type AudioClassificationReturnValue = {
interface AudioClassificationReturnValue {
/**

@@ -469,3 +469,3 @@ * The label for the class (model specific)

score: number;
};
}
type AudioClassificationReturn = AudioClassificationReturnValue[];

@@ -472,0 +472,0 @@ type TextToImageArgs = Args & {

{
"name": "@huggingface/inference",
"version": "1.5.1",
"version": "1.5.2",
"license": "MIT",

@@ -42,15 +42,7 @@ "author": "Tim Mikeladze <tim.mikeladze@gmail.com>",

"devDependencies": {
"@types/jest": "29.4.0",
"@types/node": "18.13.0",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"eslint": "8.34.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-typescript-sort-keys": "^2.1.0",
"jest": "29.4.3",
"prettier": "2.8.4",
"ts-jest": "29.0.5",
"tsup": "^6.6.3",
"typescript": "4.9.5"
"typescript": "4.9.5",
"vite": "^4.1.4",
"vitest": "^0.29.2"
},

@@ -61,6 +53,6 @@ "resolutions": {},

"format": "prettier --write . && eslint --quiet --fix --ext .cjs,.ts .",
"test": "jest --passWithNoTests",
"test:ci": "npm run test -- --ci --coverage",
"test": "vitest run",
"test:ci": "pnpm run test -- --coverage",
"type-check": "tsc"
}
}

@@ -5,5 +5,6 @@ # 🤗 Hugging Face Inference API

Check out the [full documentation](https://huggingface.co/docs/huggingface.js/inference/README).
Check out the [full documentation](https://huggingface.co/docs/huggingface.js/inference/README) or try out a live [interactive notebook](https://observablehq.com/@huggingface/hello-huggingface-js-inference).
## Install

@@ -21,3 +22,3 @@

❗**Important note:** Using an API key is optional to get started (simply provide a random string), however you will be rate limited eventually. Join [Hugging Face](https://huggingface.co/join) and then visit [access tokens](https://huggingface.co/settings/tokens) to generate your API key.
❗**Important note:** Using an API key is optional to get started, however you will be rate limited eventually. Join [Hugging Face](https://huggingface.co/join) and then visit [access tokens](https://huggingface.co/settings/tokens) to generate your API key. Note that this API key should be kept private and used exclusively for experimental purposes on the web. If you need to protect it, we suggest setting up a proxy server since we currently do not provide an OAuth solution.

@@ -24,0 +25,0 @@ ### Basic examples

@@ -1,2 +0,2 @@

export type Options = {
export interface Options {
/**

@@ -19,7 +19,7 @@ * (Default: true) Boolean. If a request 503s and wait_for_model is set to false, the request will be retried with the same parameters but with wait_for_model set to true.

wait_for_model?: boolean;
};
}
export type Args = {
export interface Args {
model: string;
};
}

@@ -86,3 +86,3 @@ export type FillMaskArgs = Args & {

export type SummarizationReturn = {
export interface SummarizationReturn {
/**

@@ -92,3 +92,3 @@ * The string after translation

summary_text: string;
};
}

@@ -102,3 +102,3 @@ export type QuestionAnswerArgs = Args & {

export type QuestionAnswerReturn = {
export interface QuestionAnswerReturn {
/**

@@ -120,3 +120,3 @@ * A string that’s the answer within the text.

start: number;
};
}

@@ -136,3 +136,3 @@ export type TableQuestionAnswerArgs = Args & {

export type TableQuestionAnswerReturn = {
export interface TableQuestionAnswerReturn {
/**

@@ -154,3 +154,3 @@ * The aggregator used to get the answer

coordinates: number[][];
};
}

@@ -220,3 +220,3 @@ export type TextClassificationArgs = Args & {

export type TextGenerationReturn = {
export interface TextGenerationReturn {
/**

@@ -226,3 +226,3 @@ * The continuated string

generated_text: string;
};
}

@@ -252,3 +252,3 @@ export type TokenClassificationArgs = Args & {

export type TokenClassificationReturnValue = {
export interface TokenClassificationReturnValue {
/**

@@ -274,3 +274,3 @@ * The offset stringwise where the answer is located. Useful to disambiguate if word occurs multiple times.

word: string;
};
}

@@ -286,3 +286,3 @@ export type TokenClassificationReturn = TokenClassificationReturnValue[];

export type TranslationReturn = {
export interface TranslationReturn {
/**

@@ -292,3 +292,3 @@ * The string after translation

translation_text: string;
};
}

@@ -312,7 +312,7 @@ export type ZeroShotClassificationArgs = Args & {

export type ZeroShotClassificationReturnValue = {
export interface ZeroShotClassificationReturnValue {
labels: string[];
scores: number[];
sequence: string;
};
}

@@ -368,3 +368,3 @@ export type ZeroShotClassificationReturn = ZeroShotClassificationReturnValue[];

export type ConversationalReturn = {
export interface ConversationalReturn {
conversation: {

@@ -376,3 +376,3 @@ generated_responses: string[];

warnings: string[];
};
}

@@ -403,3 +403,3 @@ export type FeatureExtractionArgs = Args & {

export type ImageClassificationReturnValue = {
export interface ImageClassificationReturnValue {
/**

@@ -413,3 +413,3 @@ * A float that represents how likely it is that the image file belongs to this class.

score: number;
};
}

@@ -425,3 +425,3 @@ export type ImageClassificationReturn = ImageClassificationReturnValue[];

export type ObjectDetectionReturnValue = {
export interface ObjectDetectionReturnValue {
/**

@@ -445,3 +445,3 @@ * A dict (with keys [xmin,ymin,xmax,ymax]) representing the bounding box of a detected object.

score: number;
};
}

@@ -457,3 +457,3 @@ export type ObjectDetectionReturn = ObjectDetectionReturnValue[];

export type ImageSegmentationReturnValue = {
export interface ImageSegmentationReturnValue {
/**

@@ -471,3 +471,3 @@ * The label for the class (model specific) of a segment.

score: number;
};
}

@@ -483,3 +483,3 @@ export type ImageSegmentationReturn = ImageSegmentationReturnValue[];

export type AutomaticSpeechRecognitionReturn = {
export interface AutomaticSpeechRecognitionReturn {
/**

@@ -489,3 +489,3 @@ * The text that was recognized from the audio

text: string;
};
}

@@ -499,3 +499,3 @@ export type AudioClassificationArgs = Args & {

export type AudioClassificationReturnValue = {
export interface AudioClassificationReturnValue {
/**

@@ -510,3 +510,3 @@ * The label for the class (model specific)

score: number;
};
}

@@ -513,0 +513,0 @@ export type AudioClassificationReturn = AudioClassificationReturnValue[];

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc