Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "featureExtraction should use FeatureExtractionInput (#1235)" #1238

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/inference/src/tasks/nlp/featureExtraction.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import type { FeatureExtractionInput } from "@huggingface/tasks";
import { InferenceOutputError } from "../../lib/InferenceOutputError";
import type { BaseArgs, Options } from "../../types";
import { request } from "../custom/request";

export type FeatureExtractionArgs = BaseArgs & FeatureExtractionInput;
export type FeatureExtractionArgs = BaseArgs & {
/**
* The inputs is a string or a list of strings to get the features from.
*
* inputs: "That is a happy person",
*
*/
inputs: string | string[];
};

/**
* Returned values are a multidimensional array of floats (dimension depending on if you sent a string or a list of string, and if the automatic reduction, usually mean_pooling for instance was applied for you or not. This should be explained on the model's README).
Expand Down
3 changes: 1 addition & 2 deletions packages/inference/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ChatCompletionInput, FeatureExtractionInput, PipelineType } from "@huggingface/tasks";
import type { ChatCompletionInput, PipelineType } from "@huggingface/tasks";

/**
* HF model id, like "meta-llama/Llama-3.3-70B-Instruct"
Expand Down Expand Up @@ -87,7 +87,6 @@ export type RequestArgs = BaseArgs &
| { text: string }
| { audio_url: string }
| ChatCompletionInput
| FeatureExtractionInput
) & {
parameters?: Record<string, unknown>;
};
Expand Down