text stringlengths 5 631k | id stringlengths 14 178 | metadata dict | __index_level_0__ int64 0 647 |
|---|---|---|---|
use yew_agent::PublicWorker;
fn main() {
console_error_panic_hook::set_once();
candle_wasm_example_llama2::Worker::register();
}
| candle/candle-wasm-examples/llama2-c/src/bin/worker.rs/0 | {
"file_path": "candle/candle-wasm-examples/llama2-c/src/bin/worker.rs",
"repo_id": "candle",
"token_count": 54
} | 66 |
import init, { Model } from "./build/m.js";
async function fetchArrayBuffer(url) {
const cacheName = "phi-mixformer-candle-cache";
const cache = await caches.open(cacheName);
const cachedResponse = await cache.match(url);
if (cachedResponse) {
const data = await cachedResponse.arrayBuffer();
return new... | candle/candle-wasm-examples/phi/phiWorker.js/0 | {
"file_path": "candle/candle-wasm-examples/phi/phiWorker.js",
"repo_id": "candle",
"token_count": 1667
} | 67 |
use candle::{Device, Tensor};
use candle_transformers::generation::LogitsProcessor;
pub use candle_transformers::models::quantized_t5::{
Config, T5EncoderModel, T5ForConditionalGeneration, VarBuilder,
};
use candle_wasm_example_t5::console_log;
use tokenizers::Tokenizer;
use wasm_bindgen::prelude::*;
const DEVICE:... | candle/candle-wasm-examples/t5/src/bin/m-quantized.rs/0 | {
"file_path": "candle/candle-wasm-examples/t5/src/bin/m-quantized.rs",
"repo_id": "candle",
"token_count": 3555
} | 68 |
pub const WITH_TIMER: bool = true;
mod app;
mod audio;
pub mod languages;
pub mod worker;
pub use app::App;
pub use worker::Worker;
| candle/candle-wasm-examples/whisper/src/lib.rs/0 | {
"file_path": "candle/candle-wasm-examples/whisper/src/lib.rs",
"repo_id": "candle",
"token_count": 47
} | 69 |
//load the candle yolo wasm module
import init, { Model, ModelPose } from "./build/m.js";
async function fetchArrayBuffer(url) {
const cacheName = "yolo-candle-cache";
const cache = await caches.open(cacheName);
const cachedResponse = await cache.match(url);
if (cachedResponse) {
const data = await cachedR... | candle/candle-wasm-examples/yolo/yoloWorker.js/0 | {
"file_path": "candle/candle-wasm-examples/yolo/yoloWorker.js",
"repo_id": "candle",
"token_count": 756
} | 70 |
## Privacy
> Last updated: Feb 14, 2025
Users of HuggingChat are authenticated through their HF user account.
We endorse Privacy by Design. As such, your conversations are private to you and will not be shared with anyone, including model authors, for any purpose, including for research or model training purposes.
... | chat-ui/PRIVACY.md/0 | {
"file_path": "chat-ui/PRIVACY.md",
"repo_id": "chat-ui",
"token_count": 700
} | 71 |
image:
repository: ghcr.io/huggingface
name: chat-ui
tag: 0.0.0-latest
pullPolicy: IfNotPresent
replicas: 3
domain: huggingface.co
networkPolicy:
enabled: false
allowedBlocks: []
service:
type: NodePort
annotations: { }
serviceAccount:
enabled: false
create: false
name: ""
automountServiceA... | chat-ui/chart/values.yaml/0 | {
"file_path": "chat-ui/chart/values.yaml",
"repo_id": "chat-ui",
"token_count": 432
} | 72 |
# Text Generation Inference (TGI)
| Feature | Available |
| --------------------------- | --------- |
| [Tools](../tools) | Yes\* |
| [Multimodal](../multimodal) | Yes\* |
\* Tools are only supported with the Cohere Command R+ model with the Xenova tokenizers. Please see the [Too... | chat-ui/docs/source/configuration/models/providers/tgi.md/0 | {
"file_path": "chat-ui/docs/source/configuration/models/providers/tgi.md",
"repo_id": "chat-ui",
"token_count": 1056
} | 73 |
{
"name": "chat-ui",
"version": "0.10.0",
"private": true,
"packageManager": "npm@9.5.0",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./t... | chat-ui/package.json/0 | {
"file_path": "chat-ui/package.json",
"repo_id": "chat-ui",
"token_count": 2488
} | 74 |
import type { EndpointParameters } from "./server/endpoints/endpoints";
import type { BackendModel } from "./server/models";
import type { Tool, ToolResult } from "./types/Tool";
type buildPromptOptions = Pick<EndpointParameters, "messages" | "preprompt" | "continueMessage"> & {
model: BackendModel;
tools?: Tool[];
... | chat-ui/src/lib/buildPrompt.ts/0 | {
"file_path": "chat-ui/src/lib/buildPrompt.ts",
"repo_id": "chat-ui",
"token_count": 545
} | 75 |
<script lang="ts" module>
export const titles: { [key: string]: string } = {
today: "Today",
week: "This week",
month: "This month",
older: "Older",
} as const;
</script>
<script lang="ts">
import { base } from "$app/paths";
import Logo from "$lib/components/icons/Logo.svelte";
import { switchTheme } fro... | chat-ui/src/lib/components/NavMenu.svelte/0 | {
"file_path": "chat-ui/src/lib/components/NavMenu.svelte",
"repo_id": "chat-ui",
"token_count": 4550
} | 76 |
<script lang="ts">
import { base } from "$app/paths";
import { page } from "$app/state";
import { clickOutside } from "$lib/actions/clickOutside";
import { useSettingsStore } from "$lib/stores/settings";
import type { ToolFront } from "$lib/types/Tool";
import IconTool from "./icons/IconTool.svelte";
import Carb... | chat-ui/src/lib/components/ToolsMenu.svelte/0 | {
"file_path": "chat-ui/src/lib/components/ToolsMenu.svelte",
"repo_id": "chat-ui",
"token_count": 2098
} | 77 |
<script lang="ts">
import { MessageToolUpdateType, type MessageToolUpdate } from "$lib/types/MessageUpdate";
import {
isMessageToolCallUpdate,
isMessageToolErrorUpdate,
isMessageToolResultUpdate,
} from "$lib/utils/messageUpdates";
import CarbonTools from "~icons/carbon/tools";
import { ToolResultStatus, ty... | chat-ui/src/lib/components/chat/ToolUpdate.svelte/0 | {
"file_path": "chat-ui/src/lib/components/chat/ToolUpdate.svelte",
"repo_id": "chat-ui",
"token_count": 2368
} | 78 |
export const CONV_NUM_PER_PAGE = 30;
| chat-ui/src/lib/constants/pagination.ts/0 | {
"file_path": "chat-ui/src/lib/constants/pagination.ts",
"repo_id": "chat-ui",
"token_count": 15
} | 79 |
import type { Migration } from ".";
import { collections } from "$lib/server/database";
import { Collection, FindCursor, ObjectId } from "mongodb";
import { logger } from "$lib/server/logger";
import type { Conversation } from "$lib/types/Conversation";
const BATCH_SIZE = 1000;
const DELETE_THRESHOLD_MS = 60 * 60 * 10... | chat-ui/src/lib/migrations/routines/09-delete-empty-conversations.ts/0 | {
"file_path": "chat-ui/src/lib/migrations/routines/09-delete-empty-conversations.ts",
"repo_id": "chat-ui",
"token_count": 950
} | 80 |
import { z } from "zod";
import {
embeddingEndpointTei,
embeddingEndpointTeiParametersSchema,
} from "./tei/embeddingEndpoints";
import {
embeddingEndpointTransformersJS,
embeddingEndpointTransformersJSParametersSchema,
} from "./transformersjs/embeddingEndpoints";
import {
embeddingEndpointOpenAI,
embeddingEndpo... | chat-ui/src/lib/server/embeddingEndpoints/embeddingEndpoints.ts/0 | {
"file_path": "chat-ui/src/lib/server/embeddingEndpoints/embeddingEndpoints.ts",
"repo_id": "chat-ui",
"token_count": 544
} | 81 |
import {
VertexAI,
HarmCategory,
HarmBlockThreshold,
type Content,
type TextPart,
} from "@google-cloud/vertexai";
import type { Endpoint, TextGenerationStreamOutputWithToolsAndWebSources } from "../endpoints";
import { z } from "zod";
import type { Message } from "$lib/types/Message";
import { createImageProcesso... | chat-ui/src/lib/server/endpoints/google/endpointVertex.ts/0 | {
"file_path": "chat-ui/src/lib/server/endpoints/google/endpointVertex.ts",
"repo_id": "chat-ui",
"token_count": 2595
} | 82 |
import { dot } from "@huggingface/transformers";
import type { EmbeddingBackendModel } from "$lib/server/embeddingModels";
import type { Embedding } from "$lib/server/embeddingEndpoints/embeddingEndpoints";
// see here: https://github.com/nmslib/hnswlib/blob/359b2ba87358224963986f709e593d799064ace6/README.md?plain=1#L... | chat-ui/src/lib/server/sentenceSimilarity.ts/0 | {
"file_path": "chat-ui/src/lib/server/sentenceSimilarity.ts",
"repo_id": "chat-ui",
"token_count": 433
} | 83 |
import { z } from "zod";
import { config } from "$lib/server/config";
import JSON5 from "json5";
// RATE_LIMIT is the legacy way to define messages per minute limit
export const usageLimitsSchema = z
.object({
conversations: z.coerce.number().optional(), // how many conversations
messages: z.coerce.number().optio... | chat-ui/src/lib/server/usageLimits.ts/0 | {
"file_path": "chat-ui/src/lib/server/usageLimits.ts",
"repo_id": "chat-ui",
"token_count": 308
} | 84 |
import type { WebSearchSource } from "$lib/types/WebSearch";
import { config } from "$lib/server/config";
export default async function search(query: string): Promise<WebSearchSource[]> {
// const params = {
// q: query,
// // You can add other parameters if needed, like 'count', 'offset', etc.
// };
con... | chat-ui/src/lib/server/websearch/search/endpoints/bing.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/search/endpoints/bing.ts",
"repo_id": "chat-ui",
"token_count": 407
} | 85 |
import { browser } from "$app/environment";
import { invalidate } from "$app/navigation";
import { base } from "$app/paths";
import { UrlDependency } from "$lib/types/UrlDependency";
import type { ObjectId } from "mongodb";
import { getContext, setContext } from "svelte";
import { type Writable, writable, get } from "s... | chat-ui/src/lib/stores/settings.ts/0 | {
"file_path": "chat-ui/src/lib/stores/settings.ts",
"repo_id": "chat-ui",
"token_count": 989
} | 86 |
import type { ObjectId } from "mongodb";
import type { User } from "./User";
import type { Assistant } from "./Assistant";
import type { Timestamps } from "./Timestamps";
export interface Report extends Timestamps {
_id: ObjectId;
createdBy: User["_id"] | string;
object: "assistant" | "tool";
contentId: Assistant[... | chat-ui/src/lib/types/Report.ts/0 | {
"file_path": "chat-ui/src/lib/types/Report.ts",
"repo_id": "chat-ui",
"token_count": 112
} | 87 |
/**
* A debounce function that works in both browser and Nodejs.
* For pure Nodejs work, prefer the `Debouncer` class.
*/
export function debounce<T extends unknown[]>(
callback: (...rest: T) => unknown,
limit: number
): (...rest: T) => void {
let timer: ReturnType<typeof setTimeout>;
return function (...rest) ... | chat-ui/src/lib/utils/debounce.ts/0 | {
"file_path": "chat-ui/src/lib/utils/debounce.ts",
"repo_id": "chat-ui",
"token_count": 138
} | 88 |
export function parseStringToList(links: unknown): string[] {
if (typeof links !== "string") {
throw new Error("Expected a string");
}
return links
.split(",")
.map((link) => link.trim())
.filter((link) => link.length > 0);
}
| chat-ui/src/lib/utils/parseStringToList.ts/0 | {
"file_path": "chat-ui/src/lib/utils/parseStringToList.ts",
"repo_id": "chat-ui",
"token_count": 86
} | 89 |
import { v4 } from "uuid";
import type { Tree, TreeId, NewNode, TreeNode } from "./tree";
export function addSibling<T>(conv: Tree<T>, message: NewNode<T>, siblingId: TreeId): TreeId {
if (conv.messages.length === 0) {
throw new Error("Cannot add a sibling to an empty conversation");
}
if (!conv.rootMessageId) {
... | chat-ui/src/lib/utils/tree/addSibling.ts/0 | {
"file_path": "chat-ui/src/lib/utils/tree/addSibling.ts",
"repo_id": "chat-ui",
"token_count": 409
} | 90 |
import { json } from "@sveltejs/kit";
import { logger } from "$lib/server/logger";
import { computeAllStats } from "$lib/jobs/refresh-conversation-stats";
// Triger like this:
// curl -X POST "http://localhost:5173/chat/admin/stats/compute" -H "Authorization: Bearer <ADMIN_API_SECRET>"
export async function POST() {
... | chat-ui/src/routes/admin/stats/compute/+server.ts/0 | {
"file_path": "chat-ui/src/routes/admin/stats/compute/+server.ts",
"repo_id": "chat-ui",
"token_count": 161
} | 91 |
import { config } from "$lib/server/config";
import { collections } from "$lib/server/database.js";
import { toolFromConfigs } from "$lib/server/tools/index.js";
import type { BaseTool, CommunityToolDB } from "$lib/types/Tool.js";
import { generateQueryTokens, generateSearchTokens } from "$lib/utils/searchTokens.js";
i... | chat-ui/src/routes/api/tools/search/+server.ts/0 | {
"file_path": "chat-ui/src/routes/api/tools/search/+server.ts",
"repo_id": "chat-ui",
"token_count": 682
} | 92 |
import { authCondition } from "$lib/server/auth";
import { collections } from "$lib/server/database";
import { MetricsServer } from "$lib/server/metrics.js";
import { error } from "@sveltejs/kit";
import { ObjectId } from "mongodb";
import { z } from "zod";
export async function POST({ params, request, locals }) {
co... | chat-ui/src/routes/conversation/[id]/message/[messageId]/vote/+server.ts/0 | {
"file_path": "chat-ui/src/routes/conversation/[id]/message/[messageId]/vote/+server.ts",
"repo_id": "chat-ui",
"token_count": 524
} | 93 |
import { redirect, type LoadEvent } from "@sveltejs/kit";
export const load = async ({ params, url }: LoadEvent) => {
const leafId = url.searchParams.get("leafId");
redirect(302, "../conversation/" + params.id + `?leafId=${leafId}`);
};
| chat-ui/src/routes/r/[id]/+page.ts/0 | {
"file_path": "chat-ui/src/routes/r/[id]/+page.ts",
"repo_id": "chat-ui",
"token_count": 84
} | 94 |
import { base } from "$app/paths";
import { redirect } from "@sveltejs/kit";
export async function load({ parent }) {
const { enableCommunityTools } = await parent();
if (enableCommunityTools) {
return {};
}
redirect(302, `${base}/`);
}
| chat-ui/src/routes/tools/+layout.ts/0 | {
"file_path": "chat-ui/src/routes/tools/+layout.ts",
"repo_id": "chat-ui",
"token_count": 82
} | 95 |
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"values": "<DVC_METRIC_DATA>"
},
"title": "<DVC_METRIC_TITLE>",
"mark": "point",
"encoding": {
"x": {
"field": "<DVC_METRIC_X>",
"type": "quantitative",
"title": "<DVC_ME... | datasets/.dvc/plots/scatter.json/0 | {
"file_path": "datasets/.dvc/plots/scatter.json",
"repo_id": "datasets",
"token_count": 402
} | 96 |
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
title: "huggingface/datasets"
authors:
- family-names: Lhoest
given-names: Quentin
- family-names: Villanova del Moral
given-names: Albert
orcid: "https://orcid.org/0000-0003-1727-1045"
- family-names: von Platen
given-names: Patri... | datasets/CITATION.cff/0 | {
"file_path": "datasets/CITATION.cff",
"repo_id": "datasets",
"token_count": 1428
} | 97 |
# Load audio data
You can load an audio dataset using the [`Audio`] feature that automatically decodes and resamples the audio files when you access the examples.
Audio decoding is based on the [`soundfile`](https://github.com/bastibe/python-soundfile) python package, which uses the [`libsndfile`](https://github.com/l... | datasets/docs/source/audio_load.mdx/0 | {
"file_path": "datasets/docs/source/audio_load.mdx",
"repo_id": "datasets",
"token_count": 1760
} | 98 |
# Structure your repository
To host and share your dataset, create a dataset repository on the Hugging Face Hub and upload your data files.
This guide will show you how to structure your dataset repository when you upload it.
A dataset with a supported structure and file format (`.txt`, `.csv`, `.parquet`, `.jsonl`, ... | datasets/docs/source/repository_structure.mdx/0 | {
"file_path": "datasets/docs/source/repository_structure.mdx",
"repo_id": "datasets",
"token_count": 2555
} | 99 |
# Using Datasets with TensorFlow
This document is a quick introduction to using `datasets` with TensorFlow, with a particular focus on how to get
`tf.Tensor` objects out of our datasets, and how to stream data from Hugging Face `Dataset` objects to Keras methods
like `model.fit()`.
## Dataset format
By default, data... | datasets/docs/source/use_with_tensorflow.mdx/0 | {
"file_path": "datasets/docs/source/use_with_tensorflow.mdx",
"repo_id": "datasets",
"token_count": 3825
} | 100 |
import logging
import os
from argparse import ArgumentParser
from collections.abc import Generator
from shutil import rmtree
import datasets.config
from datasets.builder import DatasetBuilder
from datasets.commands import BaseDatasetsCLICommand
from datasets.download.download_manager import DownloadMode
from datasets.... | datasets/src/datasets/commands/test.py/0 | {
"file_path": "datasets/src/datasets/commands/test.py",
"repo_id": "datasets",
"token_count": 3682
} | 101 |
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, ClassVar, Optional, Union
import pyarrow as pa
if TYPE_CHECKING:
from .features import FeatureType
@dataclass
class Translation:
"""`Feature` for translations with fixed languages per example.
Here for compatibility with tf... | datasets/src/datasets/features/translation.py/0 | {
"file_path": "datasets/src/datasets/features/translation.py",
"repo_id": "datasets",
"token_count": 1684
} | 102 |
from abc import ABC, abstractmethod
from typing import Optional, Union
from .. import Dataset, DatasetDict, Features, IterableDataset, IterableDatasetDict, NamedSplit
from ..utils.typing import NestedDataStructureLike, PathLike
class AbstractDatasetReader(ABC):
def __init__(
self,
path_or_paths: ... | datasets/src/datasets/io/abc.py/0 | {
"file_path": "datasets/src/datasets/io/abc.py",
"repo_id": "datasets",
"token_count": 721
} | 103 |
import datasets
from ..folder_based_builder import folder_based_builder
logger = datasets.utils.logging.get_logger(__name__)
class AudioFolderConfig(folder_based_builder.FolderBasedBuilderConfig):
"""Builder Config for AudioFolder."""
drop_labels: bool = None
drop_metadata: bool = None
def __post... | datasets/src/datasets/packaged_modules/audiofolder/audiofolder.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/audiofolder/audiofolder.py",
"repo_id": "datasets",
"token_count": 726
} | 104 |
import itertools
import warnings
from dataclasses import dataclass
from typing import Optional
import pandas as pd
import pyarrow as pa
import datasets
from datasets.table import table_cast
@dataclass
class PandasConfig(datasets.BuilderConfig):
"""BuilderConfig for Pandas."""
features: Optional[datasets.Fe... | datasets/src/datasets/packaged_modules/pandas/pandas.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/pandas/pandas.py",
"repo_id": "datasets",
"token_count": 1040
} | 105 |
"""
Utilities for working with the local dataset cache.
This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
Copyright by the AllenNLP authors.
"""
import asyncio
import glob
import io
import json
import multiprocessing
import os
import posixpath
import re
import shutil
import tarfile
... | datasets/src/datasets/utils/file_utils.py/0 | {
"file_path": "datasets/src/datasets/utils/file_utils.py",
"repo_id": "datasets",
"token_count": 22255
} | 106 |
# Copyright 2022 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | datasets/src/datasets/utils/tf_utils.py/0 | {
"file_path": "datasets/src/datasets/utils/tf_utils.py",
"repo_id": "datasets",
"token_count": 10951
} | 107 |
import posixpath
from pathlib import Path
from unittest.mock import patch
import pytest
from fsspec.implementations.local import AbstractFileSystem, LocalFileSystem, stringify_path
from fsspec.registry import _registry as _fsspec_registry
class MockFileSystem(AbstractFileSystem):
protocol = "mock"
def __ini... | datasets/tests/fixtures/fsspec.py/0 | {
"file_path": "datasets/tests/fixtures/fsspec.py",
"repo_id": "datasets",
"token_count": 1757
} | 108 |
import importlib
import shutil
import textwrap
import pytest
from datasets import ClassLabel, DownloadManager
from datasets.builder import InvalidConfigName
from datasets.data_files import DataFilesDict, DataFilesList, get_data_patterns
from datasets.download.streaming_download_manager import StreamingDownloadManager... | datasets/tests/packaged_modules/test_folder_based_builder.py/0 | {
"file_path": "datasets/tests/packaged_modules/test_folder_based_builder.py",
"repo_id": "datasets",
"token_count": 7784
} | 109 |
from unittest import TestCase
from datasets import List, Value
from datasets.arrow_dataset import Dataset
class DatasetListTest(TestCase):
def _create_example_records(self):
return [
{"col_1": 3, "col_2": "a"},
{"col_1": 2, "col_2": "b"},
{"col_1": 1, "col_2": "c"},
... | datasets/tests/test_dataset_list.py/0 | {
"file_path": "datasets/tests/test_dataset_list.py",
"repo_id": "datasets",
"token_count": 875
} | 110 |
import importlib
import os
import pickle
import shutil
import tempfile
from multiprocessing import Pool
from pathlib import Path
from unittest import TestCase
from unittest.mock import patch
import dill
import pyarrow as pa
import pytest
import requests
import datasets
from datasets import config, load_dataset
from d... | datasets/tests/test_load.py/0 | {
"file_path": "datasets/tests/test_load.py",
"repo_id": "datasets",
"token_count": 25595
} | 111 |
import gc
import inspect
import logging
import os
import queue
import threading
from contextlib import nullcontext
from dataclasses import dataclass
from typing import Any, Callable, Dict, Optional, Union
import pandas as pd
import torch
import torch.utils.benchmark as benchmark
from diffusers.models.modeling_utils i... | diffusers/benchmarks/benchmarking_utils.py/0 | {
"file_path": "diffusers/benchmarks/benchmarking_utils.py",
"repo_id": "diffusers",
"token_count": 3836
} | 112 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/TRANSLATING.md/0 | {
"file_path": "diffusers/docs/TRANSLATING.md",
"repo_id": "diffusers",
"token_count": 1100
} | 113 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/loaders/unet.md/0 | {
"file_path": "diffusers/docs/source/en/api/loaders/unet.md",
"repo_id": "diffusers",
"token_count": 406
} | 114 |
<!--Copyright 2025 The HuggingFace Team and The InstantX Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by ap... | diffusers/docs/source/en/api/models/controlnet_union.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/controlnet_union.md",
"repo_id": "diffusers",
"token_count": 486
} | 115 |
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/pipelines/controlnetxs.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/controlnetxs.md",
"repo_id": "diffusers",
"token_count": 896
} | 116 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... | diffusers/docs/source/en/api/pipelines/kandinsky.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/kandinsky.md",
"repo_id": "diffusers",
"token_count": 846
} | 117 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/schedulers/lms_discrete.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/lms_discrete.md",
"repo_id": "diffusers",
"token_count": 335
} | 118 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/community_projects.md/0 | {
"file_path": "diffusers/docs/source/en/community_projects.md",
"repo_id": "diffusers",
"token_count": 1493
} | 119 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/modular_diffusers/loop_sequential_pipeline_blocks.md/0 | {
"file_path": "diffusers/docs/source/en/modular_diffusers/loop_sequential_pipeline_blocks.md",
"repo_id": "diffusers",
"token_count": 1394
} | 120 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/optimization/open_vino.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/open_vino.md",
"repo_id": "diffusers",
"token_count": 1115
} | 121 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/training/cogvideox.md/0 | {
"file_path": "diffusers/docs/source/en/training/cogvideox.md",
"repo_id": "diffusers",
"token_count": 6071
} | 122 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/training/unconditional_training.md/0 | {
"file_path": "diffusers/docs/source/en/training/unconditional_training.md",
"repo_id": "diffusers",
"token_count": 2949
} | 123 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/using-diffusers/image_quality.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/image_quality.md",
"repo_id": "diffusers",
"token_count": 2199
} | 124 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/using-diffusers/sdxl.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/sdxl.md",
"repo_id": "diffusers",
"token_count": 7092
} | 125 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ja/tutorials/autopipeline.md/0 | {
"file_path": "diffusers/docs/source/ja/tutorials/autopipeline.md",
"repo_id": "diffusers",
"token_count": 4154
} | 126 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ko/optimization/open_vino.md/0 | {
"file_path": "diffusers/docs/source/ko/optimization/open_vino.md",
"repo_id": "diffusers",
"token_count": 927
} | 127 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agree... | diffusers/docs/source/ko/training/text_inversion.md/0 | {
"file_path": "diffusers/docs/source/ko/training/text_inversion.md",
"repo_id": "diffusers",
"token_count": 9111
} | 128 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ko/using-diffusers/schedulers.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/schedulers.md",
"repo_id": "diffusers",
"token_count": 6923
} | 129 |
<!--版权归2025年HuggingFace团队所有。保留所有权利。
根据Apache许可证2.0版("许可证")授权;除非符合许可证要求,否则不得使用此文件。您可以在以下网址获取许可证副本:
http://www.apache.org/licenses/LICENSE-2.0
除非适用法律要求或书面同意,本软件按"原样"分发,不附带任何明示或暗示的担保或条件。详见许可证中规定的特定语言权限和限制。
-->
# 🧨 Diffusers伦理准则
## 前言
[Diffusers](https://huggingface.co/docs/diffusers/index)不仅提供预训练的diffusion模型,还是一个模块... | diffusers/docs/source/zh/conceptual/ethical_guidelines.md/0 | {
"file_path": "diffusers/docs/source/zh/conceptual/ethical_guidelines.md",
"repo_id": "diffusers",
"token_count": 2687
} | 130 |
<!--版权所有 2025 The HuggingFace Team。保留所有权利。
根据Apache许可证2.0版("许可证")授权;除非符合许可证,否则不得使用此文件。您可以在
http://www.apache.org/licenses/LICENSE-2.0
获取许可证的副本。
除非适用法律要求或书面同意,根据许可证分发的软件按"原样"分发,无任何明示或暗示的担保或条件。有关许可证下特定语言的管理权限和限制,请参阅许可证。
-->
# 快速入门
模块化Diffusers是一个快速构建灵活和可定制管道的框架。模块化Diffusers的核心是[`ModularPipelineBlocks`],可以与其他块组合以适应新... | diffusers/docs/source/zh/modular_diffusers/quickstart.md/0 | {
"file_path": "diffusers/docs/source/zh/modular_diffusers/quickstart.md",
"repo_id": "diffusers",
"token_count": 7558
} | 131 |
<!--版权所有 2025 The HuggingFace Team。保留所有权利。
根据 Apache 许可证 2.0 版(“许可证”)授权;除非遵守许可证,否则不得使用此文件。
您可以在以下网址获取许可证副本:
http://www.apache.org/licenses/LICENSE-2.0
除非适用法律要求或书面同意,根据许可证分发的软件按“原样”分发,不附带任何明示或暗示的担保或条件。请参阅许可证以了解具体的语言管理权限和限制。
-->
# 令牌合并
[令牌合并](https://huggingface.co/papers/2303.17604)(ToMe)在基于 Transformer 的网络的前向传递中逐步... | diffusers/docs/source/zh/optimization/tome.md/0 | {
"file_path": "diffusers/docs/source/zh/optimization/tome.md",
"repo_id": "diffusers",
"token_count": 3963
} | 132 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/zh/using-diffusers/consisid.md/0 | {
"file_path": "diffusers/docs/source/zh/using-diffusers/consisid.md",
"repo_id": "diffusers",
"token_count": 3518
} | 133 |
from typing import Optional
import torch
from PIL import Image
from tqdm.auto import tqdm
from transformers import CLIPTextModel, CLIPTokenizer
from diffusers import AutoencoderKL, DDIMScheduler, DiffusionPipeline, UNet2DConditionModel
from diffusers.image_processor import VaeImageProcessor
from diffusers.utils impor... | diffusers/examples/community/edict_pipeline.py/0 | {
"file_path": "diffusers/examples/community/edict_pipeline.py",
"repo_id": "diffusers",
"token_count": 4682
} | 134 |
import inspect
import re
from typing import Callable, List, Optional, Union
import numpy as np
import PIL.Image
import torch
from packaging import version
from transformers import CLIPImageProcessor, CLIPTokenizer
import diffusers
from diffusers import OnnxRuntimeModel, OnnxStableDiffusionPipeline, SchedulerMixin
fro... | diffusers/examples/community/lpw_stable_diffusion_onnx.py/0 | {
"file_path": "diffusers/examples/community/lpw_stable_diffusion_onnx.py",
"repo_id": "diffusers",
"token_count": 24244
} | 135 |
# Copyright 2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/examples/community/pipeline_sdxl_style_aligned.py/0 | {
"file_path": "diffusers/examples/community/pipeline_sdxl_style_aligned.py",
"repo_id": "diffusers",
"token_count": 42215
} | 136 |
# Copyright 2025 Lightricks and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | diffusers/examples/community/pipeline_stg_ltx.py/0 | {
"file_path": "diffusers/examples/community/pipeline_stg_ltx.py",
"repo_id": "diffusers",
"token_count": 18853
} | 137 |
# Inspired by: https://github.com/haofanwang/ControlNet-for-Diffusers/
import inspect
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import PIL.Image
import torch
import torch.nn.functional as F
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from di... | diffusers/examples/community/stable_diffusion_controlnet_inpaint.py/0 | {
"file_path": "diffusers/examples/community/stable_diffusion_controlnet_inpaint.py",
"repo_id": "diffusers",
"token_count": 23771
} | 138 |
import inspect
from typing import List, Optional, Tuple, Union
import torch
from torch.nn import functional as F
from transformers import CLIPTextModelWithProjection, CLIPTokenizer
from transformers.models.clip.modeling_clip import CLIPTextModelOutput
from diffusers import (
DiffusionPipeline,
ImagePipelineOu... | diffusers/examples/community/unclip_text_interpolation.py/0 | {
"file_path": "diffusers/examples/community/unclip_text_interpolation.py",
"repo_id": "diffusers",
"token_count": 10699
} | 139 |
# DreamBooth training example
[DreamBooth](https://huggingface.co/papers/2208.12242) is a method to personalize text2image models like stable diffusion given just a few(3~5) images of a subject.
The `train_dreambooth.py` script shows how to implement the training procedure and adapt it for stable diffusion.
## Runni... | diffusers/examples/dreambooth/README.md/0 | {
"file_path": "diffusers/examples/dreambooth/README.md",
"repo_id": "diffusers",
"token_count": 10165
} | 140 |
# coding=utf-8
# Copyright 2025 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/examples/dreambooth/test_dreambooth.py/0 | {
"file_path": "diffusers/examples/dreambooth/test_dreambooth.py",
"repo_id": "diffusers",
"token_count": 4466
} | 141 |
# InstructPix2Pix training example
[InstructPix2Pix](https://huggingface.co/papers/2211.09800) is a method to fine-tune text-conditioned diffusion models such that they can follow an edit instruction for an input image. Models fine-tuned using this method take the following as inputs:
<p align="center">
<img src=... | diffusers/examples/instruct_pix2pix/README.md/0 | {
"file_path": "diffusers/examples/instruct_pix2pix/README.md",
"repo_id": "diffusers",
"token_count": 2742
} | 142 |
import numpy as np
import numpy.core.multiarray as multiarray
import torch
import torch.nn as nn
from huggingface_hub import hf_hub_download
from torch.serialization import add_safe_globals
from diffusers import DDPMScheduler, UNet1DModel
add_safe_globals(
[
multiarray._reconstruct,
np.ndarray,
... | diffusers/examples/reinforcement_learning/diffusion_policy.py/0 | {
"file_path": "diffusers/examples/reinforcement_learning/diffusion_policy.py",
"repo_id": "diffusers",
"token_count": 3227
} | 143 |
# [DreamBooth](https://github.com/huggingface/diffusers/tree/main/examples/dreambooth) by [colossalai](https://github.com/hpcaitech/ColossalAI.git)
[DreamBooth](https://huggingface.co/papers/2208.12242) is a method to personalize text2image models like stable diffusion given just a few(3~5) images of a subject.
The `t... | diffusers/examples/research_projects/colossalai/README.md/0 | {
"file_path": "diffusers/examples/research_projects/colossalai/README.md",
"repo_id": "diffusers",
"token_count": 1660
} | 144 |
# Dreambooth for the inpainting model
This script was added by @thedarkzeno .
Please note that this script is not actively maintained, you can open an issue and tag @thedarkzeno or @patil-suraj though.
```bash
export MODEL_NAME="runwayml/stable-diffusion-inpainting"
export INSTANCE_DIR="path-to-instance-images"
expo... | diffusers/examples/research_projects/dreambooth_inpaint/README.md/0 | {
"file_path": "diffusers/examples/research_projects/dreambooth_inpaint/README.md",
"repo_id": "diffusers",
"token_count": 1501
} | 145 |
import argparse
import itertools
import json
import os
import random
import time
from pathlib import Path
import torch
import torch.nn.functional as F
from accelerate import Accelerator
from accelerate.utils import ProjectConfiguration
from ip_adapter.ip_adapter import ImageProjModel
from ip_adapter.utils import is_to... | diffusers/examples/research_projects/ip_adapter/tutorial_train_ip-adapter.py/0 | {
"file_path": "diffusers/examples/research_projects/ip_adapter/tutorial_train_ip-adapter.py",
"repo_id": "diffusers",
"token_count": 7360
} | 146 |
import torch
import torchvision.transforms as T
from controlnet_aux import HEDdetector
from diffusers.utils import load_image
from examples.research_projects.pixart.controlnet_pixart_alpha import PixArtControlNetAdapterModel
from examples.research_projects.pixart.pipeline_pixart_alpha_controlnet import PixArtAlphaCont... | diffusers/examples/research_projects/pixart/run_pixart_alpha_controlnet_pipeline.py/0 | {
"file_path": "diffusers/examples/research_projects/pixart/run_pixart_alpha_controlnet_pipeline.py",
"repo_id": "diffusers",
"token_count": 895
} | 147 |
import argparse
import os
import torch
from PIL import Image, ImageFilter
from transformers import CLIPTextModel
from diffusers import DPMSolverMultistepScheduler, StableDiffusionInpaintPipeline, UNet2DConditionModel
parser = argparse.ArgumentParser(description="Inference")
parser.add_argument(
"--model_path",
... | diffusers/examples/research_projects/realfill/infer.py/0 | {
"file_path": "diffusers/examples/research_projects/realfill/infer.py",
"repo_id": "diffusers",
"token_count": 984
} | 148 |
<jupyter_start><jupyter_text>Running Stable Diffusion 3 (SD3) DreamBooth LoRA training under 16GB GPU VRAM Install Dependencies<jupyter_code>!pip install -q -U git+https://github.com/huggingface/diffusers
!pip install -q -U \
transformers \
accelerate \
wandb \
bitsandbytes \
peft<jupyter_output><e... | diffusers/examples/research_projects/sd3_lora_colab/sd3_dreambooth_lora_16gb.ipynb/0 | {
"file_path": "diffusers/examples/research_projects/sd3_lora_colab/sd3_dreambooth_lora_16gb.ipynb",
"repo_id": "diffusers",
"token_count": 1071
} | 149 |
import asyncio
import logging
import os
import random
import tempfile
import traceback
import uuid
import aiohttp
import torch
from fastapi import FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles
from pydantic import BaseModel
from diffusers.pipelin... | diffusers/examples/server/server.py/0 | {
"file_path": "diffusers/examples/server/server.py",
"repo_id": "diffusers",
"token_count": 1691
} | 150 |
## Training an VQGAN VAE
VQVAEs were first introduced in [Neural Discrete Representation Learning](https://huggingface.co/papers/1711.00937) and was combined with a GAN in the paper [Taming Transformers for High-Resolution Image Synthesis](https://huggingface.co/papers/2012.09841). The basic idea of a VQVAE is it's a t... | diffusers/examples/vqgan/README.md/0 | {
"file_path": "diffusers/examples/vqgan/README.md",
"repo_id": "diffusers",
"token_count": 1950
} | 151 |
import argparse
from typing import Any, Dict
import torch
from transformers import T5EncoderModel, T5Tokenizer
from diffusers import (
AutoencoderKLCogVideoX,
CogVideoXDDIMScheduler,
CogVideoXImageToVideoPipeline,
CogVideoXPipeline,
CogVideoXTransformer3DModel,
)
def reassign_query_key_value_inp... | diffusers/scripts/convert_cogvideox_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_cogvideox_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 5698
} | 152 |
import argparse
import re
import torch
import yaml
from transformers import (
CLIPProcessor,
CLIPTextModel,
CLIPTokenizer,
CLIPVisionModelWithProjection,
)
from diffusers import (
AutoencoderKL,
DDIMScheduler,
StableDiffusionGLIGENPipeline,
StableDiffusionGLIGENTextImagePipeline,
U... | diffusers/scripts/convert_gligen_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_gligen_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 11150
} | 153 |
# coding=utf-8
# Copyright 2025 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | diffusers/scripts/convert_ms_text_to_video_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_ms_text_to_video_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 8415
} | 154 |
import argparse
import tempfile
import torch
from accelerate import load_checkpoint_and_dispatch
from diffusers.models.transformers.prior_transformer import PriorTransformer
from diffusers.pipelines.shap_e import ShapERenderer
"""
Example - From the diffusers root directory:
Download weights:
```sh
$ wget "https:... | diffusers/scripts/convert_shap_e_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_shap_e_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 22931
} | 155 |
import argparse
import pathlib
from typing import Any, Dict, Tuple
import torch
from accelerate import init_empty_weights
from huggingface_hub import hf_hub_download, snapshot_download
from safetensors.torch import load_file
from transformers import AutoProcessor, AutoTokenizer, CLIPVisionModelWithProjection, UMT5Enco... | diffusers/scripts/convert_wan_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_wan_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 21823
} | 156 |
# 🧨 Diffusers Experimental
We are adding experimental code to support novel applications and usages of the Diffusers library.
Currently, the following experiments are supported:
* Reinforcement learning via an implementation of the [Diffuser](https://huggingface.co/papers/2205.09991) model. | diffusers/src/diffusers/experimental/README.md/0 | {
"file_path": "diffusers/src/diffusers/experimental/README.md",
"repo_id": "diffusers",
"token_count": 70
} | 157 |
# Copyright 2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/hooks/_common.py/0 | {
"file_path": "diffusers/src/diffusers/hooks/_common.py",
"repo_id": "diffusers",
"token_count": 748
} | 158 |
# Copyright 2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/loaders/lora_pipeline.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/lora_pipeline.py",
"repo_id": "diffusers",
"token_count": 144944
} | 159 |
# Copyright 2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/models/attention_dispatch.py/0 | {
"file_path": "diffusers/src/diffusers/models/attention_dispatch.py",
"repo_id": "diffusers",
"token_count": 19449
} | 160 |
# Copyright 2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/models/autoencoders/autoencoder_kl_temporal_decoder.py/0 | {
"file_path": "diffusers/src/diffusers/models/autoencoders/autoencoder_kl_temporal_decoder.py",
"repo_id": "diffusers",
"token_count": 6362
} | 161 |
# Copyright 2025 HunyuanDiT Authors, Qixun Wang and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | diffusers/src/diffusers/models/controlnets/controlnet_hunyuan.py/0 | {
"file_path": "diffusers/src/diffusers/models/controlnets/controlnet_hunyuan.py",
"repo_id": "diffusers",
"token_count": 7436
} | 162 |
from dataclasses import dataclass
from ..utils import BaseOutput
@dataclass
class AutoencoderKLOutput(BaseOutput):
"""
Output of AutoencoderKL encoding method.
Args:
latent_dist (`DiagonalGaussianDistribution`):
Encoded outputs of `Encoder` represented as the mean and logvar of `Diag... | diffusers/src/diffusers/models/modeling_outputs.py/0 | {
"file_path": "diffusers/src/diffusers/models/modeling_outputs.py",
"repo_id": "diffusers",
"token_count": 377
} | 163 |
from dataclasses import dataclass
from typing import Dict, Optional, Union
import torch
import torch.nn.functional as F
from torch import nn
from ...configuration_utils import ConfigMixin, register_to_config
from ...loaders import PeftAdapterMixin, UNet2DConditionLoadersMixin
from ...utils import BaseOutput
from ..at... | diffusers/src/diffusers/models/transformers/prior_transformer.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/prior_transformer.py",
"repo_id": "diffusers",
"token_count": 7467
} | 164 |
# Copyright 2025 The Lightricks team and The HuggingFace Team.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | diffusers/src/diffusers/models/transformers/transformer_ltx.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/transformer_ltx.py",
"repo_id": "diffusers",
"token_count": 10322
} | 165 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.