Huggingface.js documentation
🤗 Hugging Face Space ヘッダー
@huggingface/inference
Inference Client を使用API リファレンス
クラス
HfInferenceInferenceClientInferenceClientEndpointInferenceClientErrorInferenceClientHubApiErrorInferenceClientInputErrorInferenceClientProviderApiErrorInferenceClientProviderOutputErrorInferenceClientRoutingError
インターフェース
AudioToAudioOutputAudioToAudioOutputElemBaseArgsBodyParamsHeaderParamsInferenceProviderMappingEntryLoggerオプションTextGenerationInputTextGenerationOutputTextGenerationStreamBestOfSequenceTextGenerationStreamDetailsTextGenerationStreamOutputTextGenerationStreamPrefillTokenTextGenerationStreamTokenUrlParams
モジュール
@huggingface/hub
Hub とのインタラクションAPI リファレンス
クラス
インターフェース
AuthInfoCachedFileInfoCachedRepoInfoCachedRevisionInfoCommitCopyFileCommitDataCommitDeletedEntryCommitEditFileCommitEditFileParamsCommitFileCommitInfoCommitOutputCopyDestinationCopyFilesEntryCopyProgressEventCopySource認証情報DatasetEntryFileDownloadInfoOutputHFCacheInfoJobVolumeLfsPathInfoListFileEntryMlxQuantizationConfigModelConfigModelDerivedFieldsModelEntryOAuthResultParallelDownloadOptionsPathInfoQuantizationConfigRangeEditCacheEntryRepoIdSafetensorsIndexJsonSafetensorsShardFileInfoSecurityFileStatusSpaceEntrySpaceResourceConfigSpaceResourceRequirementSpaceRuntimeTensorInfoUserInfoWhoAmIAppWhoAmIOrgWhoAmIUserXetFileInfoXetReadToken
@huggingface/mcp-client
@huggingface/tiny-agents
@huggingface/space-header
@huggingface/gguf
@huggingface/lerobot
@huggingface/usd-web-viewer
🤗 Hugging Face Space ヘッダー
Spaceのmini_header機能のための、TypeScriptで実装されたラッパーです。
![]()
インストール
pnpm add @huggingface/space-header npm add @huggingface/space-header yarn add @huggingface/space-header
Deno
// esm.sh
import { init } from "https://esm.sh/@huggingface/space-header"
// or npm:
import { init } from "npm:@huggingface/space-header"初期化
import { init } from "@huggingface/space-header";
// ...
init(":user/:spaceId");
// init("enzostvs/lora-studio") for example❗重要な注意: init メソッドはクライアント側で呼び出す必要があります。
使用方法
targetオプションを使用して、スペースヘッダーを別のDOM要素に注入します
const app = document.getElementById("app");
// ...
init(":user/:spaceId", {
target: app
});スペースのデータが既に手元にある場合は、フェッチを回避するためにパラメータとして渡すこともできます。
init(space);
// space = {
// id: string;
// likes: number;
// author: string;
// }