Huggingface.js documentation
クラス: InferenceClientEndpoint
クラス: InferenceClientEndpoint
後方互換性のためにのみ存在し、近いうちに削除されます。
Deprecated
InferenceClient に置き換えてください
階層
-
↳
InferenceClientEndpoint
コンストラクタ
constructor
• new InferenceClientEndpoint(accessToken?, defaultOptions?): InferenceClientEndpoint
パラメータ
| 名前 | 型 | デフォルト値 |
|---|---|---|
accessToken | string | "" |
defaultOptions | Options & { endpointUrl?: string } | {} |
返り値
継承元
定義場所
inference/src/InferenceClient.ts:15
メソッド
audioClassification
▸ audioClassification(args, options?): Promise<AudioClassificationOutput>
このタスクは、一部の音声入力を読み取り、クラスの尤度を出力します。 推奨モデル: superb/hubert-large-superb-er
パラメータ
| 名前 | 型 |
|---|---|
args | AudioClassificationArgs |
options? | Options |
返り値
Promise<AudioClassificationOutput>
継承元
InferenceClientのaudioClassification
定義場所
inference/src/tasks/audio/audioClassification.ts:15
audioToAudio
▸ audioToAudio(args, options?): Promise<AudioToAudioOutput[]>
このタスクは、音声入力を読み取り、1つ以上の音声ファイルを出力します。 モデルの例: speechbrain/sepformer-wham は、音源分離を実行します。
パラメータ
| 名前 | 型 |
|---|---|
args | AudioToAudioArgs |
options? | Options |
返り値
Promise<AudioToAudioOutput[]>
継承元
定義場所
inference/src/tasks/audio/audioToAudio.ts:41
automaticSpeechRecognition
▸ automaticSpeechRecognition(args, options?): Promise<AutomaticSpeechRecognitionOutput>
このタスクは、音声入力を読み取り、音声ファイルに含まれる発話された単語を出力します。 推奨モデル(英語): facebook/wav2vec2-large-960h-lv60-self
パラメータ
| 名前 | 型 |
|---|---|
args | AutomaticSpeechRecognitionArgs |
options? | Options |
返り値
Promise<AutomaticSpeechRecognitionOutput>
継承元
InferenceClientのautomaticSpeechRecognition
定義場所
inference/src/tasks/audio/automaticSpeechRecognition.ts:13
chatCompletion
▸ chatCompletion(args, options?): Promise<ChatCompletionOutput>
OpenAIのメッセージ補完API(ストリーミングなし)を使用して、チャット補完エンドポイントでプロンプトに対する応答を生成します。
パラメータ
| 名前 | 型 |
|---|---|
args | BaseArgs & ChatCompletionInput |
options? | Options |
返り値
Promise<ChatCompletionOutput>
継承元
InferenceClientのchatCompletion
定義場所
inference/src/tasks/nlp/chatCompletion.ts:12
chatCompletionStream
▸ chatCompletionStream(args, options?): AsyncGenerator<ChatCompletionStreamOutput>
プロンプトからのテキストを継続するために使用します。textGenerationと同様ですが、1トークンずつ読み取れるジェネレーターを返します。
パラメータ
| 名前 | 型 |
|---|---|
args | BaseArgs & ChatCompletionInput |
options? | Options |
返り値
AsyncGenerator<ChatCompletionStreamOutput>
継承元
InferenceClientのchatCompletionStream
定義場所
inference/src/tasks/nlp/chatCompletionStream.ts:12
documentQuestionAnswering
▸ documentQuestionAnswering(args, options?): Promise<DocumentQuestionAnsweringOutput[number]>
ドキュメント画像に対する質問に回答します。推奨モデル: impira/layoutlm-document-qa。
パラメータ
| 名前 | 型 |
|---|---|
args | DocumentQuestionAnsweringArgs |
options? | Options |
返り値
Promise<DocumentQuestionAnsweringOutput[number]>
継承元
InferenceClient.documentQuestionAnswering
定義場所
inference/src/tasks/multimodal/documentQuestionAnswering.ts:19
エンドポイント
▸ エンドポイント(endpointUrl): InferenceClient
指定されたエンドポイントに紐付けられたInferenceClientの新しいインスタンスを返します。
主に後方互換性のためです。
パラメータ
| 名前 | 型 |
|---|---|
endpointUrl | string |
返り値
継承元
定義場所
inference/src/InferenceClient.ts:46
featureExtraction
▸ featureExtraction(args, options?): Promise<FeatureExtractionOutput>
このタスクはテキストを読み取り、通常はセマンティックデータベース/セマンティック検索の一部として消費される生(raw)の浮動小数点数値を出力します。
パラメータ
| 名前 | 型 |
|---|---|
args | FeatureExtractionArgs |
options? | Options |
返り値
Promise<FeatureExtractionOutput>
継承元
InferenceClientのfeatureExtraction
定義場所
inference/src/tasks/nlp/featureExtraction.ts:22
fillMask
▸ fillMask(args, options?): Promise<FillMaskOutput>
欠落した単語(正確にはトークン)の穴を埋めることを試みます。これはBERTモデルの基本的なタスクです。
パラメータ
| 名前 | 型 |
|---|---|
args | FillMaskArgs |
options? | Options |
返り値
Promise<FillMaskOutput>
継承元
定義場所
inference/src/tasks/nlp/fillMask.ts:12
imageClassification
▸ imageClassification(args, options?): Promise<ImageClassificationOutput>
このタスクは画像を入力として読み取り、クラスの可能性を出力します。 推奨モデル: google/vit-base-patch16-224
パラメータ
| 名前 | 型 |
|---|---|
args | ImageClassificationArgs |
options? | Options |
返り値
Promise<ImageClassificationOutput>
継承元
InferenceClientのimageClassification
定義場所
inference/src/tasks/cv/imageClassification.ts:14
imageSegmentation
▸ imageSegmentation(args, options?): Promise<ImageSegmentationOutput>
このタスクは画像を入力として読み取り、クラスの可能性と検出されたオブジェクトのバウンディングボックスを出力します。 推奨モデル: facebook/detr-resnet-50-panoptic
パラメータ
| 名前 | 型 |
|---|---|
args | ImageSegmentationArgs |
options? | Options |
返り値
Promise<ImageSegmentationOutput>
継承元
InferenceClientのimageSegmentation
定義場所
inference/src/tasks/cv/imageSegmentation.ts:14
imageTextToImage
▸ imageTextToImage(args, options?): Promise<Blob>
このタスクは画像とテキストを入力として受け取り、新しく生成された画像を出力します。 推奨モデル: black-forest-labs/FLUX.2-dev
パラメータ
| 名前 | 型 |
|---|---|
args | ImageTextToImageArgs |
options? | Options |
返り値
Promise<Blob>
継承元
InferenceClientのimageTextToImage
定義場所
inference/src/tasks/cv/imageTextToImage.ts:13
imageTextToVideo
▸ imageTextToVideo(args, options?): Promise<Blob>
このタスクは画像とテキストを入力として受け取り、生成された動画を出力します。 推奨モデル: Lightricks/LTX-Video
パラメータ
| 名前 | 型 |
|---|---|
args | ImageTextToVideoArgs |
options? | Options |
返り値
Promise<Blob>
継承元
InferenceClientのimageTextToVideo
定義場所
inference/src/tasks/cv/imageTextToVideo.ts:13
imageToImage
▸ imageToImage(args, options?): Promise<Blob>
このタスクはテキスト入力を読み取り、画像を出力します。 推奨モデル: lllyasviel/sd-controlnet-depth
パラメータ
| 名前 | 型 |
|---|---|
args | ImageToImageArgs |
options? | Options |
返り値
Promise<Blob>
継承元
定義場所
inference/src/tasks/cv/imageToImage.ts:14
imageToText
▸ imageToText(args, options?): Promise<ImageToTextOutput>
このタスクは画像を入力として読み取り、テキストのキャプションを出力します。
パラメータ
| 名前 | 型 |
|---|---|
args | ImageToTextArgs |
options? | Options |
返り値
Promise<ImageToTextOutput>
継承元
定義場所
inference/src/tasks/cv/imageToText.ts:12
imageToVideo
▸ imageToVideo(args, options?): Promise<Blob>
このタスクはテキスト入力を読み取り、画像を出力します。 推奨モデル: Wan-AI/Wan2.1-I2V-14B-720P
パラメータ
| 名前 | 型 |
|---|---|
args | ImageToVideoArgs |
options? | Options |
返り値
Promise<Blob>
継承元
定義場所
inference/src/tasks/cv/imageToVideo.ts:14
objectDetection
▸ objectDetection(args, options?): Promise<ObjectDetectionOutput>
このタスクは画像を入力として読み取り、クラスの可能性と検出されたオブジェクトのバウンディングボックスを出力します。 推奨モデル: facebook/detr-resnet-50
パラメータ
| 名前 | 型 |
|---|---|
args | ObjectDetectionArgs |
options? | Options |
返り値
Promise<ObjectDetectionOutput>
継承元
InferenceClientのobjectDetection
定義場所
inference/src/tasks/cv/objectDetection.ts:14
questionAnswering
▸ questionAnswering(args, options?): Promise<QuestionAnsweringOutput[number]>
どんな質問にも答えられる万能ボットを作りたいですか?推奨モデル: deepset/roberta-base-squad2
パラメータ
| 名前 | 型 |
|---|---|
args | QuestionAnsweringArgs |
options? | Options |
返り値
Promise<QuestionAnsweringOutput[number]>
継承元
InferenceClient.questionAnswering
定義場所
inference/src/tasks/nlp/questionAnswering.ts:13
リクエスト
▸ request<T>(args, options?): Promise<T>
推論プロバイダーへのカスタム呼び出しを行うためのプリミティブ
型パラメータ
| 名前 |
|---|
T |
パラメータ
| 名前 | 型 |
|---|---|
args | RequestArgs |
options? | Options & { task?: InferenceTask } |
返り値
Promise<T>
Deprecated
代わりに特定のタスク関数を使用してください。この関数は将来のバージョンで削除されます。
継承元
定義場所
inference/src/tasks/custom/request.ts:11
sentenceSimilarity
▸ sentenceSimilarity(args, options?): Promise<SentenceSimilarityOutput>
埋め込みを比較することで、1つのテキストと他の文のリストとの間の意味的類似度を計算します。
パラメータ
| 名前 | 型 |
|---|---|
args | SentenceSimilarityArgs |
options? | Options |
返り値
Promise<SentenceSimilarityOutput>
継承元
InferenceClient.sentenceSimilarity
定義場所
inference/src/tasks/nlp/sentenceSimilarity.ts:12
streamingRequest
▸ streamingRequest<T>(args, options?): AsyncGenerator<T>
サーバー送信イベントを期待するカスタム推論呼び出しを作成するためのプリミティブで、ジェネレーターを通じてレスポンスを返します
型パラメータ
| 名前 |
|---|
T |
パラメータ
| 名前 | 型 |
|---|---|
args | RequestArgs |
options? | Options & { task?: InferenceTask } |
返り値
AsyncGenerator<T>
Deprecated
代わりに特定のタスク関数を使用してください。この関数は将来のバージョンで削除されます。
継承元
InferenceClientのstreamingRequest
定義場所
inference/src/tasks/custom/streamingRequest.ts:11
要約
▸ summarization(args, options?): Promise<SummarizationOutput>
このタスクは、長いテキストを短いテキストに要約するもので、よく知られています。注意してください。一部のモデルには入力長の上限があります。つまり、例えば小説全体を要約することはできないということです。モデルを選択する際はご注意ください。
パラメータ
| 名前 | 型 |
|---|---|
args | SummarizationArgs |
options? | Options |
返り値
Promise<SummarizationOutput>
継承元
定義場所
inference/src/tasks/nlp/summarization.ts:12
tableQuestionAnswering
▸ tableQuestionAnswering(args, options?): Promise<TableQuestionAnsweringOutput[number]>
SQLに詳しくなくても大丈夫です。大規模なスプレッドシートに手を出す必要はありません。自然な英語で質問してください。推奨モデル: google/tapas-base-finetuned-wtq。
パラメータ
| 名前 | 型 |
|---|---|
args | TableQuestionAnsweringArgs |
options? | Options |
返り値
Promise<TableQuestionAnsweringOutput[number]>
継承元
InferenceClient.tableQuestionAnswering
定義場所
inference/src/tasks/nlp/tableQuestionAnswering.ts:12
tabularClassification
▸ tabularClassification(args, options?): Promise<TabularClassificationOutput>
表形式の機能セットに対して、ターゲットラベルを予測します。 通常、トレーニングデータで分類モデルを学習し、同じ形式の新しいデータで使用します。 モデルの例: vvmnnnkv/wine-quality
パラメータ
| 名前 | 型 |
|---|---|
args | TabularClassificationArgs |
options? | Options |
返り値
Promise<TabularClassificationOutput>
継承元
InferenceClient.tabularClassification
定義場所
inference/src/tasks/tabular/tabularClassification.ts:25
tabularRegression
▸ tabularRegression(args, options?): Promise<TabularRegressionOutput>
表形式の機能セットに対して、ターゲット値を予測します。 通常、トレーニングデータで回帰モデルを訓練し、同じ形式の新しいデータで使用することになります。 モデルの例: scikit-learn/Fish-Weight
パラメータ
| 名前 | 型 |
|---|---|
args | TabularRegressionArgs |
options? | Options |
返り値
Promise<TabularRegressionOutput>
継承元
InferenceClient.tabularRegression
定義場所
inference/src/tasks/tabular/tabularRegression.ts:25
textClassification
▸ textClassification(args, options?): Promise<TextClassificationOutput>
通常、感情分析に使用され、入力に対する各クラスの確率を出力します。推奨モデル: distilbert-base-uncased-finetuned-sst-2-english
パラメータ
| 名前 | 型 |
|---|---|
args | TextClassificationArgs |
options? | Options |
返り値
Promise<TextClassificationOutput>
継承元
InferenceClientのtextClassification
定義場所
inference/src/tasks/nlp/textClassification.ts:12
textGeneration
▸ textGeneration(args, options?): Promise<TextGenerationOutput>
プロンプトからのテキストを継続するために使用します。これは非常に汎用的なタスクです。推奨モデル: gpt2(シンプルなモデルですが、触って遊ぶには楽しいです)。
パラメータ
| 名前 | 型 |
|---|---|
args | BaseArgs & TextGenerationInput |
options? | Options |
返り値
Promise<TextGenerationOutput>
継承元
InferenceClientのtextGeneration
定義場所
inference/src/tasks/nlp/textGeneration.ts:12
textGenerationStream
▸ textGenerationStream(args, options?): AsyncGenerator<TextGenerationStreamOutput>
プロンプトからのテキストを継続するために使用します。textGenerationと同様ですが、1トークンずつ読み取れるジェネレーターを返します。
パラメータ
| 名前 | 型 |
|---|---|
args | BaseArgs & TextGenerationInput |
options? | Options |
返り値
AsyncGenerator<TextGenerationStreamOutput>
継承元
InferenceClientのtextGenerationStream
定義場所
inference/src/tasks/nlp/textGenerationStream.ts:90
textRanking
▸ textRanking(args, options?): Promise<TextRankingOutput>
リランカーモデルを使用して、クエリに対する関連性に基づいてドキュメントをランキングします。
パラメータ
| 名前 | 型 |
|---|---|
args | TextRankingArgs |
options? | Options |
返り値
Promise<TextRankingOutput>
継承元
定義場所
inference/src/tasks/nlp/textRanking.ts:12
textToAudio
▸ textToAudio(args, options?): Promise<Blob>
このタスクは、入力されたテキストプロンプトから音声(音楽や効果音など)を生成します。 モデルの例: stabilityai/stable-audio-open-1.0
パラメータ
| 名前 | 型 |
|---|---|
args | TextToAudioArgs |
options? | Options |
返り値
Promise<Blob>
継承元
定義場所
inference/src/tasks/audio/textToAudio.ts:18
textToImage
▸ textToImage(args, options?): Promise<string>
このタスクはテキストを入力として読み取り、画像を出力します。 推奨モデル: stabilityai/stable-diffusion-2
パラメータ
| 名前 | 型 |
|---|---|
args | TextToImageArgs |
options? | TextToImageOptions & { outputType: "url" } |
返り値
Promise<string>
継承元
定義場所
inference/src/tasks/cv/textToImage.ts:18
▸ textToImage(args, options?): Promise<string>
パラメータ
| 名前 | 型 |
|---|---|
args | TextToImageArgs |
options? | TextToImageOptions & { outputType: "dataUrl" } |
返り値
Promise<string>
継承元
定義場所
inference/src/tasks/cv/textToImage.ts:22
▸ textToImage(args, options?): Promise<Blob>
パラメータ
| 名前 | 型 |
|---|---|
args | TextToImageArgs |
options? | TextToImageOptions & { outputType?: "blob" } |
返り値
Promise<Blob>
継承元
定義場所
inference/src/tasks/cv/textToImage.ts:26
▸ textToImage(args, options?): Promise<Record<string, unknown>>
パラメータ
| 名前 | 型 |
|---|---|
args | TextToImageArgs |
options? | TextToImageOptions & { outputType?: "json" } |
返り値
Promise<Record<string, unknown>>
継承元
定義場所
inference/src/tasks/cv/textToImage.ts:30
textToSpeech
▸ textToSpeech(args, options?): Promise<Blob>
このタスクは、指定されたテキストを発音する音声の音声を合成します。 推奨モデル: espnet/kan-bayashi_ljspeech_vits
パラメータ
| 名前 | 型 |
|---|---|
args | TextToSpeechArgs |
options? | Options |
返り値
Promise<Blob>
継承元
定義場所
inference/src/tasks/audio/textToSpeech.ts:15
textToVideo
▸ textToVideo(args, options?): Promise<TextToVideoOutput>
パラメータ
| 名前 | 型 |
|---|---|
args | TextToVideoArgs |
options? | Options |
返り値
Promise<TextToVideoOutput>
継承元
定義場所
inference/src/tasks/cv/textToVideo.ts:15
tokenClassification
▸ tokenClassification(args, options?): Promise<TokenClassificationOutput>
文の解析、すなわち文法解析またはテキストに含まれるキーワードを理解するための固有表現認識(NER)に通常使用されます。推奨モデル: dbmdz/bert-large-cased-finetuned-conll03-english
パラメータ
| 名前 | 型 |
|---|---|
args | TokenClassificationArgs |
options? | Options |
返り値
Promise<TokenClassificationOutput>
継承元
InferenceClient.tokenClassification
定義場所
inference/src/tasks/nlp/tokenClassification.ts:12
翻訳
▸ 翻訳(args, options?): Promise<TranslationOutput>
このタスクは、ある言語のテキストを別の言語に翻訳するもので、広く知られています。推奨モデル: Helsinki-NLP/opus-mt-ru-en。
パラメータ
| 名前 | 型 |
|---|---|
args | TranslationArgs |
options? | Options |
返り値
Promise<TranslationOutput>
継承元
定義場所
inference/src/tasks/nlp/translation.ts:11
visualQuestionAnswering
▸ visualQuestionAnswering(args, options?): Promise<VisualQuestionAnsweringOutput[number]>
画像に関する質問に回答します。推奨モデル: dandelin/vilt-b32-finetuned-vqa。
パラメータ
| 名前 | 型 |
|---|---|
args | VisualQuestionAnsweringArgs |
options? | Options |
返り値
Promise<VisualQuestionAnsweringOutput[number]>
継承元
InferenceClientのvisualQuestionAnswering
定義場所
inference/src/tasks/multimodal/visualQuestionAnswering.ts:19
zeroShotClassification
▸ zeroShotClassification(args, options?): Promise<ZeroShotClassificationOutput>
このタスクは、コードを書かずに分類を試すのに非常に便利です。文や段落、およびその文に対する候補ラベルを渡すだけで、結果が得られます。推奨モデル: facebook/bart-large-mnli。
パラメータ
| 名前 | 型 |
|---|---|
args | ZeroShotClassificationArgs |
options? | Options |
返り値
Promise<ZeroShotClassificationOutput>
継承元
InferenceClient.zeroShotClassification
定義場所
inference/src/tasks/nlp/zeroShotClassification.ts:12
zeroShotImageClassification
▸ zeroShotImageClassification(args, options?): Promise<ZeroShotImageClassificationOutput>
指定されたクラスに画像を分類します。 推奨モデル: openai/clip-vit-large-patch14-336
パラメータ
| 名前 | 型 |
|---|---|
args | ZeroShotImageClassificationArgs |
options? | Options |
返り値
Promise<ZeroShotImageClassificationOutput>
継承元
InferenceClient.zeroShotImageClassification
定義場所
inference/src/tasks/cv/zeroShotImageClassification.ts:44
Update on GitHub