text stringlengths 5 631k | id stringlengths 14 178 | metadata dict | __index_level_0__ int64 0 647 |
|---|---|---|---|
//! Activation Functions
//!
use candle::{Result, Tensor};
#[derive(Debug, Clone, Copy, PartialEq, serde::Deserialize, serde::Serialize, Default)]
#[serde(rename_all = "lowercase")]
pub enum Activation {
#[default]
#[serde(alias = "gelu")]
Gelu,
#[serde(alias = "gelu_new")]
NewGelu,
Relu,
R... | candle/candle-nn/src/activation.rs/0 | {
"file_path": "candle/candle-nn/src/activation.rs",
"repo_id": "candle",
"token_count": 1702
} | 51 |
//! Rotary Embeddings
//!
use candle::{CpuStorage, Layout, Result, Shape, Tensor, D};
use rayon::prelude::*;
/// Interleaved variant of rotary embeddings.
/// The x0 and x1 value are interleaved on the n_embd (= head_dim) dimension.
/// The resulting y0 and y1 are also interleaved with:
/// y0 = x0*cos - x1*sin
/// ... | candle/candle-nn/src/rotary_emb.rs/0 | {
"file_path": "candle/candle-nn/src/rotary_emb.rs",
"repo_id": "candle",
"token_count": 17379
} | 52 |
# candle-onnx
This crate adds ONNX support to candle
## FAQ
#### Missing protoc installation when compiling candle-onnx
The candle-onnx dependency prost-build no longer comes bundled with prost
binaries. This could cause the following error when attempting to compile
candle-onnx:
```
error: failed to run custom bu... | candle/candle-onnx/README.md/0 | {
"file_path": "candle/candle-onnx/README.md",
"repo_id": "candle",
"token_count": 180
} | 53 |
# Generated content DO NOT EDIT
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Sequence
from os import PathLike
from candle.typing import _ArrayLike, Device, Scalar, Index, Shape
from candle import Tensor, DType, QTensor
@staticmethod
def avg_pool2d(tensor: Tensor, ksize: int, stride: int = 1) -... | candle/candle-pyo3/py_src/candle/functional/__init__.pyi/0 | {
"file_path": "candle/candle-pyo3/py_src/candle/functional/__init__.pyi",
"repo_id": "candle",
"token_count": 484
} | 54 |
[project]
name = 'candle-nn'
requires-python = '>=3.7'
authors = [
{name = 'The Candle Team'},
]
dynamic = [
'description',
'license',
'readme',
'version',
]
[project.urls]
Homepage = 'https://github.com/huggingface/candle'
Source = 'https://github.com/huggingface/candle'
[build-system]
requires ... | candle/candle-pyo3/pyproject.toml/0 | {
"file_path": "candle/candle-pyo3/pyproject.toml",
"repo_id": "candle",
"token_count": 292
} | 55 |
[package]
name = "candle-transformers"
version.workspace = true
edition.workspace = true
description.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
license.workspace = true
readme = "README.md"
[dependencies]
accelerate-src = { workspace = true, optional = true }
byt... | candle/candle-transformers/Cargo.toml/0 | {
"file_path": "candle/candle-transformers/Cargo.toml",
"repo_id": "candle",
"token_count": 395
} | 56 |
//! Contrastive Language-Image Pre-Training
//!
//! Contrastive Language-Image Pre-Training (CLIP) is an architecture trained on
//! pairs of images with related texts.
//!
//! https://github.com/openai/CLIP
//! https://github.com/huggingface/transformers/tree/f6fa0f0bf0796ac66f201f23bdb8585de1609add/src/transformers/m... | candle/candle-transformers/src/models/clip/vision_model.rs/0 | {
"file_path": "candle/candle-transformers/src/models/clip/vision_model.rs",
"repo_id": "candle",
"token_count": 2837
} | 57 |
//! EVA-2 inference implementation.
//!
//! EVA-02 is a computer vision model that can be used as an ImageNet classifier.
//! The model returns the probability for an image to belong to each of the 1000
//! ImageNet categories.
//!
//! - [Paper](https://arxiv.org/abs/2303.11331). EVA-02: A Visual Representation for Neo... | candle/candle-transformers/src/models/eva2.rs/0 | {
"file_path": "candle/candle-transformers/src/models/eva2.rs",
"repo_id": "candle",
"token_count": 7638
} | 58 |
//! # JinaBERT inference implementation
//!
//! Based on implementation from huggingface for Jina BERT and its variants
//!
//! See: [Jina Embeddings on HuggingFace](https://huggingface.co/jinaai/jina-embeddings-v2-base-en)
use super::with_tracing::{linear, linear_no_bias, Embedding, Linear};
use candle::{DType, Devic... | candle/candle-transformers/src/models/jina_bert.rs/0 | {
"file_path": "candle/candle-transformers/src/models/jina_bert.rs",
"repo_id": "candle",
"token_count": 6364
} | 59 |
//! NV-Embed-v2
//!
//! NV-Embed-v2 is a text embedding model that combines a Mistral decoder with a latent attention mechanism to produce high-quality text embeddings.
//!
//! This implementation is based on the [paper](https://arxiv.org/pdf/2405.17428) and [weights](https://huggingface.co/nvidia/NV-Embed-v2)
//!
//! ... | candle/candle-transformers/src/models/nvembed_v2/mod.rs/0 | {
"file_path": "candle/candle-transformers/src/models/nvembed_v2/mod.rs",
"repo_id": "candle",
"token_count": 211
} | 60 |
//! Gemma 3 model implementation with quantization support.
//!
//! Gemma 3 is a family of multimodal language models developed by Google.
//! This implementation provides quantization for reduced memory usage and faster inference.
//!
//! Key characteristics:
//! - Group-Query Attention (GQA) with specialized key-valu... | candle/candle-transformers/src/models/quantized_gemma3.rs/0 | {
"file_path": "candle/candle-transformers/src/models/quantized_gemma3.rs",
"repo_id": "candle",
"token_count": 8559
} | 61 |
// Adapted from:
// https://github.com/ChaoningZhang/MobileSAM/blob/master/mobile_sam/modeling/tiny_vit_sam.py
use candle::{IndexOp, Result, Tensor, D};
use candle_nn::{Conv2dConfig, Module, VarBuilder};
const MBCONV_EXPAND_RATIO: usize = 4;
const MLP_RATIO: usize = 4;
const LOCAL_CONV_SIZE: usize = 3;
const IMG_SIZE:... | candle/candle-transformers/src/models/segment_anything/tiny_vit.rs/0 | {
"file_path": "candle/candle-transformers/src/models/segment_anything/tiny_vit.rs",
"repo_id": "candle",
"token_count": 10372
} | 62 |
use candle::{Device, Result, Tensor};
pub fn linspace(start: f64, stop: f64, steps: usize) -> Result<Tensor> {
if steps == 0 {
Tensor::from_vec(Vec::<f64>::new(), steps, &Device::Cpu)
} else if steps == 1 {
Tensor::from_vec(vec![start], steps, &Device::Cpu)
} else {
let delta = (sto... | candle/candle-transformers/src/models/stable_diffusion/utils.rs/0 | {
"file_path": "candle/candle-transformers/src/models/stable_diffusion/utils.rs",
"repo_id": "candle",
"token_count": 971
} | 63 |
//! Apply penalty and repeat_kv
use candle::{Result, Tensor};
pub fn apply_repeat_penalty(logits: &Tensor, penalty: f32, context: &[u32]) -> Result<Tensor> {
let device = logits.device();
let mut logits = logits.to_dtype(candle::DType::F32)?.to_vec1::<f32>()?;
let mut already_seen = std::collections::Hash... | candle/candle-transformers/src/utils.rs/0 | {
"file_path": "candle/candle-transformers/src/utils.rs",
"repo_id": "candle",
"token_count": 642
} | 64 |
use candle::{DType, Device, Tensor};
use candle_nn::VarBuilder;
use candle_transformers::generation::LogitsProcessor;
use candle_transformers::models::blip;
use candle_transformers::models::quantized_blip;
use candle_wasm_example_blip::console_log;
use candle_wasm_example_blip::token_output_stream::TokenOutputStream;
u... | candle/candle-wasm-examples/blip/src/bin/m.rs/0 | {
"file_path": "candle/candle-wasm-examples/blip/src/bin/m.rs",
"repo_id": "candle",
"token_count": 2698
} | 65 |
## Running Yolo Examples
Here, we provide two examples of how to run YOLOv8 using a Candle-compiled WASM binary and runtimes.
### Pure Rust UI
To build and test the UI made in Rust you will need [Trunk](https://trunkrs.dev/#install)
From the `candle-wasm-examples/yolo` directory run:
Download assets:
```bash
wget ... | candle/candle-wasm-examples/yolo/README.md/0 | {
"file_path": "candle/candle-wasm-examples/yolo/README.md",
"repo_id": "candle",
"token_count": 412
} | 66 |
#![allow(unused)]
use candle::{
quantized::{self, k_quants, GgmlDType, GgmlType},
test_utils::to_vec2_round,
Device, Module, Result, Tensor,
};
use wasm_bindgen_test::*;
wasm_bindgen_test_configure!(run_in_browser);
#[wasm_bindgen_test]
fn quantized_matmul_neg() -> Result<()> {
let cpu = &Device::Cpu;... | candle/candle-wasm-tests/tests/quantized_tests.rs/0 | {
"file_path": "candle/candle-wasm-tests/tests/quantized_tests.rs",
"repo_id": "candle",
"token_count": 3151
} | 67 |
image:
repository: huggingface
name: chat-ui
nodeSelector:
role-huggingchat: "true"
tolerations:
- key: "huggingface.co/huggingchat"
operator: "Equal"
value: "true"
effect: "NoSchedule"
serviceAccount:
enabled: true
create: true
name: huggingchat-prod
ingress:
path: "/chat"
annotations... | chat-ui/chart/env/prod.yaml/0 | {
"file_path": "chat-ui/chart/env/prod.yaml",
"repo_id": "chat-ui",
"token_count": 13215
} | 68 |
# Metrics
The server can expose prometheus metrics on port `5565` but is off by default. You may enable the metrics server with `METRICS_ENABLED=true` and change the port with `METRICS_PORT=1234`.
<Tip>
In development with `npm run dev`, the metrics server does not shutdown gracefully due to Sveltekit not providing ... | chat-ui/docs/source/configuration/metrics.md/0 | {
"file_path": "chat-ui/docs/source/configuration/metrics.md",
"repo_id": "chat-ui",
"token_count": 111
} | 69 |
# Theming
You can use a few environment variables to customize the look and feel of Chat UI. These are by default:
```ini
PUBLIC_APP_NAME=ChatUI
PUBLIC_APP_ASSETS=chatui
PUBLIC_APP_COLOR=blue
PUBLIC_APP_DESCRIPTION="Making the community's best AI chat models available to everyone."
PUBLIC_APP_DATA_SHARING=
PUBLIC_APP... | chat-ui/docs/source/configuration/theming.md/0 | {
"file_path": "chat-ui/docs/source/configuration/theming.md",
"repo_id": "chat-ui",
"token_count": 286
} | 70 |
<script lang="ts">
import CopyToClipBoardBtn from "./CopyToClipBoardBtn.svelte";
import DOMPurify from "isomorphic-dompurify";
interface Props {
code?: string;
rawCode?: string;
}
let { code = "", rawCode = "" }: Props = $props();
</script>
<div class="group relative my-4 rounded-lg">
<pre
class="scrollb... | chat-ui/src/lib/components/CodeBlock.svelte/0 | {
"file_path": "chat-ui/src/lib/components/CodeBlock.svelte",
"repo_id": "chat-ui",
"token_count": 350
} | 71 |
<script lang="ts">
import CarbonCaretLeft from "~icons/carbon/caret-left";
import CarbonCaretRight from "~icons/carbon/caret-right";
interface Props {
href: string;
direction: "next" | "previous";
isDisabled?: boolean;
}
let { href, direction, isDisabled = false }: Props = $props();
</script>
<a
class="f... | chat-ui/src/lib/components/PaginationArrow.svelte/0 | {
"file_path": "chat-ui/src/lib/components/PaginationArrow.svelte",
"repo_id": "chat-ui",
"token_count": 254
} | 72 |
<script lang="ts">
import type { Message } from "$lib/types/Message";
import CarbonTrashCan from "~icons/carbon/trash-can";
import CarbonChevronLeft from "~icons/carbon/chevron-left";
import CarbonChevronRight from "~icons/carbon/chevron-right";
import { createEventDispatcher } from "svelte";
import { page } fro... | chat-ui/src/lib/components/chat/Alternatives.svelte/0 | {
"file_path": "chat-ui/src/lib/components/chat/Alternatives.svelte",
"repo_id": "chat-ui",
"token_count": 1033
} | 73 |
<script lang="ts">
interface Props {
classNames?: string;
}
let { classNames = "" }: Props = $props();
</script>
<svg
class={classNames}
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
fill="currentColor"
focusable="false"
role="img"
width="1em"
height="1em"
preserveAspectRatio="xMidYMid meet"
vi... | chat-ui/src/lib/components/icons/IconCopy.svelte/0 | {
"file_path": "chat-ui/src/lib/components/icons/IconCopy.svelte",
"repo_id": "chat-ui",
"token_count": 324
} | 74 |
import { collections } from "$lib/server/database";
import { ObjectId } from "mongodb";
import type { Semaphores } from "$lib/types/Semaphore";
/**
* Returns the lock id if the lock was acquired, false otherwise
*/
export async function acquireLock(key: Semaphores): Promise<ObjectId | false> {
try {
const id = ne... | chat-ui/src/lib/migrations/lock.ts/0 | {
"file_path": "chat-ui/src/lib/migrations/lock.ts",
"repo_id": "chat-ui",
"token_count": 475
} | 75 |
import { config } from "$lib/server/config";
import type { Session } from "$lib/types/Session";
import { logger } from "./logger";
import { v4 } from "uuid";
class AdminTokenManager {
private token = config.ADMIN_TOKEN || v4();
// contains all session ids that are currently admin sessions
private adminSessions: Arr... | chat-ui/src/lib/server/adminToken.ts/0 | {
"file_path": "chat-ui/src/lib/server/adminToken.ts",
"repo_id": "chat-ui",
"token_count": 625
} | 76 |
import { z } from "zod";
import type { EmbeddingEndpoint } from "../embeddingEndpoints";
import type { Tensor, FeatureExtractionPipeline } from "@huggingface/transformers";
import { pipeline } from "@huggingface/transformers";
export const embeddingEndpointTransformersJSParametersSchema = z.object({
weight: z.number(... | chat-ui/src/lib/server/embeddingEndpoints/transformersjs/embeddingEndpoints.ts/0 | {
"file_path": "chat-ui/src/lib/server/embeddingEndpoints/transformersjs/embeddingEndpoints.ts",
"repo_id": "chat-ui",
"token_count": 542
} | 77 |
import { config } from "$lib/server/config";
import { buildPrompt } from "$lib/buildPrompt";
import type { TextGenerationStreamOutput } from "@huggingface/inference";
import type { Endpoint } from "../endpoints";
import { z } from "zod";
import { logger } from "$lib/server/logger";
export const endpointLlamacppParamet... | chat-ui/src/lib/server/endpoints/llamacpp/endpointLlamacpp.ts/0 | {
"file_path": "chat-ui/src/lib/server/endpoints/llamacpp/endpointLlamacpp.ts",
"repo_id": "chat-ui",
"token_count": 1446
} | 78 |
import { generateFromDefaultEndpoint } from "../generateFromDefaultEndpoint";
import { taskModel } from "../models";
import { getReturnFromGenerator } from "$lib/utils/getReturnFromGenerator";
import { getToolOutput } from "../tools/getToolOutput";
import type { Tool } from "$lib/types/Tool";
import { logger } from "..... | chat-ui/src/lib/server/textGeneration/reasoning.ts/0 | {
"file_path": "chat-ui/src/lib/server/textGeneration/reasoning.ts",
"repo_id": "chat-ui",
"token_count": 781
} | 79 |
import { collapseString, sanitizeString } from "./utils/nlp";
import { stringifyHTMLElements, stringifyHTMLElementsUnformatted } from "./utils/stringify";
import { MarkdownElementType, tagNameMap, type HeaderElement, type MarkdownElement } from "./types";
import type { SerializedHTMLElement } from "../scrape/types";
i... | chat-ui/src/lib/server/websearch/markdown/fromHtml.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/markdown/fromHtml.ts",
"repo_id": "chat-ui",
"token_count": 1033
} | 80 |
import { config } from "$lib/server/config";
import { isURL } from "$lib/utils/isUrl";
import type { WebSearchSource } from "$lib/types/WebSearch";
type SerpStackResponse = {
organic_results: {
title: string;
url: string;
snippet?: string;
}[];
error?: string;
};
export default async function searchSerpStack... | chat-ui/src/lib/server/websearch/search/endpoints/serpStack.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/search/endpoints/serpStack.ts",
"repo_id": "chat-ui",
"token_count": 343
} | 81 |
// Ideally shouldn't be needed, see https://github.com/huggingface/chat-ui/pull/88#issuecomment-1523173850
import type { Conversation } from "./Conversation";
import type { Timestamps } from "./Timestamps";
export interface AbortedGeneration extends Timestamps {
conversationId: Conversation["_id"];
}
| chat-ui/src/lib/types/AbortedGeneration.ts/0 | {
"file_path": "chat-ui/src/lib/types/AbortedGeneration.ts",
"repo_id": "chat-ui",
"token_count": 93
} | 82 |
import { defaultModel } from "$lib/server/models";
import type { Assistant } from "./Assistant";
import type { Timestamps } from "./Timestamps";
import type { User } from "./User";
export interface Settings extends Timestamps {
userId?: User["_id"];
sessionId?: string;
/**
* Note: Only conversations with this se... | chat-ui/src/lib/types/Settings.ts/0 | {
"file_path": "chat-ui/src/lib/types/Settings.ts",
"repo_id": "chat-ui",
"token_count": 369
} | 83 |
export function formatUserCount(userCount: number): string {
const userCountRanges: { min: number; max: number; label: string }[] = [
{ min: 0, max: 1, label: "1" },
{ min: 2, max: 9, label: "1-10" },
{ min: 10, max: 49, label: "10+" },
{ min: 50, max: 99, label: "50+" },
{ min: 100, max: 299, label: "100+" ... | chat-ui/src/lib/utils/formatUserCount.ts/0 | {
"file_path": "chat-ui/src/lib/utils/formatUserCount.ts",
"repo_id": "chat-ui",
"token_count": 767
} | 84 |
export async function sha256(input: string): Promise<string> {
const utf8 = new TextEncoder().encode(input);
const hashBuffer = await crypto.subtle.digest("SHA-256", utf8);
const hashArray = Array.from(new Uint8Array(hashBuffer));
const hashHex = hashArray.map((bytes) => bytes.toString(16).padStart(2, "0")).join(""... | chat-ui/src/lib/utils/sha256.ts/0 | {
"file_path": "chat-ui/src/lib/utils/sha256.ts",
"repo_id": "chat-ui",
"token_count": 119
} | 85 |
import type { Conversation } from "$lib/types/Conversation";
import type { Message } from "$lib/types/Message";
import { v4 } from "uuid";
export function convertLegacyConversation(
conv: Pick<Conversation, "messages" | "rootMessageId" | "preprompt">
): Pick<Conversation, "messages" | "rootMessageId" | "preprompt"> {... | chat-ui/src/lib/utils/tree/convertLegacyConversation.ts/0 | {
"file_path": "chat-ui/src/lib/utils/tree/convertLegacyConversation.ts",
"repo_id": "chat-ui",
"token_count": 354
} | 86 |
import { collections } from "$lib/server/database";
import { error } from "@sveltejs/kit";
import { ObjectId } from "mongodb";
import { base } from "$app/paths";
import { config } from "$lib/server/config";
import { ReviewStatus } from "$lib/types/Review";
import { sendSlack } from "$lib/server/sendSlack";
import { z }... | chat-ui/src/routes/api/assistant/[id]/review/+server.ts/0 | {
"file_path": "chat-ui/src/routes/api/assistant/[id]/review/+server.ts",
"repo_id": "chat-ui",
"token_count": 708
} | 87 |
import { app } from "$api";
type RequestHandler = (v: { request: Request; locals: App.Locals }) => Response | Promise<Response>;
export const GET: RequestHandler = ({ request }) => app.handle(request);
export const POST: RequestHandler = ({ request }) => app.handle(request);
export const PUT: RequestHandler = ({ requ... | chat-ui/src/routes/api/v2/[...slugs]/+server.ts/0 | {
"file_path": "chat-ui/src/routes/api/v2/[...slugs]/+server.ts",
"repo_id": "chat-ui",
"token_count": 133
} | 88 |
export async function GET() {
return new Response("OK", { status: 200 });
}
| chat-ui/src/routes/healthcheck/+server.ts/0 | {
"file_path": "chat-ui/src/routes/healthcheck/+server.ts",
"repo_id": "chat-ui",
"token_count": 22
} | 89 |
import { collections } from "$lib/server/database";
import { z } from "zod";
import { authCondition } from "$lib/server/auth";
import { DEFAULT_SETTINGS, type SettingsEditable } from "$lib/types/Settings";
import { toolFromConfigs } from "$lib/server/tools/index.js";
import { ObjectId } from "mongodb";
export async fu... | chat-ui/src/routes/settings/(nav)/+server.ts/0 | {
"file_path": "chat-ui/src/routes/settings/(nav)/+server.ts",
"repo_id": "chat-ui",
"token_count": 695
} | 90 |
<script lang="ts">
interface Props {
type: string;
value: string | boolean | number;
disabled?: boolean;
}
let { type, value = $bindable(), disabled = false }: Props = $props();
let innerValue: string | boolean | number = $state(
(() => {
if (type === "bool") {
return Boolean(value) || false;
} ... | chat-ui/src/routes/tools/ToolInputComponent.svelte/0 | {
"file_path": "chat-ui/src/routes/tools/ToolInputComponent.svelte",
"repo_id": "chat-ui",
"token_count": 1186
} | 91 |
.PHONY: quality style test
check_dirs := tests src benchmarks utils
# Check that source code meets quality standards
quality:
ruff check $(check_dirs) setup.py # linter
ruff format --check $(check_dirs) setup.py # formatter
# Format source code automatically
style:
ruff check --fix $(check_dirs) setup.py # lin... | datasets/Makefile/0 | {
"file_path": "datasets/Makefile",
"repo_id": "datasets",
"token_count": 148
} | 92 |
# Create a dataset
Sometimes, you may need to create a dataset if you're working with your own data. Creating a dataset with 🤗 Datasets confers all the advantages of the library to your dataset: fast loading and processing, [stream enormous datasets](stream), [memory-mapping](https://huggingface.co/course/chapter5/4?... | datasets/docs/source/create_dataset.mdx/0 | {
"file_path": "datasets/docs/source/create_dataset.mdx",
"repo_id": "datasets",
"token_count": 1994
} | 93 |
# Load a dataset from the Hub
Finding high-quality datasets that are reproducible and accessible can be difficult. One of 🤗 Datasets main goals is to provide a simple way to load a dataset of any format or type. The easiest way to get started is to discover an existing dataset on the [Hugging Face Hub](https://huggin... | datasets/docs/source/load_hub.mdx/0 | {
"file_path": "datasets/docs/source/load_hub.mdx",
"repo_id": "datasets",
"token_count": 1342
} | 94 |
# Load tabular data
A tabular dataset is a generic dataset used to describe any data stored in rows and columns, where the rows represent an example and the columns represent a feature (can be continuous or categorical). These datasets are commonly stored in CSV files, Pandas DataFrames, and in database tables. This g... | datasets/docs/source/tabular_load.mdx/0 | {
"file_path": "datasets/docs/source/tabular_load.mdx",
"repo_id": "datasets",
"token_count": 1868
} | 95 |
[tool.ruff]
line-length = 119
[tool.ruff.lint]
# Ignored rules:
# "E501" -> line length violation
# "F821" -> undefined named in type annotation (e.g. Literal["something"])
# "C901" -> `function_name` is too complex
ignore = ["E501", "F821", "C901"]
select = ["C", "E", "F", "I", "W"]
[tool.ruff.lint.isort]
line... | datasets/pyproject.toml/0 | {
"file_path": "datasets/pyproject.toml",
"repo_id": "datasets",
"token_count": 274
} | 96 |
from typing import TypeVar
from .arrow_dataset import Dataset, _split_by_node_map_style_dataset
from .iterable_dataset import IterableDataset, _split_by_node_iterable_dataset
DatasetType = TypeVar("DatasetType", Dataset, IterableDataset)
def split_dataset_by_node(dataset: DatasetType, rank: int, world_size: int) -... | datasets/src/datasets/distributed.py/0 | {
"file_path": "datasets/src/datasets/distributed.py",
"repo_id": "datasets",
"token_count": 582
} | 97 |
import inspect
import os
import random
import shutil
import tempfile
import weakref
from functools import wraps
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Optional, Union
import numpy as np
import xxhash
from . import config
from .naming import INVALID_WINDOWS_CHARACTERS_IN_PATH
from .u... | datasets/src/datasets/fingerprint.py/0 | {
"file_path": "datasets/src/datasets/fingerprint.py",
"repo_id": "datasets",
"token_count": 7513
} | 98 |
import os
from typing import BinaryIO, Optional, Union
import fsspec
import pyarrow.parquet as pq
from .. import Dataset, Features, NamedSplit, config
from ..arrow_writer import get_writer_batch_size
from ..formatting import query_table
from ..packaged_modules import _PACKAGED_DATASETS_MODULES
from ..packaged_modules... | datasets/src/datasets/io/parquet.py/0 | {
"file_path": "datasets/src/datasets/io/parquet.py",
"repo_id": "datasets",
"token_count": 2023
} | 99 |
import itertools
from dataclasses import dataclass
from typing import Any, Callable, Optional, Union
import pandas as pd
import pyarrow as pa
import datasets
import datasets.config
from datasets.features.features import require_storage_cast
from datasets.table import table_cast
from datasets.utils.py_utils import Lit... | datasets/src/datasets/packaged_modules/csv/csv.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/csv/csv.py",
"repo_id": "datasets",
"token_count": 3883
} | 100 |
import datasets
from ..folder_based_builder import folder_based_builder
logger = datasets.utils.logging.get_logger(__name__)
class PdfFolderConfig(folder_based_builder.FolderBasedBuilderConfig):
"""BuilderConfig for ImageFolder."""
drop_labels: bool = None
drop_metadata: bool = None
def __post_in... | datasets/src/datasets/packaged_modules/pdffolder/pdffolder.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/pdffolder/pdffolder.py",
"repo_id": "datasets",
"token_count": 201
} | 101 |
import importlib.util
import os
import tempfile
from pathlib import PurePath
from typing import TYPE_CHECKING, NamedTuple, Optional, Union
import fsspec
import numpy as np
from .features import List
from .utils import logging
from .utils import tqdm as hf_tqdm
if TYPE_CHECKING:
from .arrow_dataset import Datase... | datasets/src/datasets/search.py/0 | {
"file_path": "datasets/src/datasets/search.py",
"repo_id": "datasets",
"token_count": 15323
} | 102 |
# Copyright 2020 Optuna, Hugging Face
#
# 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 in ... | datasets/src/datasets/utils/logging.py/0 | {
"file_path": "datasets/src/datasets/utils/logging.py",
"repo_id": "datasets",
"token_count": 1914
} | 103 |
# Copyright 2020 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/version.py/0 | {
"file_path": "datasets/src/datasets/utils/version.py",
"repo_id": "datasets",
"token_count": 1291
} | 104 |
import pytest
from datasets.builder import InvalidConfigName
from datasets.data_files import DataFilesList
from datasets.packaged_modules.pandas.pandas import PandasConfig
def test_config_raises_when_invalid_name() -> None:
with pytest.raises(InvalidConfigName, match="Bad characters"):
_ = PandasConfig(n... | datasets/tests/packaged_modules/test_pandas.py/0 | {
"file_path": "datasets/tests/packaged_modules/test_pandas.py",
"repo_id": "datasets",
"token_count": 229
} | 105 |
import unittest
import warnings
from datasets.utils import experimental
@experimental
def dummy_function():
return "success"
class TestExperimentalFlag(unittest.TestCase):
def test_experimental_warning(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always"... | datasets/tests/test_experimental.py/0 | {
"file_path": "datasets/tests/test_experimental.py",
"repo_id": "datasets",
"token_count": 152
} | 106 |
from datasets.utils.patching import _PatchedModuleObj, patch_submodule
from . import _test_patching
def test_patch_submodule():
import os as original_os
from os import path as original_path
from os import rename as original_rename
from os.path import dirname as original_dirname
from os.path impor... | datasets/tests/test_patching.py/0 | {
"file_path": "datasets/tests/test_patching.py",
"repo_id": "datasets",
"token_count": 2274
} | 107 |
# Components and configs
## ComponentSpec
[[autodoc]] diffusers.modular_pipelines.modular_pipeline.ComponentSpec
## ConfigSpec
[[autodoc]] diffusers.modular_pipelines.modular_pipeline.ConfigSpec
## ComponentsManager
[[autodoc]] diffusers.modular_pipelines.components_manager.ComponentsManager
## InsertableDict
[... | diffusers/docs/source/en/api/modular_diffusers/pipeline_components.md/0 | {
"file_path": "diffusers/docs/source/en/api/modular_diffusers/pipeline_components.md",
"repo_id": "diffusers",
"token_count": 134
} | 108 |
<!--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/pipelines/ddim.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/ddim.md",
"repo_id": "diffusers",
"token_count": 477
} | 109 |
<!--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/pipelines/pix2pix.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/pix2pix.md",
"repo_id": "diffusers",
"token_count": 759
} | 110 |
<!--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/pipelines/text_to_video_zero.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/text_to_video_zero.md",
"repo_id": "diffusers",
"token_count": 4608
} | 111 |
<!--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/pipeline_block.md/0 | {
"file_path": "diffusers/docs/source/en/modular_diffusers/pipeline_block.md",
"repo_id": "diffusers",
"token_count": 1578
} | 112 |
# T-GATE
[T-GATE](https://github.com/HaozheLiu-ST/T-GATE/tree/main) accelerates inference for [Stable Diffusion](../api/pipelines/stable_diffusion/overview), [PixArt](../api/pipelines/pixart), and [Latency Consistency Model](../api/pipelines/latent_consistency_models.md) pipelines by skipping the cross-attention calcu... | diffusers/docs/source/en/optimization/tgate.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/tgate.md",
"repo_id": "diffusers",
"token_count": 2963
} | 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/training/ddpo.md/0 | {
"file_path": "diffusers/docs/source/en/training/ddpo.md",
"repo_id": "diffusers",
"token_count": 322
} | 114 |
<!--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/tutorials/using_peft_for_inference.md/0 | {
"file_path": "diffusers/docs/source/en/tutorials/using_peft_for_inference.md",
"repo_id": "diffusers",
"token_count": 9243
} | 115 |
<!--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/inpaint.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/inpaint.md",
"repo_id": "diffusers",
"token_count": 14185
} | 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... | diffusers/docs/source/en/using-diffusers/svd.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/svd.md",
"repo_id": "diffusers",
"token_count": 1829
} | 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/ko/conceptual/contribution.md/0 | {
"file_path": "diffusers/docs/source/ko/conceptual/contribution.md",
"repo_id": "diffusers",
"token_count": 35978
} | 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/ko/quicktour.md/0 | {
"file_path": "diffusers/docs/source/ko/quicktour.md",
"repo_id": "diffusers",
"token_count": 11452
} | 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/ko/using-diffusers/conditional_image_generation.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/conditional_image_generation.md",
"repo_id": "diffusers",
"token_count": 1550
} | 120 |
<!--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/ko/using-diffusers/svd.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/svd.md",
"repo_id": "diffusers",
"token_count": 3466
} | 121 |
<!--版权 2025 HuggingFace 团队。保留所有权利。
根据 Apache 许可证 2.0 版本("许可证")授权;除非遵守许可证,否则不得使用此文件。
您可以在以下网址获取许可证副本:
http://www.apache.org/licenses/LICENSE-2.0
除非适用法律要求或书面同意,否则根据许可证分发的软件按"原样"分发,不附带任何明示或暗示的担保或条件。请参阅许可证以了解具体的语言管理权限和限制。
-->
# 混合推理
**通过混合推理赋能本地 AI 构建者**
> [!TIP]
> 混合推理是一项[实验性功能](https://huggingface.co/blog/remote_va... | diffusers/docs/source/zh/hybrid_inference/overview.md/0 | {
"file_path": "diffusers/docs/source/zh/hybrid_inference/overview.md",
"repo_id": "diffusers",
"token_count": 1485
} | 122 |
<!--版权所有 2025 The HuggingFace Team。保留所有权利。
根据 Apache 许可证 2.0 版本("许可证")授权;除非遵守许可证,否则不得使用此文件。您可以在以下网址获取许可证副本:
http://www.apache.org/licenses/LICENSE-2.0
除非适用法律要求或书面同意,否则根据许可证分发的软件按"原样"分发,无任何明示或暗示的担保或条件。有关许可证的具体语言,请参阅许可证中的权限和限制。
-->
# DeepCache
[DeepCache](https://huggingface.co/papers/2312.00858) 通过策略性地缓存和重用高级特征,同时利用... | diffusers/docs/source/zh/optimization/deepcache.md/0 | {
"file_path": "diffusers/docs/source/zh/optimization/deepcache.md",
"repo_id": "diffusers",
"token_count": 2598
} | 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/zh/stable_diffusion.md/0 | {
"file_path": "diffusers/docs/source/zh/stable_diffusion.md",
"repo_id": "diffusers",
"token_count": 6142
} | 124 |
# Advanced diffusion training examples
## Train Dreambooth LoRA with Flux.1 Dev
> [!TIP]
> 💡 This example follows some of the techniques and recommended practices covered in the community derived guide we made for SDXL training: [LoRA training scripts of the world, unite!](https://huggingface.co/blog/sdxl_lora_advanc... | diffusers/examples/advanced_diffusion_training/README_flux.md/0 | {
"file_path": "diffusers/examples/advanced_diffusion_training/README_flux.md",
"repo_id": "diffusers",
"token_count": 6906
} | 125 |
from typing import List, Optional, Tuple, Union
import torch
from diffusers import DiffusionPipeline
from diffusers.configuration_utils import ConfigMixin
from diffusers.pipelines.pipeline_utils import ImagePipelineOutput
from diffusers.schedulers.scheduling_utils import SchedulerMixin
class IADBScheduler(Scheduler... | diffusers/examples/community/iadb.py/0 | {
"file_path": "diffusers/examples/community/iadb.py",
"repo_id": "diffusers",
"token_count": 2501
} | 126 |
# Copyright 2025 FABRIC 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 re... | diffusers/examples/community/pipeline_fabric.py/0 | {
"file_path": "diffusers/examples/community/pipeline_fabric.py",
"repo_id": "diffusers",
"token_count": 16558
} | 127 |
# A diffuser version implementation of Zero1to3 (https://github.com/cvlab-columbia/zero123), ICCV 2023
# by Xin Kong
import inspect
from typing import Any, Callable, Dict, List, Optional, Union
import kornia
import numpy as np
import PIL.Image
import torch
from packaging import version
from transformers import CLIPIm... | diffusers/examples/community/pipeline_zero1to3.py/0 | {
"file_path": "diffusers/examples/community/pipeline_zero1to3.py",
"repo_id": "diffusers",
"token_count": 17992
} | 128 |
from typing import Any, Callable, Dict, List, Optional, Union
import PIL.Image
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers import (
AutoencoderKL,
DDIMScheduler,
DiffusionPipeline,
LMSDiscreteScheduler,
PNDMScheduler,
StableDiffusionImg... | diffusers/examples/community/stable_diffusion_mega.py/0 | {
"file_path": "diffusers/examples/community/stable_diffusion_mega.py",
"repo_id": "diffusers",
"token_count": 3877
} | 129 |
# Copyright 2025 The HuggingFace Team. All rights reserved.
# Copyright (c) Alibaba, Inc. and its affiliates.
#
# 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/lic... | diffusers/examples/research_projects/anytext/anytext.py/0 | {
"file_path": "diffusers/examples/research_projects/anytext/anytext.py",
"repo_id": "diffusers",
"token_count": 50998
} | 130 |
# Consistency Training
`train_cm_ct_unconditional.py` trains a consistency model (CM) from scratch following the consistency training (CT) algorithm introduced in [Consistency Models](https://huggingface.co/papers/2303.01469) and refined in [Improved Techniques for Training Consistency Models](https://huggingface.co/p... | diffusers/examples/research_projects/consistency_training/README.md/0 | {
"file_path": "diffusers/examples/research_projects/consistency_training/README.md",
"repo_id": "diffusers",
"token_count": 415
} | 131 |
## LoRA fine-tuning Flux.1 Dev with quantization
> [!NOTE]
> This example is educational in nature and fixes some arguments to keep things simple. It should act as a reference to build things further.
This example shows how to fine-tune [Flux.1 Dev](https://huggingface.co/black-forest-labs/FLUX.1-dev) with LoRA and... | diffusers/examples/research_projects/flux_lora_quantization/README.md/0 | {
"file_path": "diffusers/examples/research_projects/flux_lora_quantization/README.md",
"repo_id": "diffusers",
"token_count": 2092
} | 132 |
## Diffusers examples with Intel optimizations
**This research project is not actively maintained by the diffusers team. For any questions or comments, please make sure to tag @hshen14 .**
This aims to provide diffusers examples with Intel optimizations such as Bfloat16 for training/fine-tuning acceleration and 8-bit... | diffusers/examples/research_projects/intel_opts/README.md/0 | {
"file_path": "diffusers/examples/research_projects/intel_opts/README.md",
"repo_id": "diffusers",
"token_count": 524
} | 133 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2025 Sana-Sprint team. All rights reserved.
# 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 ... | diffusers/examples/research_projects/sana/train_sana_sprint_diffusers.py/0 | {
"file_path": "diffusers/examples/research_projects/sana/train_sana_sprint_diffusers.py",
"repo_id": "diffusers",
"token_count": 33634
} | 134 |
import time
import jax
import jax.numpy as jnp
import numpy as np
from flax.jax_utils import replicate
from jax import pmap
# Let's cache the model compilation, so that it doesn't take as long the next time around.
from jax.experimental.compilation_cache import compilation_cache as cc
from diffusers import FlaxStabl... | diffusers/examples/research_projects/sdxl_flax/sdxl_single_aot.py/0 | {
"file_path": "diffusers/examples/research_projects/sdxl_flax/sdxl_single_aot.py",
"repo_id": "diffusers",
"token_count": 1963
} | 135 |
# 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/t2i_adapter/test_t2i_adapter.py/0 | {
"file_path": "diffusers/examples/t2i_adapter/test_t2i_adapter.py",
"repo_id": "diffusers",
"token_count": 682
} | 136 |
## Textual Inversion fine-tuning example for SDXL
```sh
export MODEL_NAME="stabilityai/stable-diffusion-xl-base-1.0"
export DATA_DIR="./cat"
accelerate launch textual_inversion_sdxl.py \
--pretrained_model_name_or_path=$MODEL_NAME \
--train_data_dir=$DATA_DIR \
--learnable_property="object" \
--placeholder_to... | diffusers/examples/textual_inversion/README_sdxl.md/0 | {
"file_path": "diffusers/examples/textual_inversion/README_sdxl.md",
"repo_id": "diffusers",
"token_count": 537
} | 137 |
# coding=utf-8
# Copyright 2023 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/vqgan/train_vqgan.py/0 | {
"file_path": "diffusers/examples/vqgan/train_vqgan.py",
"repo_id": "diffusers",
"token_count": 19252
} | 138 |
import math
import os
import urllib
import warnings
from argparse import ArgumentParser
import torch
import torch.nn as nn
import torch.nn.functional as F
from huggingface_hub.utils import insecure_hashlib
from safetensors.torch import load_file as stl
from tqdm import tqdm
from diffusers import AutoencoderKL, Consis... | diffusers/scripts/convert_consistency_decoder.py/0 | {
"file_path": "diffusers/scripts/convert_consistency_decoder.py",
"repo_id": "diffusers",
"token_count": 21910
} | 139 |
# 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_original_audioldm2_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_original_audioldm2_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 21165
} | 140 |
import random
import torch
from huggingface_hub import HfApi
from diffusers import UNet2DModel
api = HfApi()
results = {}
# fmt: off
results["google_ddpm_cifar10_32"] = torch.tensor([
-0.7515, -1.6883, 0.2420, 0.0300, 0.6347, 1.3433, -1.1743, -3.7467,
1.2342, -2.2485, 0.4636, 0.8076, -0.7991, 0.3969, 0.849... | diffusers/scripts/generate_logits.py/0 | {
"file_path": "diffusers/scripts/generate_logits.py",
"repo_id": "diffusers",
"token_count": 3530
} | 141 |
# 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/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/guiders/__init__.py",
"repo_id": "diffusers",
"token_count": 543
} | 142 |
# 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/group_offloading.py/0 | {
"file_path": "diffusers/src/diffusers/hooks/group_offloading.py",
"repo_id": "diffusers",
"token_count": 16728
} | 143 |
# 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/src/diffusers/loaders/single_file_utils.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/single_file_utils.py",
"repo_id": "diffusers",
"token_count": 76480
} | 144 |
from .autoencoder_asym_kl import AsymmetricAutoencoderKL
from .autoencoder_dc import AutoencoderDC
from .autoencoder_kl import AutoencoderKL
from .autoencoder_kl_allegro import AutoencoderKLAllegro
from .autoencoder_kl_cogvideox import AutoencoderKLCogVideoX
from .autoencoder_kl_cosmos import AutoencoderKLCosmos
from .... | diffusers/src/diffusers/models/autoencoders/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/models/autoencoders/__init__.py",
"repo_id": "diffusers",
"token_count": 347
} | 145 |
# 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/consistency_decoder_vae.py/0 | {
"file_path": "diffusers/src/diffusers/models/autoencoders/consistency_decoder_vae.py",
"repo_id": "diffusers",
"token_count": 8609
} | 146 |
# 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/controlnets/controlnet_sparsectrl.py/0 | {
"file_path": "diffusers/src/diffusers/models/controlnets/controlnet_sparsectrl.py",
"repo_id": "diffusers",
"token_count": 16706
} | 147 |
# Copyright 2025 The HuggingFace Team. All rights reserved.
# `TemporalConvLayer` Copyright 2025 Alibaba DAMO-VILAB, The ModelScope 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.
#... | diffusers/src/diffusers/models/resnet.py/0 | {
"file_path": "diffusers/src/diffusers/models/resnet.py",
"repo_id": "diffusers",
"token_count": 14445
} | 148 |
# 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/transformers/transformer_2d.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/transformer_2d.py",
"repo_id": "diffusers",
"token_count": 12697
} | 149 |
# Copyright 2025 Qwen-Image Team, 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 requ... | diffusers/src/diffusers/models/transformers/transformer_qwenimage.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/transformer_qwenimage.py",
"repo_id": "diffusers",
"token_count": 12660
} | 150 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.