text stringlengths 5 631k | id stringlengths 14 178 | metadata dict | __index_level_0__ int64 0 647 |
|---|---|---|---|
import type { ToolIOType, ToolOutputComponents } from "$lib/types/Tool";
export const ToolOutputPaths: Record<
ToolOutputComponents,
{
type: ToolIOType;
path: string;
}
> = {
textbox: {
type: "str",
path: "$",
},
markdown: {
type: "str",
path: "$",
},
number: {
type: "float",
path: "$",
},
im... | chat-ui/src/lib/server/tools/outputs.ts/0 | {
"file_path": "chat-ui/src/lib/server/tools/outputs.ts",
"repo_id": "chat-ui",
"token_count": 344
} | 87 |
import {
chromium,
devices,
type Page,
type BrowserContextOptions,
type Response,
type Browser,
} from "playwright";
import { PlaywrightBlocker } from "@cliqz/adblocker-playwright";
import { config } from "$lib/server/config";
import { logger } from "$lib/server/logger";
import { onExit } from "$lib/server/exitHa... | chat-ui/src/lib/server/websearch/scrape/playwright.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/scrape/playwright.ts",
"repo_id": "chat-ui",
"token_count": 938
} | 88 |
import { writable } from "svelte/store";
export const ERROR_MESSAGES = {
default: "Oops, something went wrong.",
authOnly: "You have to be logged in.",
rateLimited: "You are sending too many messages. Try again later.",
};
export const error = writable<string | undefined>(undefined);
| chat-ui/src/lib/stores/errors.ts/0 | {
"file_path": "chat-ui/src/lib/stores/errors.ts",
"repo_id": "chat-ui",
"token_count": 86
} | 89 |
import type { Session } from "./Session";
import type { Timestamps } from "./Timestamps";
import type { User } from "./User";
export interface MessageEvent extends Pick<Timestamps, "createdAt"> {
userId: User["_id"] | Session["sessionId"];
ip?: string;
expiresAt: Date;
type: "message" | "export";
}
| chat-ui/src/lib/types/MessageEvent.ts/0 | {
"file_path": "chat-ui/src/lib/types/MessageEvent.ts",
"repo_id": "chat-ui",
"token_count": 99
} | 90 |
import type { ObjectId } from "mongodb";
import type { Conversation } from "./Conversation";
import type { Timestamps } from "./Timestamps";
import type { HeaderElement } from "$lib/server/websearch/markdown/types";
export interface WebSearch extends Timestamps {
_id?: ObjectId;
convId?: Conversation["_id"];
promp... | chat-ui/src/lib/types/WebSearch.ts/0 | {
"file_path": "chat-ui/src/lib/types/WebSearch.ts",
"repo_id": "chat-ui",
"token_count": 348
} | 91 |
import katex from "katex";
import "katex/dist/contrib/mhchem.mjs";
import { Marked } from "marked";
import type { Tokens, TokenizerExtension, RendererExtension } from "marked";
import type { WebSearchSource } from "$lib/types/WebSearch";
import hljs from "highlight.js";
interface katexBlockToken extends Tokens.Generic... | chat-ui/src/lib/utils/marked.ts/0 | {
"file_path": "chat-ui/src/lib/utils/marked.ts",
"repo_id": "chat-ui",
"token_count": 2227
} | 92 |
import type { Tool } from "$lib/types/Tool";
/**
* Checks if a tool's name equals a value. Replaces all hyphens with underscores before comparison
* since some models return underscores even when hyphens are used in the request.
**/
export function toolHasName(name: string, tool: Pick<Tool, "name">): boolean {
ret... | chat-ui/src/lib/utils/tools.ts/0 | {
"file_path": "chat-ui/src/lib/utils/tools.ts",
"repo_id": "chat-ui",
"token_count": 202
} | 93 |
<script lang="ts">
import "../styles/main.css";
import { onDestroy, onMount, untrack } from "svelte";
import { goto } from "$app/navigation";
import { base } from "$app/paths";
import { page } from "$app/stores";
import { error } from "$lib/stores/errors";
import { createSettingsStore } from "$lib/stores/setti... | chat-ui/src/routes/+layout.svelte/0 | {
"file_path": "chat-ui/src/routes/+layout.svelte",
"repo_id": "chat-ui",
"token_count": 3200
} | 94 |
import { config } from "$lib/server/config";
import { authCondition, requiresUser } from "$lib/server/auth.js";
import { collections } from "$lib/server/database.js";
import { editableToolSchema } from "$lib/server/tools/index.js";
import { generateSearchTokens } from "$lib/utils/searchTokens.js";
import { ObjectId } f... | chat-ui/src/routes/api/tools/+server.ts/0 | {
"file_path": "chat-ui/src/routes/api/tools/+server.ts",
"repo_id": "chat-ui",
"token_count": 742
} | 95 |
<script lang="ts">
import ChatWindow from "$lib/components/chat/ChatWindow.svelte";
import { pendingMessage } from "$lib/stores/pendingMessage";
import { isAborted } from "$lib/stores/isAborted";
import { onMount } from "svelte";
import { page } from "$app/state";
import { beforeNavigate, goto, invalidateAll } fr... | chat-ui/src/routes/conversation/[id]/+page.svelte/0 | {
"file_path": "chat-ui/src/routes/conversation/[id]/+page.svelte",
"repo_id": "chat-ui",
"token_count": 6099
} | 96 |
import { base } from "$app/paths";
import { redirect } from "@sveltejs/kit";
export async function load({ params, parent, fetch }) {
const r = await fetch(`${base}/api/v2/models/${params.model}/subscribe`, {
method: "POST",
});
if (!r.ok) {
redirect(302, base + "/");
}
return {
settings: await parent().th... | chat-ui/src/routes/models/[...model]/+page.ts/0 | {
"file_path": "chat-ui/src/routes/models/[...model]/+page.ts",
"repo_id": "chat-ui",
"token_count": 153
} | 97 |
<script lang="ts">
import AssistantSettings from "$lib/components/AssistantSettings.svelte";
import type { PageData } from "./$types";
interface Props {
data: PageData;
}
let { data }: Props = $props();
</script>
<AssistantSettings models={data.models} />
| chat-ui/src/routes/settings/(nav)/assistants/new/+page.svelte/0 | {
"file_path": "chat-ui/src/routes/settings/(nav)/assistants/new/+page.svelte",
"repo_id": "chat-ui",
"token_count": 87
} | 98 |
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit # https://github.com/charliermarsh/ruff#usage
rev: 'v0.11.8'
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
| datasets/.pre-commit-config.yaml/0 | {
"file_path": "datasets/.pre-commit-config.yaml",
"repo_id": "datasets",
"token_count": 122
} | 99 |
import json
import sys
def format_json_to_md(input_json_file, output_md_file):
with open(input_json_file, encoding="utf-8") as f:
results = json.load(f)
output_md = ["<details>", "<summary>Show updated benchmarks!</summary>", " "]
for benchmark_name in sorted(results):
benchmark_res = re... | datasets/benchmarks/format.py/0 | {
"file_path": "datasets/benchmarks/format.py",
"repo_id": "datasets",
"token_count": 746
} | 100 |
# Batch mapping
Combining the utility of [`Dataset.map`] with batch mode is very powerful. It allows you to speed up processing, and freely control the size of the generated dataset.
## Need for speed
The primary objective of batch mapping is to speed up processing. Often times, it is faster to work with batches of... | datasets/docs/source/about_map_batch.mdx/0 | {
"file_path": "datasets/docs/source/about_map_batch.mdx",
"repo_id": "datasets",
"token_count": 722
} | 101 |
# Image classification
Image classification datasets are used to train a model to classify an entire image. There are a wide variety of applications enabled by these datasets such as identifying endangered wildlife species or screening for disease in medical images. This guide will show you how to apply transformation... | datasets/docs/source/image_classification.mdx/0 | {
"file_path": "datasets/docs/source/image_classification.mdx",
"repo_id": "datasets",
"token_count": 1051
} | 102 |
# Table Classes
Each `Dataset` object is backed by a PyArrow Table.
A Table can be loaded from either the disk (memory mapped) or in memory.
Several Table types are available, and they all inherit from [`table.Table`].
## Table
[[autodoc]] datasets.table.Table
- validate
- equals
- to_batches
- to_py... | datasets/docs/source/package_reference/table_classes.mdx/0 | {
"file_path": "datasets/docs/source/package_reference/table_classes.mdx",
"repo_id": "datasets",
"token_count": 1029
} | 103 |
# Use with Polars
This document is a quick introduction to using `datasets` with Polars, with a particular focus on how to process
datasets using Polars functions, and how to convert a dataset to Polars or from Polars.
This is particularly useful as it allows fast zero-copy operations, since both `datasets` and Polar... | datasets/docs/source/use_with_polars.mdx/0 | {
"file_path": "datasets/docs/source/use_with_polars.mdx",
"repo_id": "datasets",
"token_count": 1829
} | 104 |
from abc import ABC, abstractmethod
from argparse import ArgumentParser
class BaseDatasetsCLICommand(ABC):
@staticmethod
@abstractmethod
def register_subcommand(parser: ArgumentParser):
raise NotImplementedError()
@abstractmethod
def run(self):
raise NotImplementedError()
| datasets/src/datasets/commands/__init__.py/0 | {
"file_path": "datasets/src/datasets/commands/__init__.py",
"repo_id": "datasets",
"token_count": 107
} | 105 |
import os
from dataclasses import dataclass, field
from io import BytesIO
from typing import TYPE_CHECKING, Any, ClassVar, Optional, Union
import numpy as np
import pyarrow as pa
from .. import config
from ..download.download_config import DownloadConfig
from ..table import array_cast
from ..utils.file_utils import i... | datasets/src/datasets/features/audio.py/0 | {
"file_path": "datasets/src/datasets/features/audio.py",
"repo_id": "datasets",
"token_count": 5748
} | 106 |
from itertools import chain
from typing import Optional, Union
from huggingface_hub import (
CommitInfo,
CommitOperationAdd,
CommitOperationDelete,
DatasetCard,
DatasetCardData,
HfApi,
HfFileSystem,
)
import datasets.config
from datasets.info import DatasetInfosDict
from datasets.load impo... | datasets/src/datasets/hub.py/0 | {
"file_path": "datasets/src/datasets/hub.py",
"repo_id": "datasets",
"token_count": 2184
} | 107 |
import inspect
import re
from typing import Dict, List, Tuple
from huggingface_hub.utils import insecure_hashlib
from .arrow import arrow
from .audiofolder import audiofolder
from .cache import cache
from .csv import csv
from .hdf5 import hdf5
from .imagefolder import imagefolder
from .json import json
from .pandas i... | datasets/src/datasets/packaged_modules/__init__.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/__init__.py",
"repo_id": "datasets",
"token_count": 2142
} | 108 |
import datasets
from ..folder_based_builder import folder_based_builder
logger = datasets.utils.logging.get_logger(__name__)
class ImageFolderConfig(folder_based_builder.FolderBasedBuilderConfig):
"""BuilderConfig for ImageFolder."""
drop_labels: bool = None
drop_metadata: bool = None
def __post_... | datasets/src/datasets/packaged_modules/imagefolder/imagefolder.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/imagefolder/imagefolder.py",
"repo_id": "datasets",
"token_count": 887
} | 109 |
import datasets
from ..folder_based_builder import folder_based_builder
logger = datasets.utils.logging.get_logger(__name__)
class VideoFolderConfig(folder_based_builder.FolderBasedBuilderConfig):
"""BuilderConfig for ImageFolder."""
drop_labels: bool = None
drop_metadata: bool = None
def __post_... | datasets/src/datasets/packaged_modules/videofolder/videofolder.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/videofolder/videofolder.py",
"repo_id": "datasets",
"token_count": 279
} | 110 |
import enum
import inspect
import warnings
from functools import wraps
from typing import Callable, Optional
from .logging import get_logger
_emitted_deprecation_warnings = set()
logger = get_logger(__name__)
def deprecated(help_message: Optional[str] = None):
"""Decorator to mark a class or a function as depr... | datasets/src/datasets/utils/deprecation_utils.py/0 | {
"file_path": "datasets/src/datasets/utils/deprecation_utils.py",
"repo_id": "datasets",
"token_count": 1426
} | 111 |
name: "" # Filename comes here
allow_empty: false
allow_empty_text: true
subsections:
- name: "Dataset Card for X" # First-level markdown heading
allow_empty: false
allow_empty_text: true
subsections:
- name: "Table of Contents"
allow_empty: false
allow_empty_text: false
subs... | datasets/src/datasets/utils/resources/readme_structure.yaml/0 | {
"file_path": "datasets/src/datasets/utils/resources/readme_structure.yaml",
"repo_id": "datasets",
"token_count": 1924
} | 112 |
import pytest
import datasets
import datasets.config
# Import fixture modules as plugins
pytest_plugins = ["tests.fixtures.files", "tests.fixtures.hub", "tests.fixtures.fsspec"]
def pytest_collection_modifyitems(config, items):
# Mark tests as "unit" by default if not marked as "integration" (or already marked... | datasets/tests/conftest.py/0 | {
"file_path": "datasets/tests/conftest.py",
"repo_id": "datasets",
"token_count": 853
} | 113 |
import pytest
from datasets import Dataset, Features, Pdf
from ..utils import require_pdfplumber
@require_pdfplumber
@pytest.mark.parametrize(
"build_example",
[
lambda pdf_path: pdf_path,
lambda pdf_path: open(pdf_path, "rb").read(),
lambda pdf_path: {"path": pdf_path},
lamb... | datasets/tests/features/test_pdf.py/0 | {
"file_path": "datasets/tests/features/test_pdf.py",
"repo_id": "datasets",
"token_count": 826
} | 114 |
import pyarrow as pa
import pytest
from datasets.builder import InvalidConfigName
from datasets.data_files import DataFilesList
from datasets.packaged_modules.arrow.arrow import Arrow, ArrowConfig
@pytest.fixture
def arrow_file_streaming_format(tmp_path):
filename = tmp_path / "stream.arrow"
testdata = [[1, ... | datasets/tests/packaged_modules/test_arrow.py/0 | {
"file_path": "datasets/tests/packaged_modules/test_arrow.py",
"repo_id": "datasets",
"token_count": 873
} | 115 |
import copy
import os
import tempfile
from unittest import TestCase
from unittest.mock import patch
import numpy as np
import pyarrow as pa
import pyarrow.parquet as pq
import pytest
from datasets.arrow_writer import ArrowWriter, OptimizedTypedSequence, ParquetWriter, TypedSequence
from datasets.features import Array... | datasets/tests/test_arrow_writer.py/0 | {
"file_path": "datasets/tests/test_arrow_writer.py",
"repo_id": "datasets",
"token_count": 6236
} | 116 |
import os
import pytest
import yaml
from datasets.features.features import Features, Value
from datasets.info import DatasetInfo, DatasetInfosDict
from datasets.utils.py_utils import asdict
@pytest.mark.parametrize(
"files",
[
["full:README.md", "dataset_infos.json"],
["empty:README.md", "da... | datasets/tests/test_info.py/0 | {
"file_path": "datasets/tests/test_info.py",
"repo_id": "datasets",
"token_count": 2860
} | 117 |
import fnmatch
import gc
import os
import shutil
import tempfile
import textwrap
import time
import unittest
from io import BytesIO
from pathlib import Path
from unittest.mock import patch
import numpy as np
import pytest
from huggingface_hub import DatasetCard, HfApi
from datasets import (
Audio,
ClassLabel,... | datasets/tests/test_upstream_hub.py/0 | {
"file_path": "datasets/tests/test_upstream_hub.py",
"repo_id": "datasets",
"token_count": 24619
} | 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/api/loaders/peft.md/0 | {
"file_path": "diffusers/docs/source/en/api/loaders/peft.md",
"repo_id": "diffusers",
"token_count": 332
} | 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 agree... | diffusers/docs/source/en/api/models/autoencoderkl_allegro.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/autoencoderkl_allegro.md",
"repo_id": "diffusers",
"token_count": 427
} | 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 agree... | diffusers/docs/source/en/api/models/mochi_transformer3d.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/mochi_transformer3d.md",
"repo_id": "diffusers",
"token_count": 340
} | 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 applic... | diffusers/docs/source/en/api/pipelines/hidream.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/hidream.md",
"repo_id": "diffusers",
"token_count": 474
} | 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 applic... | diffusers/docs/source/en/api/pipelines/mochi.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/mochi.md",
"repo_id": "diffusers",
"token_count": 3882
} | 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 to... | diffusers/docs/source/en/api/pipelines/shap_e.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/shap_e.md",
"repo_id": "diffusers",
"token_count": 590
} | 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/installation.md/0 | {
"file_path": "diffusers/docs/source/en/installation.md",
"repo_id": "diffusers",
"token_count": 1679
} | 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 agree... | diffusers/docs/source/en/quantization/torchao.md/0 | {
"file_path": "diffusers/docs/source/en/quantization/torchao.md",
"repo_id": "diffusers",
"token_count": 2770
} | 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/en/training/sdxl.md/0 | {
"file_path": "diffusers/docs/source/en/training/sdxl.md",
"repo_id": "diffusers",
"token_count": 4393
} | 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 agreed... | diffusers/docs/source/en/using-diffusers/custom_pipeline_overview.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/custom_pipeline_overview.md",
"repo_id": "diffusers",
"token_count": 2793
} | 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/en/using-diffusers/push_to_hub.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/push_to_hub.md",
"repo_id": "diffusers",
"token_count": 2083
} | 129 |
<!--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/index.md/0 | {
"file_path": "diffusers/docs/source/ja/index.md",
"repo_id": "diffusers",
"token_count": 2031
} | 130 |
<!--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/fp16.md/0 | {
"file_path": "diffusers/docs/source/ko/optimization/fp16.md",
"repo_id": "diffusers",
"token_count": 10834
} | 131 |
<!--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/training/instructpix2pix.md/0 | {
"file_path": "diffusers/docs/source/ko/training/instructpix2pix.md",
"repo_id": "diffusers",
"token_count": 5663
} | 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/ko/using-diffusers/loading.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/loading.md",
"repo_id": "diffusers",
"token_count": 14796
} | 133 |
<!--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/pt/quicktour.md/0 | {
"file_path": "diffusers/docs/source/pt/quicktour.md",
"repo_id": "diffusers",
"token_count": 6790
} | 134 |
<!--版权 2025 The HuggingFace Team。保留所有权利。
根据Apache许可证2.0版("许可证")授权;除非符合许可证的规定,否则不得使用此文件。
您可以在以下网址获取许可证的副本
http://www.apache.org/licenses/LICENSE-2.0
除非适用法律要求或书面同意,根据许可证分发的软件是基于"按原样"分发的,没有任何形式的明示或暗示的担保或条件。有关许可证下特定的语言管理权限和限制,请参阅许可证。
-->
# 状态
块依赖于[`~modular_pipelines.PipelineState`]和[`~modular_pipelines.BlockState`]数据... | diffusers/docs/source/zh/modular_diffusers/modular_diffusers_states.md/0 | {
"file_path": "diffusers/docs/source/zh/modular_diffusers/modular_diffusers_states.md",
"repo_id": "diffusers",
"token_count": 1834
} | 135 |
# ParaAttention
<div class="flex justify-center">
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/para-attn/flux-performance.png">
</div>
<div class="flex justify-center">
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/d... | diffusers/docs/source/zh/optimization/para_attn.md/0 | {
"file_path": "diffusers/docs/source/zh/optimization/para_attn.md",
"repo_id": "diffusers",
"token_count": 8534
} | 136 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
根据 Apache License 2.0 版本("许可证")授权,除非符合许可证要求,否则不得使用此文件。您可以通过以下网址获取许可证副本:
http://www.apache.org/licenses/LICENSE-2.0
除非适用法律要求或书面同意,本软件按"原样"分发,不附带任何明示或暗示的担保或条件。详见许可证中规定的特定语言权限和限制。
-->
# 概述
🤗 Diffusers 提供了一系列训练脚本供您训练自己的diffusion模型。您可以在 [diffusers/examples]... | diffusers/docs/source/zh/training/overview.md/0 | {
"file_path": "diffusers/docs/source/zh/training/overview.md",
"repo_id": "diffusers",
"token_count": 2461
} | 137 |
# 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/examples/amused/train_amused.py/0 | {
"file_path": "diffusers/examples/amused/train_amused.py",
"repo_id": "diffusers",
"token_count": 17513
} | 138 |
"""
This script performs DDIM inversion for video frames using a pre-trained model and generates
a video reconstruction based on a provided prompt. It utilizes the CogVideoX pipeline to
process video frames, apply the DDIM inverse scheduler, and produce an output video.
**Please notice that this script is based on the... | diffusers/examples/community/cogvideox_ddim_inversion.py/0 | {
"file_path": "diffusers/examples/community/cogvideox_ddim_inversion.py",
"repo_id": "diffusers",
"token_count": 12424
} | 139 |
import inspect
from typing import Any, Callable, Dict, List, Optional, Union
import numpy as np
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers.image_processor import VaeImageProcessor
from diffusers.loaders import FromSingleFileMixin, StableDiffusionLoraLoaderMix... | diffusers/examples/community/latent_consistency_interpolate.py/0 | {
"file_path": "diffusers/examples/community/latent_consistency_interpolate.py",
"repo_id": "diffusers",
"token_count": 22092
} | 140 |
#!/usr/bin/env python3
import torch
from diffusers import DiffusionPipeline
class UnetSchedulerOneForwardPipeline(DiffusionPipeline):
def __init__(self, unet, scheduler):
super().__init__()
self.register_modules(unet=unet, scheduler=scheduler)
def __call__(self):
image = torch.randn... | diffusers/examples/community/one_step_unet.py/0 | {
"file_path": "diffusers/examples/community/one_step_unet.py",
"repo_id": "diffusers",
"token_count": 299
} | 141 |
# Copyright 2025 Stability AI, Kwai-Kolors 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... | diffusers/examples/community/pipeline_kolors_differential_img2img.py/0 | {
"file_path": "diffusers/examples/community/pipeline_kolors_differential_img2img.py",
"repo_id": "diffusers",
"token_count": 29911
} | 142 |
# 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 applicabl... | diffusers/examples/community/pipeline_stable_diffusion_xl_ipex.py/0 | {
"file_path": "diffusers/examples/community/pipeline_stable_diffusion_xl_ipex.py",
"repo_id": "diffusers",
"token_count": 32238
} | 143 |
import types
from typing import List, Optional, Tuple, Union
import torch
from transformers import CLIPTextModelWithProjection, CLIPTokenizer
from transformers.models.clip.modeling_clip import CLIPTextModelOutput
from diffusers.models import PriorTransformer
from diffusers.pipelines import DiffusionPipeline, StableDi... | diffusers/examples/community/stable_unclip.py/0 | {
"file_path": "diffusers/examples/community/stable_unclip.py",
"repo_id": "diffusers",
"token_count": 5488
} | 144 |
# ControlNet training example
[Adding Conditional Control to Text-to-Image Diffusion Models](https://huggingface.co/papers/2302.05543) by Lvmin Zhang and Maneesh Agrawala.
This example is based on the [training example in the original ControlNet repository](https://github.com/lllyasviel/ControlNet/blob/main/docs/trai... | diffusers/examples/controlnet/README.md/0 | {
"file_path": "diffusers/examples/controlnet/README.md",
"repo_id": "diffusers",
"token_count": 6085
} | 145 |
# Search models on Civitai and Hugging Face
The [auto_diffusers](https://github.com/suzukimain/auto_diffusers) library provides additional functionalities to Diffusers such as searching for models on Civitai and the Hugging Face Hub.
Please refer to the original library [here](https://pypi.org/project/auto-diffusers/)... | diffusers/examples/model_search/README.md/0 | {
"file_path": "diffusers/examples/model_search/README.md",
"repo_id": "diffusers",
"token_count": 3696
} | 146 |
import os
import random
import torch
import torchvision.transforms as transforms
from PIL import Image
def recalculate_box_and_verify_if_valid(x, y, w, h, image_size, original_image_size, min_box_size):
scale = image_size / min(original_image_size)
crop_y = (original_image_size[1] * scale - image_size) // 2
... | diffusers/examples/research_projects/gligen/dataset.py/0 | {
"file_path": "diffusers/examples/research_projects/gligen/dataset.py",
"repo_id": "diffusers",
"token_count": 1897
} | 147 |
import argparse
import itertools
import math
import os
import random
from pathlib import Path
from typing import Iterable
import numpy as np
import PIL
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from accelerate import Accelerator
from accelerate.utils import ProjectConfiguration, set_se... | diffusers/examples/research_projects/intel_opts/textual_inversion_dfq/textual_inversion.py/0 | {
"file_path": "diffusers/examples/research_projects/intel_opts/textual_inversion_dfq/textual_inversion.py",
"repo_id": "diffusers",
"token_count": 18301
} | 148 |
## [Deprecated] Multi Token Textual Inversion
**IMPORTART: This research project is deprecated. Multi Token Textual Inversion is now supported natively in [the official textual inversion example](https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion#running-locally-with-pytorch).**
The author ... | diffusers/examples/research_projects/multi_token_textual_inversion/README.md/0 | {
"file_path": "diffusers/examples/research_projects/multi_token_textual_inversion/README.md",
"repo_id": "diffusers",
"token_count": 1852
} | 149 |
## Diffusers examples with ONNXRuntime optimizations
**This research project is not actively maintained by the diffusers team. For any questions or comments, please contact Isamu Isozaki(isamu-isozaki) on github with any questions.**
The aim of this project is to provide retrieval augmented diffusion models to diffus... | diffusers/examples/research_projects/rdm/README.md/0 | {
"file_path": "diffusers/examples/research_projects/rdm/README.md",
"repo_id": "diffusers",
"token_count": 75
} | 150 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2025 The HuggingFace Inc. 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/LI... | diffusers/examples/text_to_image/test_text_to_image.py/0 | {
"file_path": "diffusers/examples/text_to_image/test_text_to_image.py",
"repo_id": "diffusers",
"token_count": 7427
} | 151 |
## Training an unconditional diffusion model
Creating a training image set is [described in a different document](https://huggingface.co/docs/datasets/image_process#image-datasets).
### Installing the dependencies
Before running the scripts, make sure to install the library's training dependencies:
**Important**
T... | diffusers/examples/unconditional_image_generation/README.md/0 | {
"file_path": "diffusers/examples/unconditional_image_generation/README.md",
"repo_id": "diffusers",
"token_count": 1938
} | 152 |
import argparse
from typing import Dict
import torch
import torch.nn as nn
from diffusers import SparseControlNetModel
KEYS_RENAME_MAPPING = {
".attention_blocks.0": ".attn1",
".attention_blocks.1": ".attn2",
".attn1.pos_encoder": ".pos_embed",
".ff_norm": ".norm3",
".norms.0": ".norm1",
".n... | diffusers/scripts/convert_animatediff_sparsectrl_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_animatediff_sparsectrl_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 1144
} | 153 |
import argparse
from pathlib import Path
from typing import Any, Dict
import torch
from accelerate import init_empty_weights
from safetensors.torch import load_file
from transformers import T5EncoderModel, T5Tokenizer
from diffusers import (
AutoencoderKLLTXVideo,
FlowMatchEulerDiscreteScheduler,
LTXCondi... | diffusers/scripts/convert_ltx_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_ltx_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 9469
} | 154 |
#!/usr/bin/env python
from __future__ import annotations
import argparse
from contextlib import nullcontext
import torch
from accelerate import init_empty_weights
from diffusers import (
SanaControlNetModel,
)
from diffusers.models.modeling_utils import load_model_dict_into_meta
from diffusers.utils.import_utils... | diffusers/scripts/convert_sana_controlnet_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_sana_controlnet_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 4103
} | 155 |
# Copyright 2022 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/scripts/convert_vae_diff_to_onnx.py/0 | {
"file_path": "diffusers/scripts/convert_vae_diff_to_onnx.py",
"repo_id": "diffusers",
"token_count": 1684
} | 156 |
# 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/commands/fp16_safetensors.py/0 | {
"file_path": "diffusers/src/diffusers/commands/fp16_safetensors.py",
"repo_id": "diffusers",
"token_count": 2245
} | 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/guiders/skip_layer_guidance.py/0 | {
"file_path": "diffusers/src/diffusers/guiders/skip_layer_guidance.py",
"repo_id": "diffusers",
"token_count": 5103
} | 158 |
from typing import TYPE_CHECKING
from ..utils import DIFFUSERS_SLOW_IMPORT, _LazyModule, deprecate
from ..utils.import_utils import is_peft_available, is_torch_available, is_transformers_available
def text_encoder_lora_state_dict(text_encoder):
deprecate(
"text_encoder_load_state_dict in `models`",
... | diffusers/src/diffusers/loaders/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/__init__.py",
"repo_id": "diffusers",
"token_count": 2647
} | 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/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/models/__init__.py",
"repo_id": "diffusers",
"token_count": 4802
} | 160 |
# 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/autoencoders/autoencoder_kl_ltx.py/0 | {
"file_path": "diffusers/src/diffusers/models/autoencoders/autoencoder_kl_ltx.py",
"repo_id": "diffusers",
"token_count": 30359
} | 161 |
from ...utils import is_flax_available, is_torch_available
if is_torch_available():
from .controlnet import ControlNetModel, ControlNetOutput
from .controlnet_flux import FluxControlNetModel, FluxControlNetOutput, FluxMultiControlNetModel
from .controlnet_hunyuan import (
HunyuanControlNetOutput,
... | diffusers/src/diffusers/models/controlnets/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/models/controlnets/__init__.py",
"repo_id": "diffusers",
"token_count": 393
} | 162 |
# 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/lora.py/0 | {
"file_path": "diffusers/src/diffusers/models/lora.py",
"repo_id": "diffusers",
"token_count": 7982
} | 163 |
# 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/transformers/hunyuan_transformer_2d.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/hunyuan_transformer_2d.py",
"repo_id": "diffusers",
"token_count": 10633
} | 164 |
# Copyright 2025 Black Forest Labs, 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/LIC... | diffusers/src/diffusers/models/transformers/transformer_flux.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/transformer_flux.py",
"repo_id": "diffusers",
"token_count": 15574
} | 165 |
# 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/unets/unet_1d_blocks.py/0 | {
"file_path": "diffusers/src/diffusers/models/unets/unet_1d_blocks.py",
"repo_id": "diffusers",
"token_count": 11970
} | 166 |
# 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/vq_model.py/0 | {
"file_path": "diffusers/src/diffusers/models/vq_model.py",
"repo_id": "diffusers",
"token_count": 490
} | 167 |
# 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/modular_pipelines/stable_diffusion_xl/denoise.py/0 | {
"file_path": "diffusers/src/diffusers/modular_pipelines/stable_diffusion_xl/denoise.py",
"repo_id": "diffusers",
"token_count": 15351
} | 168 |
# 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/pipelines/audioldm2/modeling_audioldm2.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/audioldm2/modeling_audioldm2.py",
"repo_id": "diffusers",
"token_count": 32815
} | 169 |
# Copyright 2025 ConsisID Authors 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 ... | diffusers/src/diffusers/pipelines/consisid/pipeline_consisid.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/consisid/pipeline_consisid.py",
"repo_id": "diffusers",
"token_count": 20581
} | 170 |
# 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/pipelines/controlnet/pipeline_flax_controlnet.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py",
"repo_id": "diffusers",
"token_count": 10022
} | 171 |
# 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/pipelines/dance_diffusion/pipeline_dance_diffusion.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/dance_diffusion/pipeline_dance_diffusion.py",
"repo_id": "diffusers",
"token_count": 2803
} | 172 |
# Deprecated Pipelines
This folder contains pipelines that have very low usage as measured by model downloads, issues and PRs. While you can still use the pipelines just as before, we will stop testing the pipelines and will not accept any changes to existing files. | diffusers/src/diffusers/pipelines/deprecated/README.md/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/README.md",
"repo_id": "diffusers",
"token_count": 54
} | 173 |
from typing import TYPE_CHECKING
from ....utils import DIFFUSERS_SLOW_IMPORT, _LazyModule
_import_structure = {"pipeline_score_sde_ve": ["ScoreSdeVePipeline"]}
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
from .pipeline_score_sde_ve import ScoreSdeVePipeline
else:
import sys
sys.modules[__name__] = _Laz... | diffusers/src/diffusers/pipelines/deprecated/score_sde_ve/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/score_sde_ve/__init__.py",
"repo_id": "diffusers",
"token_count": 193
} | 174 |
from typing import TYPE_CHECKING
from ....utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
is_torch_available,
is_transformers_available,
is_transformers_version,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_available() and i... | diffusers/src/diffusers/pipelines/deprecated/versatile_diffusion/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/versatile_diffusion/__init__.py",
"repo_id": "diffusers",
"token_count": 1112
} | 175 |
# Copyright 2025 Black Forest Labs 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... | diffusers/src/diffusers/pipelines/flux/modeling_flux.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/flux/modeling_flux.py",
"repo_id": "diffusers",
"token_count": 519
} | 176 |
# 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/pipelines/free_noise_utils.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/free_noise_utils.py",
"repo_id": "diffusers",
"token_count": 13044
} | 177 |
# 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/pipelines/kandinsky/pipeline_kandinsky_combined.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py",
"repo_id": "diffusers",
"token_count": 17026
} | 178 |
from typing import Callable, Dict, List, Optional, Union
import torch
from transformers import T5EncoderModel, T5Tokenizer
from ...loaders import StableDiffusionLoraLoaderMixin
from ...models import Kandinsky3UNet, VQModel
from ...schedulers import DDPMScheduler
from ...utils import (
deprecate,
is_torch_xla_... | diffusers/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3.py",
"repo_id": "diffusers",
"token_count": 12750
} | 179 |
# Copyright 2023-2025 Marigold Team, ETH Zürich. All rights reserved.
# Copyright 2024-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
#
# ... | diffusers/src/diffusers/pipelines/marigold/marigold_image_processing.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/marigold/marigold_image_processing.py",
"repo_id": "diffusers",
"token_count": 14872
} | 180 |
from dataclasses import dataclass
from typing import TYPE_CHECKING, List, Optional, Union
import numpy as np
import PIL
from PIL import Image
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_... | diffusers/src/diffusers/pipelines/paint_by_example/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/paint_by_example/__init__.py",
"repo_id": "diffusers",
"token_count": 599
} | 181 |
# Copyright 2025 The GLIGEN Authors and 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 re... | diffusers/src/diffusers/pipelines/stable_diffusion/clip_image_project_model.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/clip_image_project_model.py",
"repo_id": "diffusers",
"token_count": 336
} | 182 |
# 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/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py",
"repo_id": "diffusers",
"token_count": 13951
} | 183 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_flax_available,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_additional_imports = {}
_import_structure = {"pipel... | diffusers/src/diffusers/pipelines/stable_diffusion_xl/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_xl/__init__.py",
"repo_id": "diffusers",
"token_count": 1202
} | 184 |
# 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/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py",
"repo_id": "diffusers",
"token_count": 15431
} | 185 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_available() and i... | diffusers/src/diffusers/pipelines/wan/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/wan/__init__.py",
"repo_id": "diffusers",
"token_count": 672
} | 186 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.