Huggingface.js documentation

🤗 Hugging Face Space Başlığı

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

🤗 Hugging Face Space Başlığı

Space mini_header özelliği için Typescript destekli bir sarmalayıcı.

space header preview

Yükle

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"

Başlat

import { init } from "@huggingface/space-header";

// ...

init(":user/:spaceId");
// init("enzostvs/lora-studio") for example

❗Önemli not: init metodu istemci tarafında çağrılmalıdır.

Kullanım

Başka bir DOM öğesine target seçeneğini kullanarak space-header'ı enjekte eder

const app = document.getElementById("app");

// ...

init(":user/:spaceId", {
  target: app
});

Eğer alan verilerine zaten sahipseniz, bir getirme işleminden kaçınmak için bunları bir parametre olarak da iletebilirsiniz

init(space);

// space = {
//  id: string;
//  likes: number;
//  author: string;
// }
Update on GitHub