Huggingface.js documentation
🤗 Hugging Face Space 헤더
@huggingface/inference
Inference Client 사용API 참조
클래스
HfInferenceInferenceClientInferenceClientEndpointInferenceClientErrorInferenceClientHubApiErrorInferenceClientInputErrorInferenceClientProviderApiErrorInferenceClientProviderOutputErrorInferenceClientRoutingError
인터페이스
AudioToAudioOutputAudioToAudioOutputElemBaseArgsBodyParamsHeaderParamsInferenceProviderMappingEntry로거옵션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 옵션을 사용하여 space-header를 다른 DOM 요소에 삽입합니다
const app = document.getElementById("app");
// ...
init(":user/:spaceId", {
target: app
});이미 스페이스 데이터를 가지고 있다면, fetch를 피하기 위해 이를 매개변수로 전달할 수도 있습니다
init(space);
// space = {
// id: string;
// likes: number;
// author: string;
// }