text stringlengths 5 409k | id stringlengths 14 178 | metadata dict | __index_level_0__ int64 0 572 |
|---|---|---|---|
pub const LAYERNORM_KERNELS: &str = include_str!(concat!(env!("OUT_DIR"), "/layernorm_kernels.ptx"));
| candle/candle-examples/examples/custom-ops/cuda_kernels.rs/0 | {
"file_path": "candle/candle-examples/examples/custom-ops/cuda_kernels.rs",
"repo_id": "candle",
"token_count": 44
} | 27 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use candle_transformers::models::distilbert::{Config, DistilBertModel, DTYPE};
use anyhow::{Error as E, Result};
use candle::{Device, Tensor};
use candle_nn::VarBuilder;
use clap::Parser;
use hf_hub::{api::... | candle/candle-examples/examples/distilbert/main.rs/0 | {
"file_path": "candle/candle-examples/examples/distilbert/main.rs",
"repo_id": "candle",
"token_count": 1939
} | 28 |
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
use candle_transformers::models::{clip, flux, t5};
use anyhow::{Error as E, Result};
use candle::{IndexOp, Module, Tensor};
use candle_nn::VarBuilder;
use clap::Parser;
use tokenizers::Tokenizer;
#[derive... | candle/candle-examples/examples/flux/main.rs/0 | {
"file_path": "candle/candle-examples/examples/flux/main.rs",
"repo_id": "candle",
"token_count": 5445
} | 29 |
// An implementation of LLaMA https://github.com/facebookresearch/llama
//
// This is based on nanoGPT in a similar way to:
// https://github.com/Lightning-AI/lit-llama/blob/main/lit_llama/model.py
//
// The tokenizer config can be retrieved from:
// https://huggingface.co/hf-internal-testing/llama-tokenizer/raw/main/t... | candle/candle-examples/examples/llama/main.rs/0 | {
"file_path": "candle/candle-examples/examples/llama/main.rs",
"repo_id": "candle",
"token_count": 4888
} | 30 |
# candle-mobileone
[MobileOne: An Improved One millisecond Mobile Backbone](https://arxiv.org/abs/2206.04040).
This candle implementation uses a pre-trained MobileOne network for inference. The
classification head has been trained on the ImageNet dataset and returns the
probabilities for the top-5 classes.
## Runnin... | candle/candle-examples/examples/mobileone/README.md/0 | {
"file_path": "candle/candle-examples/examples/mobileone/README.md",
"repo_id": "candle",
"token_count": 254
} | 31 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use anyhow::{Error as E, Result};
use clap::Parser;
use candle_transformers::models::paligemma::{Config, Model};
use candle::{DType, Device, Tensor};
use candle_examples::token_output_stream::TokenOutputS... | candle/candle-examples/examples/paligemma/main.rs/0 | {
"file_path": "candle/candle-examples/examples/paligemma/main.rs",
"repo_id": "candle",
"token_count": 3973
} | 32 |
# candle-qwen: large language model series from Alibaba Cloud
Qwen 1.5 is a series of large language models that provide strong performances
on English and Chinese.
- [Blog post](https://qwenlm.github.io/blog/qwen1.5/) introducing Qwen1.5.
- [Model card](https://huggingface.co/Qwen/Qwen1.5-0.5B) on the HuggingFace Hu... | candle/candle-examples/examples/qwen/README.md/0 | {
"file_path": "candle/candle-examples/examples/qwen/README.md",
"repo_id": "candle",
"token_count": 327
} | 33 |
# candle-resnet
A candle implementation of inference using a pre-trained [ResNet](https://arxiv.org/abs/1512.03385).
This uses a classification head trained on the ImageNet dataset and returns the
probabilities for the top-5 classes.
## Running an example
```
$ cargo run --example resnet --release -- --image tiger.j... | candle/candle-examples/examples/resnet/README.md/0 | {
"file_path": "candle/candle-examples/examples/resnet/README.md",
"repo_id": "candle",
"token_count": 204
} | 34 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use anyhow::Result;
use clap::Parser;
use candle::{DType, Tensor};
#[derive(Clone, Debug, Copy, PartialEq, Eq, clap::ValueEnum)]
enum Which {
#[value(name = "silero")]
Silero,
}
#[derive(Clone, D... | candle/candle-examples/examples/silero-vad/main.rs/0 | {
"file_path": "candle/candle-examples/examples/silero-vad/main.rs",
"repo_id": "candle",
"token_count": 2894
} | 35 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use std::path::Path;
use anyhow::{anyhow, Error as E, Result};
use clap::Parser;
use candle_transformers::models::stella_en_v5::{
Config, EmbedDim as StellaEmbedDim, EmbeddingModel,
};
use candle::{D... | candle/candle-examples/examples/stella-en-v5/main.rs/0 | {
"file_path": "candle/candle-examples/examples/stella-en-v5/main.rs",
"repo_id": "candle",
"token_count": 6512
} | 36 |
// https://github.com/openai/whisper/blob/main/whisper/model.py/rgs
// TODO:
// - Batch size greater than 1.
// - More token filters (SuppressBlanks, ApplyTimestampRules).
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
use anyhow::{Error as E, Result};... | candle/candle-examples/examples/whisper/main.rs/0 | {
"file_path": "candle/candle-examples/examples/whisper/main.rs",
"repo_id": "candle",
"token_count": 10862
} | 37 |
// Build script to run nvcc and generate the C glue code for launching the flash-attention kernel.
// The cuda build time is very long so one can set the CANDLE_FLASH_ATTN_BUILD_DIR environment
// variable in order to cache the compiled artifacts and avoid recompiling too often.
use anyhow::{Context, Result};
use std::... | candle/candle-flash-attn/build.rs/0 | {
"file_path": "candle/candle-flash-attn/build.rs",
"repo_id": "candle",
"token_count": 2163
} | 38 |
// Copyright (c) 2024, Tri Dao.
// Splitting the different head dimensions to different files to speed up compilation.
// This file is auto-generated. See "generate_kernels.py"
#include "flash_fwd_launch_template.h"
template<>
void run_mha_fwd_<cutlass::bfloat16_t, 192, false>(Flash_fwd_params ¶ms, cudaStream_t s... | candle/candle-flash-attn/kernels/flash_fwd_hdim192_bf16_sm80.cu/0 | {
"file_path": "candle/candle-flash-attn/kernels/flash_fwd_hdim192_bf16_sm80.cu",
"repo_id": "candle",
"token_count": 142
} | 39 |
/******************************************************************************
* Copyright (c) 2024, Tri Dao.
******************************************************************************/
#pragma once
#include <cute/tensor.hpp>
#include "utils.h"
////////////////////////////////////////////////////////////////... | candle/candle-flash-attn/kernels/rotary.h/0 | {
"file_path": "candle/candle-flash-attn/kernels/rotary.h",
"repo_id": "candle",
"token_count": 5052
} | 40 |
#include "compatibility.cuh"
#include<stdint.h>
#include<cmath>
// TODO: This is often used to check that the data is contiguous so that
// kernels can be easily mapped. However this only returns true for row
// major, if all the inputs are column major, we could apply the fast path
// too (but we wouldn't if some of ... | candle/candle-kernels/src/cuda_utils.cuh/0 | {
"file_path": "candle/candle-kernels/src/cuda_utils.cuh",
"repo_id": "candle",
"token_count": 3947
} | 41 |
#include <metal_stdlib>
using namespace metal;
template<typename T> METAL_FUNC void fill_with(
device T *out,
constant float &value,
constant size_t &numel,
uint tid [[thread_position_in_grid]]
) {
if (tid >= numel) {
return;
}
out[tid] = static_cast<T>(value);
}
#define FILL_OP(N... | candle/candle-metal-kernels/src/fill.metal/0 | {
"file_path": "candle/candle-metal-kernels/src/fill.metal",
"repo_id": "candle",
"token_count": 638
} | 42 |
use metal::{Buffer, ComputeCommandEncoderRef, ComputePipelineState, MTLSize};
use std::ffi::c_void;
/// Most kernels apply similarly across the tensors
/// This creates a strategy that uses the maximum amount of threads per threadgroup (capped at the
/// actual total buffer length).
/// Then kernels can just do their ... | candle/candle-metal-kernels/src/utils.rs/0 | {
"file_path": "candle/candle-metal-kernels/src/utils.rs",
"repo_id": "candle",
"token_count": 2819
} | 43 |
//! Convolution Layers.
use crate::BatchNorm;
use candle::{Result, Tensor};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Conv1dConfig {
pub padding: usize,
pub stride: usize,
pub dilation: usize,
pub groups: usize,
}
impl Default for Conv1dConfig {
fn default() -> Self {
Self {
... | candle/candle-nn/src/conv.rs/0 | {
"file_path": "candle/candle-nn/src/conv.rs",
"repo_id": "candle",
"token_count": 5891
} | 44 |
//! A `VarBuilder` for variable retrieval from models
//!
//! A `VarBuilder` is used to retrieve variables used by a model. These variables can either come
//! from a pre-trained checkpoint, e.g. using `VarBuilder::from_mmaped_safetensors`, or initialized
//! for training, e.g. using `VarBuilder::from_varmap`.
use crat... | candle/candle-nn/src/var_builder.rs/0 | {
"file_path": "candle/candle-nn/src/var_builder.rs",
"repo_id": "candle",
"token_count": 11054
} | 45 |
use candle::Result;
use prost::Message;
pub mod onnx {
include!(concat!(env!("OUT_DIR"), "/onnx.rs"));
}
pub mod eval;
pub use eval::{dtype, simple_eval};
pub fn read_file<P: AsRef<std::path::Path>>(p: P) -> Result<onnx::ModelProto> {
let buf = std::fs::read(p)?;
onnx::ModelProto::decode(buf.as_slice()).... | candle/candle-onnx/src/lib.rs/0 | {
"file_path": "candle/candle-onnx/src/lib.rs",
"repo_id": "candle",
"token_count": 154
} | 46 |
from .module import Module
from .container import Sequential, ModuleList, ModuleDict
from .sparse import Embedding
from .normalization import LayerNorm
from .linear import Linear
| candle/candle-pyo3/py_src/candle/nn/__init__.py/0 | {
"file_path": "candle/candle-pyo3/py_src/candle/nn/__init__.py",
"repo_id": "candle",
"token_count": 43
} | 47 |
use std::collections::HashMap;
use crate::utils::wrap_err;
use crate::{PyDType, PyTensor};
use candle_onnx::eval::{dtype, get_tensor, simple_eval};
use candle_onnx::onnx::tensor_proto::DataType;
use candle_onnx::onnx::tensor_shape_proto::dimension::Value;
use candle_onnx::onnx::type_proto::{Tensor as ONNXTensor, Value... | candle/candle-pyo3/src/onnx.rs/0 | {
"file_path": "candle/candle-pyo3/src/onnx.rs",
"repo_id": "candle",
"token_count": 3268
} | 48 |
pub mod generation;
pub mod models;
pub mod object_detection;
pub mod pipelines;
pub mod quantized_nn;
pub mod quantized_var_builder;
pub mod utils;
| candle/candle-transformers/src/lib.rs/0 | {
"file_path": "candle/candle-transformers/src/lib.rs",
"repo_id": "candle",
"token_count": 47
} | 49 |
//! ConvMixer implementation.
//!
//! See "Patches Are All You Need?" by Trockman et al. 2022
//!
//! - 📝 [Arxiv](https://arxiv.org/abs/2201.09792)
//! - 💻 [Github](https://github.com/locuslab/convmixer)
//!
use candle::Result;
use candle_nn::{batch_norm, Conv2dConfig, Module, VarBuilder};
#[allow(clippy::many_singl... | candle/candle-transformers/src/models/convmixer.rs/0 | {
"file_path": "candle/candle-transformers/src/models/convmixer.rs",
"repo_id": "candle",
"token_count": 1504
} | 50 |
//! Flux Model
//!
//! Flux is a 12B rectified flow transformer capable of generating images from text descriptions.
//!
//! - 🤗 [Hugging Face Model](https://huggingface.co/black-forest-labs/FLUX.1-schnell)
//! - 💻 [GitHub Repository](https://github.com/black-forest-labs/flux)
//! - 📝 [Blog Post](https://blackfores... | candle/candle-transformers/src/models/flux/mod.rs/0 | {
"file_path": "candle/candle-transformers/src/models/flux/mod.rs",
"repo_id": "candle",
"token_count": 530
} | 51 |
pub fn get_anyres_image_grid_shape(
image_size: (u32, u32),
grid_pinpoints: &[(u32, u32)],
patch_size: u32,
) -> (u32, u32) {
let (width, height) = select_best_resolution(image_size, grid_pinpoints);
(width / patch_size, height / patch_size)
}
pub fn select_best_resolution(
original_size: (u32,... | candle/candle-transformers/src/models/llava/utils.rs/0 | {
"file_path": "candle/candle-transformers/src/models/llava/utils.rs",
"repo_id": "candle",
"token_count": 689
} | 52 |
// Implement the MMDiT model originally introduced for Stable Diffusion 3 (https://arxiv.org/abs/2403.03206),
// as well as the MMDiT-X variant introduced for Stable Diffusion 3.5-medium (https://huggingface.co/stabilityai/stable-diffusion-3.5-medium)
// This follows the implementation of the MMDiT model in the ComfyUI... | candle/candle-transformers/src/models/mmdit/model.rs/0 | {
"file_path": "candle/candle-transformers/src/models/mmdit/model.rs",
"repo_id": "candle",
"token_count": 4203
} | 53 |
//! Parler Model implementation for parler_tts text-to-speech synthesis
//!
//! Implements a transformer-based decoder architecture for generating audio tokens
//! from text using discrete tokens. The model converts text into audio segments
//! using multiple codebooks of quantized audio tokens.
//!
//! The model archi... | candle/candle-transformers/src/models/parler_tts.rs/0 | {
"file_path": "candle/candle-transformers/src/models/parler_tts.rs",
"repo_id": "candle",
"token_count": 8561
} | 54 |
//! Phi2 model implementation with quantization support.
//!
//! Phi2 is a 2.7B parameter language model using scaled-up Transformer decoder architecture.
//! This implementation provides quantization for reduced memory and compute usage.
//!
//! Key characteristics:
//! - Partial attention with learned mixing to reduc... | candle/candle-transformers/src/models/quantized_phi.rs/0 | {
"file_path": "candle/candle-transformers/src/models/quantized_phi.rs",
"repo_id": "candle",
"token_count": 5545
} | 55 |
use candle::{DType, IndexOp, Result, Tensor};
use candle_nn::{layer_norm, LayerNorm, Module, VarBuilder};
#[derive(Debug)]
struct PatchEmbed {
proj: candle_nn::Conv2d,
span: tracing::Span,
}
impl PatchEmbed {
fn new(
in_chans: usize,
embed_dim: usize,
k_size: usize,
stride:... | candle/candle-transformers/src/models/segment_anything/image_encoder.rs/0 | {
"file_path": "candle/candle-transformers/src/models/segment_anything/image_encoder.rs",
"repo_id": "candle",
"token_count": 8848
} | 56 |
#![allow(dead_code)]
//! # Diffusion pipelines and models
//!
//! Noise schedulers can be used to set the trade-off between
//! inference speed and quality.
use candle::{Result, Tensor};
pub trait SchedulerConfig: std::fmt::Debug + Send + Sync {
fn build(&self, inference_steps: usize) -> Result<Box<dyn Scheduler>>... | candle/candle-transformers/src/models/stable_diffusion/schedulers.rs/0 | {
"file_path": "candle/candle-transformers/src/models/stable_diffusion/schedulers.rs",
"repo_id": "candle",
"token_count": 940
} | 57 |
//! 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
} | 58 |
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
} | 59 |
[package]
name = "candle-wasm-example-moondream"
version.workspace = true
edition.workspace = true
description.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
license.workspace = true
[dependencies]
candle = { workspace = true }
candle-nn = { workspace = true }
candle... | candle/candle-wasm-examples/moondream/Cargo.toml/0 | {
"file_path": "candle/candle-wasm-examples/moondream/Cargo.toml",
"repo_id": "candle",
"token_count": 297
} | 60 |
[package]
name = "candle-wasm-example-whisper"
version.workspace = true
edition.workspace = true
description.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
license.workspace = true
[dependencies]
candle = { workspace = true }
candle-nn = { workspace = true }
candle-t... | candle/candle-wasm-examples/whisper/Cargo.toml/0 | {
"file_path": "candle/candle-wasm-examples/whisper/Cargo.toml",
"repo_id": "candle",
"token_count": 428
} | 61 |
## 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
} | 62 |
#![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
} | 63 |
import json
import os
import tempfile
import datasets
from utils import generate_example_dataset, get_duration
SPEED_TEST_N_EXAMPLES = 500_000
RESULTS_BASEPATH, RESULTS_FILENAME = os.path.split(__file__)
RESULTS_FILE_PATH = os.path.join(RESULTS_BASEPATH, "results", RESULTS_FILENAME.replace(".py", ".json"))
@get_d... | datasets/benchmarks/benchmark_indices_mapping.py/0 | {
"file_path": "datasets/benchmarks/benchmark_indices_mapping.py",
"repo_id": "datasets",
"token_count": 677
} | 64 |
# The cache
The cache is one of the reasons why 🤗 Datasets is so efficient. It stores previously downloaded and processed datasets so when you need to use them again, they are reloaded directly from the cache. This avoids having to download a dataset all over again, or reapplying processing functions. Even after you ... | datasets/docs/source/about_cache.mdx/0 | {
"file_path": "datasets/docs/source/about_cache.mdx",
"repo_id": "datasets",
"token_count": 909
} | 65 |
# Cloud storage
## Hugging Face Datasets
The Hugging Face Dataset Hub is home to a growing collection of datasets that span a variety of domains and tasks.
It's more than a cloud storage: the Dataset Hub is a platform that provides data versioning thanks to git, as well as a Dataset Viewer to explore the data, makin... | datasets/docs/source/filesystems.mdx/0 | {
"file_path": "datasets/docs/source/filesystems.mdx",
"repo_id": "datasets",
"token_count": 1044
} | 66 |
# Loading methods
Methods for listing and loading datasets:
## Datasets
[[autodoc]] datasets.load_dataset
[[autodoc]] datasets.load_from_disk
[[autodoc]] datasets.load_dataset_builder
[[autodoc]] datasets.get_dataset_config_names
[[autodoc]] datasets.get_dataset_infos
[[autodoc]] datasets.get_dataset_split_name... | datasets/docs/source/package_reference/loading_methods.mdx/0 | {
"file_path": "datasets/docs/source/package_reference/loading_methods.mdx",
"repo_id": "datasets",
"token_count": 735
} | 67 |
# Use with NumPy
This document is a quick introduction to using `datasets` with NumPy, with a particular focus on how to get
`numpy.ndarray` objects out of our datasets, and how to use them to train models based on NumPy such as `scikit-learn` models.
## Dataset format
By default, datasets return regular Python obj... | datasets/docs/source/use_with_numpy.mdx/0 | {
"file_path": "datasets/docs/source/use_with_numpy.mdx",
"repo_id": "datasets",
"token_count": 2282
} | 68 |
# 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/builder.py/0 | {
"file_path": "datasets/src/datasets/builder.py",
"repo_id": "datasets",
"token_count": 41270
} | 69 |
import io
import os
from typing import Iterable, List, Optional, Tuple, Union
from ..utils.file_utils import ( # noqa: F401 # backward compatibility
SINGLE_FILE_COMPRESSION_PROTOCOLS,
ArchiveIterable,
FilesIterable,
_get_extraction_protocol,
_get_path_extension,
_prepare_path_and_storage_optio... | datasets/src/datasets/download/streaming_download_manager.py/0 | {
"file_path": "datasets/src/datasets/download/streaming_download_manager.py",
"repo_id": "datasets",
"token_count": 3364
} | 70 |
# Copyright 2020 The HuggingFace 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
#
# Unless required by applicable law or agreed to... | datasets/src/datasets/formatting/tf_formatter.py/0 | {
"file_path": "datasets/src/datasets/formatting/tf_formatter.py",
"repo_id": "datasets",
"token_count": 2181
} | 71 |
# 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/load.py/0 | {
"file_path": "datasets/src/datasets/load.py",
"repo_id": "datasets",
"token_count": 44301
} | 72 |
from typing import List
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: boo... | datasets/src/datasets/packaged_modules/imagefolder/imagefolder.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/imagefolder/imagefolder.py",
"repo_id": "datasets",
"token_count": 893
} | 73 |
#
# Copyright (c) 2017-2021 NVIDIA CORPORATION. All rights reserved.
# This file coems from the WebDataset library.
# See the LICENSE file for licensing terms (BSD-style).
#
"""
Binary tensor encodings for PyTorch and NumPy.
This defines efficient binary encodings for tensors. The format is 8 byte
aligned and can be ... | datasets/src/datasets/packaged_modules/webdataset/_tenbin.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/webdataset/_tenbin.py",
"repo_id": "datasets",
"token_count": 3409
} | 74 |
"""Contains utilities to flag a feature as "experimental" in datasets."""
import warnings
from functools import wraps
from typing import Callable
def experimental(fn: Callable) -> Callable:
"""Decorator to flag a feature as experimental.
An experimental feature trigger a warning when used as it might be sub... | datasets/src/datasets/utils/experimental.py/0 | {
"file_path": "datasets/src/datasets/utils/experimental.py",
"repo_id": "datasets",
"token_count": 386
} | 75 |
from typing import List
import numpy as np
def _number_of_shards_in_gen_kwargs(gen_kwargs: dict) -> int:
"""Return the number of possible shards according to the input gen_kwargs"""
# Having lists of different sizes makes sharding ambigious, raise an error in this case
# until we decide how to define sha... | datasets/src/datasets/utils/sharding.py/0 | {
"file_path": "datasets/src/datasets/utils/sharding.py",
"repo_id": "datasets",
"token_count": 1742
} | 76 |
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": 915
} | 77 |
from pathlib import Path
import pytest
from datasets import load_dataset
from datasets.packaged_modules.cache.cache import Cache
SAMPLE_DATASET_SINGLE_CONFIG_IN_METADATA = "hf-internal-testing/audiofolder_single_config_in_metadata"
SAMPLE_DATASET_TWO_CONFIG_IN_METADATA = "hf-internal-testing/audiofolder_two_configs... | datasets/tests/packaged_modules/test_cache.py/0 | {
"file_path": "datasets/tests/packaged_modules/test_cache.py",
"repo_id": "datasets",
"token_count": 2721
} | 78 |
import os
import tempfile
from unittest import TestCase
import numpy as np
import pandas as pd
import pytest
from datasets import load_from_disk
from datasets.arrow_dataset import Dataset
from datasets.dataset_dict import DatasetDict, IterableDatasetDict
from datasets.features import ClassLabel, Features, Sequence, V... | datasets/tests/test_dataset_dict.py/0 | {
"file_path": "datasets/tests/test_dataset_dict.py",
"repo_id": "datasets",
"token_count": 17837
} | 79 |
import asyncio
import pickle
import time
from copy import deepcopy
from itertools import chain, cycle, islice
from unittest.mock import patch
import numpy as np
import pandas as pd
import pyarrow as pa
import pyarrow.compute as pc
import pytest
from datasets import Dataset, load_dataset
from datasets.combine import c... | datasets/tests/test_iterable_dataset.py/0 | {
"file_path": "datasets/tests/test_iterable_dataset.py",
"repo_id": "datasets",
"token_count": 45678
} | 80 |
# Copyright 2021 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... | datasets/utils/release.py/0 | {
"file_path": "datasets/utils/release.py",
"repo_id": "datasets",
"token_count": 1359
} | 81 |
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level o... | diffusers/CODE_OF_CONDUCT.md/0 | {
"file_path": "diffusers/CODE_OF_CONDUCT.md",
"repo_id": "diffusers",
"token_count": 1130
} | 82 |
import glob
import sys
import pandas as pd
from huggingface_hub import hf_hub_download, upload_file
from huggingface_hub.utils import EntryNotFoundError
sys.path.append(".")
from utils import BASE_PATH, FINAL_CSV_FILE, GITHUB_SHA, REPO_ID, collate_csv # noqa: E402
def has_previous_benchmark() -> str:
csv_path... | diffusers/benchmarks/push_results.py/0 | {
"file_path": "diffusers/benchmarks/push_results.py",
"repo_id": "diffusers",
"token_count": 1087
} | 83 |
- sections:
- local: index
title: 🧨 Diffusers
- local: quicktour
title: Quicktour
- local: stable_diffusion
title: Effective and efficient diffusion
- local: installation
title: Installation
title: Get started
- sections:
- local: tutorials/tutorial_overview
title: Overview
- local: u... | diffusers/docs/source/en/_toctree.yml/0 | {
"file_path": "diffusers/docs/source/en/_toctree.yml",
"repo_id": "diffusers",
"token_count": 8659
} | 84 |
<!-- Copyright 2024 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/allegro_transformer3d.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/allegro_transformer3d.md",
"repo_id": "diffusers",
"token_count": 362
} | 85 |
<!--Copyright 2024 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/flux.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/flux.md",
"repo_id": "diffusers",
"token_count": 7051
} | 86 |
<!-- Copyright 2024 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
} | 87 |
<!--Copyright 2024 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/stable_cascade.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/stable_cascade.md",
"repo_id": "diffusers",
"token_count": 2836
} | 88 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/schedulers/ddpm.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/ddpm.md",
"repo_id": "diffusers",
"token_count": 470
} | 89 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/schedulers/multistep_dpm_solver_inverse.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/multistep_dpm_solver_inverse.md",
"repo_id": "diffusers",
"token_count": 547
} | 90 |
<!--Copyright 2024 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/conceptual/evaluation.md/0 | {
"file_path": "diffusers/docs/source/en/conceptual/evaluation.md",
"repo_id": "diffusers",
"token_count": 8359
} | 91 |
# 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
} | 92 |
<!--Copyright 2024 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": 321
} | 93 |
<!--Copyright 2024 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/fast_diffusion.md/0 | {
"file_path": "diffusers/docs/source/en/tutorials/fast_diffusion.md",
"repo_id": "diffusers",
"token_count": 4972
} | 94 |
<!--Copyright 2024 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/inference_with_lcm.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/inference_with_lcm.md",
"repo_id": "diffusers",
"token_count": 9016
} | 95 |
<!--Copyright 2024 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/schedulers.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/schedulers.md",
"repo_id": "diffusers",
"token_count": 3407
} | 96 |
<!--Copyright 2024 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/stable_diffusion.md/0 | {
"file_path": "diffusers/docs/source/ja/stable_diffusion.md",
"repo_id": "diffusers",
"token_count": 6259
} | 97 |
<!--Copyright 2024 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/onnx.md/0 | {
"file_path": "diffusers/docs/source/ko/optimization/onnx.md",
"repo_id": "diffusers",
"token_count": 1448
} | 98 |
<!--Copyright 2024 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/text2image.md/0 | {
"file_path": "diffusers/docs/source/ko/training/text2image.md",
"repo_id": "diffusers",
"token_count": 6021
} | 99 |
<!--Copyright 2024 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/push_to_hub.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/push_to_hub.md",
"repo_id": "diffusers",
"token_count": 3793
} | 100 |
from typing import Union
import torch
from PIL import Image
from torchvision import transforms as tfms
from tqdm.auto import tqdm
from transformers import CLIPTextModel, CLIPTokenizer
from diffusers import (
AutoencoderKL,
DDIMScheduler,
DiffusionPipeline,
LMSDiscreteScheduler,
PNDMScheduler,
... | diffusers/examples/community/magic_mix.py/0 | {
"file_path": "diffusers/examples/community/magic_mix.py",
"repo_id": "diffusers",
"token_count": 2446
} | 101 |
# Copyright 2024 Black Forest Labs and The HuggingFace Team. All rights reserved.
# modeled after RF Inversion: https://rf-inversion.github.io/, authored by Litu Rout, Yujia Chen, Nataniel Ruiz,
# Constantine Caramanis, Sanjay Shakkottai and Wen-Sheng Chu.
#
# Licensed under the Apache License, Version 2.0 (the "Licens... | diffusers/examples/community/pipeline_flux_rf_inversion.py/0 | {
"file_path": "diffusers/examples/community/pipeline_flux_rf_inversion.py",
"repo_id": "diffusers",
"token_count": 22018
} | 102 |
# Copyright 2024 The InstantX Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | diffusers/examples/community/pipeline_stable_diffusion_xl_instandid_img2img.py/0 | {
"file_path": "diffusers/examples/community/pipeline_stable_diffusion_xl_instandid_img2img.py",
"repo_id": "diffusers",
"token_count": 22982
} | 103 |
import inspect
import os
import random
import re
from dataclasses import dataclass
from typing import Callable, Dict, List, Optional, Union
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers.configuration_utils import FrozenDict
from diffusers.models import Autoencod... | diffusers/examples/community/wildcard_stable_diffusion.py/0 | {
"file_path": "diffusers/examples/community/wildcard_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 9006
} | 104 |
# DreamBooth training example for FLUX.1 [dev]
[DreamBooth](https://arxiv.org/abs/2208.12242) is a method to personalize text2image models like stable diffusion given just a few (3~5) images of a subject.
The `train_dreambooth_flux.py` script shows how to implement the training procedure and adapt it for [FLUX.1 [dev... | diffusers/examples/dreambooth/README_flux.md/0 | {
"file_path": "diffusers/examples/dreambooth/README_flux.md",
"repo_id": "diffusers",
"token_count": 3793
} | 105 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/examples/dreambooth/test_dreambooth_lora_flux.py/0 | {
"file_path": "diffusers/examples/dreambooth/test_dreambooth_lora_flux.py",
"repo_id": "diffusers",
"token_count": 4875
} | 106 |
# 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/LICENSE-2.0
#
# Unless r... | diffusers/examples/kandinsky2_2/text_to_image/train_text_to_image_lora_prior.py/0 | {
"file_path": "diffusers/examples/kandinsky2_2/text_to_image/train_text_to_image_lora_prior.py",
"repo_id": "diffusers",
"token_count": 15623
} | 107 |
# 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://arxiv.org/abs/2303.01469) and refined in [Improved Techniques for Training Consistency Models](https://arxiv.org/abs/2310.14189... | diffusers/examples/research_projects/consistency_training/README.md/0 | {
"file_path": "diffusers/examples/research_projects/consistency_training/README.md",
"repo_id": "diffusers",
"token_count": 413
} | 108 |
## 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": 2095
} | 109 |
## 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
} | 110 |
# 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/research_projects/promptdiffusion/convert_original_promptdiffusion_to_diffusers.py/0 | {
"file_path": "diffusers/examples/research_projects/promptdiffusion/convert_original_promptdiffusion_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 40258
} | 111 |
#!/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/research_projects/scheduled_huber_loss_training/dreambooth/train_dreambooth.py/0 | {
"file_path": "diffusers/examples/research_projects/scheduled_huber_loss_training/dreambooth/train_dreambooth.py",
"repo_id": "diffusers",
"token_count": 27120
} | 112 |
# Würstchen text-to-image fine-tuning
## Running locally with PyTorch
Before running the scripts, make sure to install the library's training dependencies:
**Important**
To make sure you can successfully run the latest versions of the example scripts, we highly recommend **installing from source** and keeping the i... | diffusers/examples/research_projects/wuerstchen/text_to_image/README.md/0 | {
"file_path": "diffusers/examples/research_projects/wuerstchen/text_to_image/README.md",
"repo_id": "diffusers",
"token_count": 1208
} | 113 |
# Stable Diffusion text-to-image fine-tuning
The `train_text_to_image.py` script shows how to fine-tune stable diffusion model on your own dataset.
___Note___:
___This script is experimental. The script fine-tunes the whole model and often times the model overfits and runs into issues like catastrophic forgetting. I... | diffusers/examples/text_to_image/README.md/0 | {
"file_path": "diffusers/examples/text_to_image/README.md",
"repo_id": "diffusers",
"token_count": 5282
} | 114 |
# coding=utf-8
# Copyright 2024 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/textual_inversion/test_textual_inversion.py/0 | {
"file_path": "diffusers/examples/textual_inversion/test_textual_inversion.py",
"repo_id": "diffusers",
"token_count": 2914
} | 115 |
# 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/change_naming_configs_and_checkpoints.py/0 | {
"file_path": "diffusers/scripts/change_naming_configs_and_checkpoints.py",
"repo_id": "diffusers",
"token_count": 1631
} | 116 |
import argparse
from typing import Any, Dict
import torch
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
from diffusers import AutoencoderDC
def remap_qkv_(key: str, state_dict: Dict[str, Any]):
qkv = state_dict.pop(key)
q, k, v = torch.chunk(qkv, 3, dim=0)
parent_mo... | diffusers/scripts/convert_dcae_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_dcae_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 6118
} | 117 |
#!/usr/bin/env python3
import argparse
import fnmatch
from safetensors.torch import load_file
from diffusers import Kandinsky3UNet
MAPPING = {
"to_time_embed.1": "time_embedding.linear_1",
"to_time_embed.3": "time_embedding.linear_2",
"in_layer": "conv_in",
"out_layer.0": "conv_norm_out",
"out_l... | diffusers/scripts/convert_kandinsky3_unet.py/0 | {
"file_path": "diffusers/scripts/convert_kandinsky3_unet.py",
"repo_id": "diffusers",
"token_count": 1403
} | 118 |
# 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_stable_diffusion_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_original_stable_diffusion_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 2889
} | 119 |
import argparse
from transformers import CLIPImageProcessor, CLIPVisionModelWithProjection
from diffusers import UnCLIPImageVariationPipeline, UnCLIPPipeline
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--dump_path", default=None, type=str, required=True, help="Path to... | diffusers/scripts/convert_unclip_txt2img_to_image_variation.py/0 | {
"file_path": "diffusers/scripts/convert_unclip_txt2img_to_image_variation.py",
"repo_id": "diffusers",
"token_count": 554
} | 120 |
# Copyright 2024 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": 2248
} | 121 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/loaders/lora_base.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/lora_base.py",
"repo_id": "diffusers",
"token_count": 17652
} | 122 |
# 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/src/diffusers/models/adapter.py/0 | {
"file_path": "diffusers/src/diffusers/models/adapter.py",
"repo_id": "diffusers",
"token_count": 10132
} | 123 |
# Copyright 2024 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
} | 124 |
# Copyright 2024 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_xs.py/0 | {
"file_path": "diffusers/src/diffusers/models/controlnets/controlnet_xs.py",
"repo_id": "diffusers",
"token_count": 39504
} | 125 |
from ...utils import is_torch_available
if is_torch_available():
from .auraflow_transformer_2d import AuraFlowTransformer2DModel
from .cogvideox_transformer_3d import CogVideoXTransformer3DModel
from .consisid_transformer_3d import ConsisIDTransformer3DModel
from .dit_transformer_2d import DiTTransfor... | diffusers/src/diffusers/models/transformers/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/__init__.py",
"repo_id": "diffusers",
"token_count": 546
} | 126 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.