text stringlengths 5 631k | id stringlengths 14 178 | metadata dict | __index_level_0__ int64 0 647 |
|---|---|---|---|
# Generated content DO NOT EDIT
from .. import onnx
ONNXModel = onnx.ONNXModel
ONNXTensorDescription = onnx.ONNXTensorDescription
| candle/candle-pyo3/py_src/candle/onnx/__init__.py/0 | {
"file_path": "candle/candle-pyo3/py_src/candle/onnx/__init__.py",
"repo_id": "candle",
"token_count": 46
} | 57 |
import candle
from candle import Tensor
from candle.nn import Linear
def test_linear_layer_can_be_constructed():
linear = Linear(10, 10)
assert linear is not None
def test_linear_layer_can_forward_a_singular_input():
linear = Linear(384, 1536)
input_tensor = candle.randn((8, 384))
output = linea... | candle/candle-pyo3/tests/bindings/test_linear.py/0 | {
"file_path": "candle/candle-pyo3/tests/bindings/test_linear.py",
"repo_id": "candle",
"token_count": 431
} | 58 |
//! Implementation of the ChatGLM2/3 models from THUDM.
//!
//! - 💻 [Github](https://github.com/THUDM/ChatGLM3) ChatGLM3: Advancing Multilingual Conversational Language Models with High-Quality Data
//! - 💻 [Github](https://github.com/THUDM/ChatGLM2-6B) ChatGLM2-6B.
//!
use crate::models::with_tracing::{linear_b as l... | candle/candle-transformers/src/models/chatglm.rs/0 | {
"file_path": "candle/candle-transformers/src/models/chatglm.rs",
"repo_id": "candle",
"token_count": 10447
} | 59 |
//! Implementation of the DINOv2 models from Meta Research.
//!
//! This module implements the DINOv2 vision transformer model from Meta AI Research.
//! DINOv2 is a self-supervised learning model that can learn visual features
//! without using any labeled data. See: ["DINOv2: Learning Robust Visual Features without S... | candle/candle-transformers/src/models/dinov2.rs/0 | {
"file_path": "candle/candle-transformers/src/models/dinov2.rs",
"repo_id": "candle",
"token_count": 6312
} | 60 |
//! Gemma LLM architecture (Google) inference implementation.
//!
//! See ["Introducing Gemma 3: The most capable model you can run on a single GPU or TPU"](https://blog.google/technology/developers/gemma-3/)
//!
//! Based on implementations from HuggingFace transformers.
use std::sync::Arc;
use candle::{DType, Devic... | candle/candle-transformers/src/models/gemma3.rs/0 | {
"file_path": "candle/candle-transformers/src/models/gemma3.rs",
"repo_id": "candle",
"token_count": 9001
} | 61 |
// Copyright (c) Kyutai, all rights reserved.
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
use candle::{Module, Result, StreamTensor, StreamingModule, Tensor, D};
use candle_nn::{Conv1d, VarBuilder};
#[allow(clippy::enum_variant_names)]
#[de... | candle/candle-transformers/src/models/mimi/conv.rs/0 | {
"file_path": "candle/candle-transformers/src/models/mimi/conv.rs",
"repo_id": "candle",
"token_count": 11137
} | 62 |
//! # MobileOne
//!
//! MobileOne inference implementation based on timm and candle-repvgg
//!
//! See ["MobileOne: An Improved One millisecond Mobile Backbone"](https://arxiv.org/abs/2206.04040)
use candle::{DType, Result, Tensor, D};
use candle_nn::{
batch_norm, conv2d, conv2d_no_bias, linear, ops::sigmoid, Batc... | candle/candle-transformers/src/models/mobileone.rs/0 | {
"file_path": "candle/candle-transformers/src/models/mobileone.rs",
"repo_id": "candle",
"token_count": 4729
} | 63 |
//! Microsoft Phi-3 model implementation
//!
//! See Phi model details at:
//! - [Phi-3 Model](https://huggingface.co/microsoft/phi-3)
//!
//! The Phi series are decoder-only transformers designed for code and language tasks.
//! Key characteristics:
//! - Decoder-only transformer architecture
//! - RoPE embeddings
//!... | candle/candle-transformers/src/models/phi3.rs/0 | {
"file_path": "candle/candle-transformers/src/models/phi3.rs",
"repo_id": "candle",
"token_count": 8089
} | 64 |
//! Qwen2 model implementation with quantization support.
//!
//! Qwen2 is a chat-optimized language model that supports 8-bit quantization
//! for reduced memory usage and faster inference.
//!
//! Key characteristics:
//! - Group Query Attention (GQA)
//! - RMSNorm for layer normalization
//! - Rotary positional embe... | candle/candle-transformers/src/models/quantized_qwen2.rs/0 | {
"file_path": "candle/candle-transformers/src/models/quantized_qwen2.rs",
"repo_id": "candle",
"token_count": 6400
} | 65 |
//! Segformer model implementation for semantic segmentation and image classification.
//!
//! Segformer is a transformer-based model designed for vision tasks. It uses a hierarchical
//! structure that progressively generates features at different scales.
//!
//! Key characteristics:
//! - Efficient self-attention wit... | candle/candle-transformers/src/models/segformer.rs/0 | {
"file_path": "candle/candle-transformers/src/models/segformer.rs",
"repo_id": "candle",
"token_count": 11539
} | 66 |
//! Stable Diffusion
//!
//! Stable Diffusion is a latent text-to-image diffusion model capable of
//! generating photo-realistic images given any text input.
//!
//! - 💻 [Original Repository](https://github.com/CompVis/stable-diffusion)
//! - 🤗 [Hugging Face](https://huggingface.co/runwayml/stable-diffusion-v1-5)
//... | candle/candle-transformers/src/models/stable_diffusion/mod.rs/0 | {
"file_path": "candle/candle-transformers/src/models/stable_diffusion/mod.rs",
"repo_id": "candle",
"token_count": 8553
} | 67 |
pub mod audio;
pub mod model;
pub mod voxtral_llama;
pub use audio::extract_features;
pub use model::{
VoxtralCache, VoxtralConfig, VoxtralEncoder, VoxtralEncoderConfig,
VoxtralForConditionalGeneration, VoxtralGenerationConfig, VoxtralMultiModalProjector,
};
pub use voxtral_llama::{VoxtralLlama, VoxtralLlamaCa... | candle/candle-transformers/src/models/voxtral/mod.rs/0 | {
"file_path": "candle/candle-transformers/src/models/voxtral/mod.rs",
"repo_id": "candle",
"token_count": 170
} | 68 |
//! Yi model implementation.
//!
//! This candle implementation uses a pre-trained Yi decoder-only large language model for inference.
//! The model was trained by 01.AI and follows a standard transformer architecture similar to LLaMA.
//!
//! Original code:
//! - 💻 [Yi Model](https://huggingface.co/01-ai/Yi-6B)
//! -... | candle/candle-transformers/src/models/yi.rs/0 | {
"file_path": "candle/candle-transformers/src/models/yi.rs",
"repo_id": "candle",
"token_count": 6426
} | 69 |
export async function getEmbeddings(
worker,
weightsURL,
tokenizerURL,
configURL,
modelID,
sentences,
updateStatus = null
) {
return new Promise((resolve, reject) => {
worker.postMessage({
weightsURL,
tokenizerURL,
configURL,
modelID,
sentences,
});
function mes... | candle/candle-wasm-examples/bert/utils.js/0 | {
"file_path": "candle/candle-wasm-examples/bert/utils.js",
"repo_id": "candle",
"token_count": 1250
} | 70 |
cargo build --target wasm32-unknown-unknown --release
wasm-bindgen ../../target/wasm32-unknown-unknown/release/m.wasm --out-dir build --target web
wasm-bindgen ../../target/wasm32-unknown-unknown/release/m-quantized.wasm --out-dir build --target web
| candle/candle-wasm-examples/t5/build-lib.sh/0 | {
"file_path": "candle/candle-wasm-examples/t5/build-lib.sh",
"repo_id": "candle",
"token_count": 84
} | 71 |
use yew_agent::PublicWorker;
fn main() {
candle_wasm_example_whisper::Worker::register();
}
| candle/candle-wasm-examples/whisper/src/bin/worker.rs/0 | {
"file_path": "candle/candle-wasm-examples/whisper/src/bin/worker.rs",
"repo_id": "candle",
"token_count": 38
} | 72 |
# syntax=docker/dockerfile:1
ARG INCLUDE_DB=false
FROM node:20-slim AS base
ENV PLAYWRIGHT_SKIP_BROWSER_GC=1
# install dotenv-cli
RUN npm install -g dotenv-cli
# switch to a user that works for spaces
RUN userdel -r node
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PAT... | chat-ui/Dockerfile/0 | {
"file_path": "chat-ui/Dockerfile",
"repo_id": "chat-ui",
"token_count": 991
} | 73 |
{{- if $.Values.monitoring.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels: {{ include "labels.standard" . | nindent 4 }}
name: {{ include "name" . }}
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels: {{ include "labels.standard" . | nindent 6 }}
endpoi... | chat-ui/chart/templates/service-monitor.yaml/0 | {
"file_path": "chat-ui/chart/templates/service-monitor.yaml",
"repo_id": "chat-ui",
"token_count": 144
} | 74 |
# Ollama
| Feature | Available |
| --------------------------- | --------- |
| [Tools](../tools) | No |
| [Multimodal](../multimodal) | No |
We also support the Ollama inference server. Spin up a model with
```bash
ollama run mistral
```
Then specify the endpoints like so... | chat-ui/docs/source/configuration/models/providers/ollama.md/0 | {
"file_path": "chat-ui/docs/source/configuration/models/providers/ollama.md",
"repo_id": "chat-ui",
"token_count": 468
} | 75 |
export function clickOutside(element: HTMLElement, callbackFunction: () => void) {
function onClick(event: MouseEvent) {
if (!element.contains(event.target as Node)) {
callbackFunction();
}
}
document.body.addEventListener("click", onClick);
return {
update(newCallbackFunction: () => void) {
callbackF... | chat-ui/src/lib/actions/clickOutside.ts/0 | {
"file_path": "chat-ui/src/lib/actions/clickOutside.ts",
"repo_id": "chat-ui",
"token_count": 144
} | 76 |
<script lang="ts">
import CarbonEarth from "~icons/carbon/earth";
import CarbonArrowUpRight from "~icons/carbon/arrow-up-right";
import BIMeta from "~icons/bi/meta";
import CarbonCode from "~icons/carbon/code";
import type { Model } from "$lib/types/Model";
interface Props {
model: Pick<
Model,
"name" | ... | chat-ui/src/lib/components/ModelCardMetadata.svelte/0 | {
"file_path": "chat-ui/src/lib/components/ModelCardMetadata.svelte",
"repo_id": "chat-ui",
"token_count": 901
} | 77 |
<script lang="ts">
import ToolLogo from "./ToolLogo.svelte";
import { base } from "$app/paths";
import { browser } from "$app/environment";
import { handleResponse, useAPIClient } from "$lib/APIClient";
interface Props {
toolId: string;
}
let { toolId }: Props = $props();
const client = useAPIClient();
</s... | chat-ui/src/lib/components/ToolBadge.svelte/0 | {
"file_path": "chat-ui/src/lib/components/ToolBadge.svelte",
"repo_id": "chat-ui",
"token_count": 547
} | 78 |
<script lang="ts">
import MarkdownRenderer from "./MarkdownRenderer.svelte";
import CarbonCaretDown from "~icons/carbon/caret-down";
interface Props {
summary: string;
content: string;
loading?: boolean;
}
let { summary, content, loading = false }: Props = $props();
let isOpen = $state(loading);
$effect... | chat-ui/src/lib/components/chat/OpenReasoningResults.svelte/0 | {
"file_path": "chat-ui/src/lib/components/chat/OpenReasoningResults.svelte",
"repo_id": "chat-ui",
"token_count": 1873
} | 79 |
import type { Migration } from ".";
import { collections } from "$lib/server/database";
import { ObjectId } from "mongodb";
import { ReviewStatus } from "$lib/types/Review";
const updateFeaturedToReview: Migration = {
_id: new ObjectId("000000000000000000000008"),
name: "Update featured to review",
up: async () => ... | chat-ui/src/lib/migrations/routines/08-update-featured-to-review.ts/0 | {
"file_path": "chat-ui/src/lib/migrations/routines/08-update-featured-to-review.ts",
"repo_id": "chat-ui",
"token_count": 326
} | 80 |
import { env as publicEnv } from "$env/dynamic/public";
import { env as serverEnv } from "$env/dynamic/private";
import { building } from "$app/environment";
import type { Collection } from "mongodb";
import type { ConfigKey as ConfigKeyType } from "$lib/types/ConfigKey";
import type { Semaphore } from "$lib/types/Sema... | chat-ui/src/lib/server/config.ts/0 | {
"file_path": "chat-ui/src/lib/server/config.ts",
"repo_id": "chat-ui",
"token_count": 1685
} | 81 |
import type { Conversation } from "$lib/types/Conversation";
import type { Message } from "$lib/types/Message";
import type { TextGenerationStreamOutput, TextGenerationStreamToken } from "@huggingface/inference";
import { endpointTgi, endpointTgiParametersSchema } from "./tgi/endpointTgi";
import { z } from "zod";
impo... | chat-ui/src/lib/server/endpoints/endpoints.ts/0 | {
"file_path": "chat-ui/src/lib/server/endpoints/endpoints.ts",
"repo_id": "chat-ui",
"token_count": 1200
} | 82 |
import type { Conversation } from "$lib/types/Conversation";
import type { MessageFile } from "$lib/types/Message";
import { sha256 } from "$lib/utils/sha256";
import { fileTypeFromBuffer } from "file-type";
import { collections } from "$lib/server/database";
export async function uploadFile(file: File, conv: Conversa... | chat-ui/src/lib/server/files/uploadFile.ts/0 | {
"file_path": "chat-ui/src/lib/server/files/uploadFile.ts",
"repo_id": "chat-ui",
"token_count": 364
} | 83 |
import { config } from "$lib/server/config";
import type { ChatTemplateInput } from "$lib/types/Template";
import { compileTemplate } from "$lib/utils/template";
import { z } from "zod";
import endpoints, { endpointSchema, type Endpoint } from "./endpoints/endpoints";
import { endpointTgi } from "./endpoints/tgi/endpoi... | chat-ui/src/lib/server/models.ts/0 | {
"file_path": "chat-ui/src/lib/server/models.ts",
"repo_id": "chat-ui",
"token_count": 4827
} | 84 |
import type { ConfigTool } from "$lib/types/Tool";
import { ObjectId } from "mongodb";
import { runWebSearch } from "../../websearch/runWebSearch";
const websearch: ConfigTool = {
_id: new ObjectId("00000000000000000000000A"),
type: "config",
description: "Search the web for up-to-date answers to the user's query."... | chat-ui/src/lib/server/tools/web/search.ts/0 | {
"file_path": "chat-ui/src/lib/server/tools/web/search.ts",
"repo_id": "chat-ui",
"token_count": 569
} | 85 |
export interface SerializedHTMLElement {
tagName: string;
attributes: Record<string, string>;
content: (SerializedHTMLElement | string)[];
}
| chat-ui/src/lib/server/websearch/scrape/types.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/scrape/types.ts",
"repo_id": "chat-ui",
"token_count": 46
} | 86 |
import { writable } from "svelte/store";
export const loginModalOpen = writable(false);
| chat-ui/src/lib/stores/loginModal.ts/0 | {
"file_path": "chat-ui/src/lib/stores/loginModal.ts",
"repo_id": "chat-ui",
"token_count": 28
} | 87 |
import type { ObjectId } from "mongodb";
export interface MigrationResult {
_id: ObjectId;
name: string;
status: "success" | "failure" | "ongoing";
}
| chat-ui/src/lib/types/MigrationResult.ts/0 | {
"file_path": "chat-ui/src/lib/types/MigrationResult.ts",
"repo_id": "chat-ui",
"token_count": 53
} | 88 |
/**
* Chunk array into arrays of length at most `chunkSize`
*
* @param chunkSize must be greater than or equal to 1
*/
export function chunk<T extends unknown[] | string>(arr: T, chunkSize: number): T[] {
if (isNaN(chunkSize) || chunkSize < 1) {
throw new RangeError("Invalid chunk size: " + chunkSize);
}
if (... | chat-ui/src/lib/utils/chunk.ts/0 | {
"file_path": "chat-ui/src/lib/utils/chunk.ts",
"repo_id": "chat-ui",
"token_count": 295
} | 89 |
import type { MessageFile } from "$lib/types/Message";
import {
type MessageUpdate,
type MessageStreamUpdate,
type MessageToolCallUpdate,
MessageToolUpdateType,
MessageUpdateType,
type MessageToolUpdate,
type MessageWebSearchUpdate,
type MessageWebSearchGeneralUpdate,
type MessageWebSearchSourcesUpdate,
type ... | chat-ui/src/lib/utils/messageUpdates.ts/0 | {
"file_path": "chat-ui/src/lib/utils/messageUpdates.ts",
"repo_id": "chat-ui",
"token_count": 2913
} | 90 |
import { v4 } from "uuid";
import type { Tree, TreeId, NewNode, TreeNode } from "./tree";
export function addChildren<T>(conv: Tree<T>, message: NewNode<T>, parentId?: TreeId): TreeId {
// if this is the first message we just push it
if (conv.messages.length === 0) {
const messageId = v4();
conv.rootMessageId = ... | chat-ui/src/lib/utils/tree/addChildren.ts/0 | {
"file_path": "chat-ui/src/lib/utils/tree/addChildren.ts",
"repo_id": "chat-ui",
"token_count": 486
} | 91 |
<script lang="ts">
import { goto } from "$app/navigation";
import { base } from "$app/paths";
import { page } from "$app/state";
import { usePublicConfig } from "$lib/utils/PublicConfig.svelte";
const publicConfig = usePublicConfig();
import ChatWindow from "$lib/components/chat/ChatWindow.svelte";
import { ER... | chat-ui/src/routes/+page.svelte/0 | {
"file_path": "chat-ui/src/routes/+page.svelte",
"repo_id": "chat-ui",
"token_count": 1078
} | 92 |
import { base } from "$app/paths";
import { collections } from "$lib/server/database";
import { error } from "@sveltejs/kit";
import { ObjectId } from "mongodb";
import { z } from "zod";
import { config } from "$lib/server/config";
import { sendSlack } from "$lib/server/sendSlack";
import type { Tool } from "$lib/typ... | chat-ui/src/routes/api/tools/[toolId]/report/+server.ts/0 | {
"file_path": "chat-ui/src/routes/api/tools/[toolId]/report/+server.ts",
"repo_id": "chat-ui",
"token_count": 668
} | 93 |
import { config } from "$lib/server/config";
import { startOfHour } from "date-fns";
import { authCondition, requiresUser } from "$lib/server/auth";
import { collections } from "$lib/server/database";
import { models, validModelIdSchema } from "$lib/server/models";
import { ERROR_MESSAGES } from "$lib/stores/errors";
i... | chat-ui/src/routes/conversation/[id]/+server.ts/0 | {
"file_path": "chat-ui/src/routes/conversation/[id]/+server.ts",
"repo_id": "chat-ui",
"token_count": 6328
} | 94 |
<script lang="ts">
import logo from "../../../../../static/huggingchat/logo.svg?raw";
import { usePublicConfig } from "$lib/utils/PublicConfig.svelte";
const publicConfig = usePublicConfig();
interface Props {
name: string;
logoUrl: string | undefined;
}
let { name, logoUrl }: Props = $props();
</script>
<... | chat-ui/src/routes/models/[...model]/thumbnail.png/ModelThumbnail.svelte/0 | {
"file_path": "chat-ui/src/routes/models/[...model]/thumbnail.png/ModelThumbnail.svelte",
"repo_id": "chat-ui",
"token_count": 502
} | 95 |
import { useAPIClient, handleResponse } from "$lib/APIClient";
export const load = async ({ parent, fetch }) => {
const client = useAPIClient({ fetch });
const reports = await client.user.reports.get().then(handleResponse);
return {
assistants: (await parent().then((data) => data.assistants)).map((el) => ({
... | chat-ui/src/routes/settings/+layout.ts/0 | {
"file_path": "chat-ui/src/routes/settings/+layout.ts",
"repo_id": "chat-ui",
"token_count": 166
} | 96 |
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"values": "<DVC_METRIC_DATA>"
},
"title": "<DVC_METRIC_TITLE>",
"mark": "rect",
"encoding": {
"x": {
"field": "<DVC_METRIC_X>",
"type": "nominal",
"sort": "ascending",
... | datasets/.dvc/plots/confusion.json/0 | {
"file_path": "datasets/.dvc/plots/confusion.json",
"repo_id": "datasets",
"token_count": 450
} | 97 |
# How to add one new datasets
Add datasets directly to the 🤗 Hugging Face Hub!
You can share your dataset on https://huggingface.co/datasets directly using your account, see the documentation:
* [Create a dataset and upload files on the website](https://huggingface.co/docs/datasets/upload_dataset)
* [Advanced guide... | datasets/ADD_NEW_DATASET.md/0 | {
"file_path": "datasets/ADD_NEW_DATASET.md",
"repo_id": "datasets",
"token_count": 113
} | 98 |
# Know your dataset
There are two types of dataset objects, a regular [`Dataset`] and then an ✨ [`IterableDataset`] ✨. A [`Dataset`] provides fast random access to the rows, and memory-mapping so that loading even large datasets only uses a relatively small amount of device memory. But for really, really big datasets ... | datasets/docs/source/access.mdx/0 | {
"file_path": "datasets/docs/source/access.mdx",
"repo_id": "datasets",
"token_count": 2326
} | 99 |
# Load image data
Image datasets have [`Image`] type columns, which contain PIL objects.
<Tip>
To work with image datasets, you need to have the `vision` dependency installed. Check out the [installation](./installation#vision) guide to learn how to install it.
</Tip>
When you load an image dataset and call the i... | datasets/docs/source/image_load.mdx/0 | {
"file_path": "datasets/docs/source/image_load.mdx",
"repo_id": "datasets",
"token_count": 1851
} | 100 |
# Process
🤗 Datasets provides many tools for modifying the structure and content of a dataset. These tools are important for tidying up a dataset, creating additional columns, converting between features and formats, and much more.
This guide will show you how to:
- Reorder rows and split the dataset.
- Rename and ... | datasets/docs/source/process.mdx/0 | {
"file_path": "datasets/docs/source/process.mdx",
"repo_id": "datasets",
"token_count": 12781
} | 101 |
# Use with PyTorch
This document is a quick introduction to using `datasets` with PyTorch, with a particular focus on how to get
`torch.Tensor` objects out of our datasets, and how to use a PyTorch `DataLoader` and a Hugging Face `Dataset`
with the best performance.
## Dataset format
By default, datasets return regu... | datasets/docs/source/use_with_pytorch.mdx/0 | {
"file_path": "datasets/docs/source/use_with_pytorch.mdx",
"repo_id": "datasets",
"token_count": 3446
} | 102 |
from argparse import ArgumentParser
from typing import Optional
from datasets.commands import BaseDatasetsCLICommand
from datasets.hub import delete_from_hub
def _command_factory(args):
return DeleteFromHubCommand(
args.dataset_id,
args.config_name,
args.token,
args.revision,
... | datasets/src/datasets/commands/delete_from_hub.py/0 | {
"file_path": "datasets/src/datasets/commands/delete_from_hub.py",
"repo_id": "datasets",
"token_count": 562
} | 103 |
import os
import sys
import warnings
from dataclasses import dataclass, field
from io import BytesIO
from typing import TYPE_CHECKING, Any, ClassVar, Optional, Union
import numpy as np
import pyarrow as pa
from .. import config
from ..download.download_config import DownloadConfig
from ..table import array_cast
from ... | datasets/src/datasets/features/image.py/0 | {
"file_path": "datasets/src/datasets/features/image.py",
"repo_id": "datasets",
"token_count": 7271
} | 104 |
# Copyright 2020 The HuggingFace 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
#
# Unless required by applicable law or ... | datasets/src/datasets/inspect.py/0 | {
"file_path": "datasets/src/datasets/inspect.py",
"repo_id": "datasets",
"token_count": 5953
} | 105 |
import itertools
from dataclasses import dataclass
from typing import Optional
import pyarrow as pa
import datasets
from datasets.table import table_cast
logger = datasets.utils.logging.get_logger(__name__)
@dataclass
class ArrowConfig(datasets.BuilderConfig):
"""BuilderConfig for Arrow."""
features: Opt... | datasets/src/datasets/packaged_modules/arrow/arrow.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/arrow/arrow.py",
"repo_id": "datasets",
"token_count": 1641
} | 106 |
import io
import itertools
from dataclasses import dataclass
from typing import Optional
import pandas as pd
import pyarrow as pa
import pyarrow.json as paj
import datasets
import datasets.config
from datasets.table import table_cast
from datasets.utils.file_utils import readline
logger = datasets.utils.logging.get... | datasets/src/datasets/packaged_modules/json/json.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/json/json.py",
"repo_id": "datasets",
"token_count": 4992
} | 107 |
#
# 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
} | 108 |
"""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
} | 109 |
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 sharding without ambiguity f... | datasets/src/datasets/utils/sharding.py/0 | {
"file_path": "datasets/src/datasets/utils/sharding.py",
"repo_id": "datasets",
"token_count": 1690
} | 110 |
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
} | 111 |
import copy
import os
from pathlib import Path
from typing import List
from unittest.mock import patch
import fsspec
import pytest
from fsspec.registry import _registry as _fsspec_registry
from fsspec.spec import AbstractFileSystem
from datasets.data_files import (
DataFilesDict,
DataFilesList,
DataFilesP... | datasets/tests/test_data_files.py/0 | {
"file_path": "datasets/tests/test_data_files.py",
"repo_id": "datasets",
"token_count": 12037
} | 112 |
import pytest
from datasets.exceptions import DatasetNotFoundError
from datasets.inspect import (
get_dataset_config_info,
get_dataset_config_names,
get_dataset_default_config_name,
get_dataset_infos,
get_dataset_split_names,
)
pytestmark = pytest.mark.integration
@pytest.mark.parametrize(
... | datasets/tests/test_inspect.py/0 | {
"file_path": "datasets/tests/test_inspect.py",
"repo_id": "datasets",
"token_count": 1987
} | 113 |
import asyncio
import importlib.metadata
import os
import re
import sys
import tempfile
import unittest
from contextlib import contextmanager
from copy import deepcopy
from distutils.util import strtobool
from enum import Enum
from importlib.util import find_spec
from pathlib import Path
from unittest.mock import patch... | datasets/tests/utils.py/0 | {
"file_path": "datasets/tests/utils.py",
"repo_id": "datasets",
"token_count": 6628
} | 114 |
from functools import partial
import torch
from benchmarking_utils import BenchmarkMixin, BenchmarkScenario, model_init_fn
from diffusers import LTXVideoTransformer3DModel
from diffusers.utils.testing_utils import torch_device
CKPT_ID = "Lightricks/LTX-Video-0.9.7-dev"
RESULT_FILENAME = "ltx.csv"
def get_input_di... | diffusers/benchmarks/benchmarking_ltx.py/0 | {
"file_path": "diffusers/benchmarks/benchmarking_ltx.py",
"repo_id": "diffusers",
"token_count": 1511
} | 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/api/loaders/textual_inversion.md/0 | {
"file_path": "diffusers/docs/source/en/api/loaders/textual_inversion.md",
"repo_id": "diffusers",
"token_count": 340
} | 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 agree... | diffusers/docs/source/en/api/models/autoencoderkl_cosmos.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/autoencoderkl_cosmos.md",
"repo_id": "diffusers",
"token_count": 413
} | 117 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/models/overview.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/overview.md",
"repo_id": "diffusers",
"token_count": 336
} | 118 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/pipelines/aura_flow.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/aura_flow.md",
"repo_id": "diffusers",
"token_count": 1479
} | 119 |
<!--Copyright 2025 The HuggingFace Team and Tencent Hunyuan 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... | diffusers/docs/source/en/api/pipelines/hunyuandit.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/hunyuandit.md",
"repo_id": "diffusers",
"token_count": 1472
} | 120 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/pipelines/stable_audio.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/stable_audio.md",
"repo_id": "diffusers",
"token_count": 1438
} | 121 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/pipelines/stable_diffusion/stable_diffusion_xl.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/stable_diffusion/stable_diffusion_xl.md",
"repo_id": "diffusers",
"token_count": 1106
} | 122 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/schedulers/cosine_dpm.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/cosine_dpm.md",
"repo_id": "diffusers",
"token_count": 358
} | 123 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/schedulers/ipndm.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/ipndm.md",
"repo_id": "diffusers",
"token_count": 295
} | 124 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/utilities.md/0 | {
"file_path": "diffusers/docs/source/en/api/utilities.md",
"repo_id": "diffusers",
"token_count": 387
} | 125 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/modular_diffusers/components_manager.md/0 | {
"file_path": "diffusers/docs/source/en/modular_diffusers/components_manager.md",
"repo_id": "diffusers",
"token_count": 2737
} | 126 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/optimization/neuron.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/neuron.md",
"repo_id": "diffusers",
"token_count": 1077
} | 127 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/stable_diffusion.md/0 | {
"file_path": "diffusers/docs/source/en/stable_diffusion.md",
"repo_id": "diffusers",
"token_count": 1720
} | 128 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/training/text2image.md/0 | {
"file_path": "diffusers/docs/source/en/training/text2image.md",
"repo_id": "diffusers",
"token_count": 4048
} | 129 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/using-diffusers/diffedit.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/diffedit.md",
"repo_id": "diffusers",
"token_count": 3847
} | 130 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/using-diffusers/scheduler_features.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/scheduler_features.md",
"repo_id": "diffusers",
"token_count": 4053
} | 131 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ja/quicktour.md/0 | {
"file_path": "diffusers/docs/source/ja/quicktour.md",
"repo_id": "diffusers",
"token_count": 7859
} | 132 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ko/optimization/mps.md/0 | {
"file_path": "diffusers/docs/source/ko/optimization/mps.md",
"repo_id": "diffusers",
"token_count": 2535
} | 133 |
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ko/training/overview.md/0 | {
"file_path": "diffusers/docs/source/ko/training/overview.md",
"repo_id": "diffusers",
"token_count": 4741
} | 134 |
<!--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/other-formats.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/other-formats.md",
"repo_id": "diffusers",
"token_count": 6828
} | 135 |
<!--版权 2025 The HuggingFace Team。保留所有权利。
根据Apache许可证,版本2.0("许可证")授权;除非符合许可证,否则不得使用此文件。您可以在
http://www.apache.org/licenses/LICENSE-2.0
获取许可证的副本。
除非适用法律要求或书面同意,根据许可证分发的软件是按"原样"分发的,没有任何形式的明示或暗示的担保或条件。有关许可证的特定语言,请参阅许可证。
-->
# 社区项目
欢迎来到社区项目。这个空间致力于展示我们充满活力的社区使用`diffusers`库创建的令人难以置信的工作和创新应用。
本节旨在:
- 突出使用`diffusers`构建... | diffusers/docs/source/zh/community_projects.md/0 | {
"file_path": "diffusers/docs/source/zh/community_projects.md",
"repo_id": "diffusers",
"token_count": 2255
} | 136 |
<!--版权所有 2025 The HuggingFace Team。保留所有权利。
根据Apache许可证2.0版("许可证")授权;除非符合许可证,否则不得使用此文件。您可以在以下位置获取许可证的副本:
http://www.apache.org/licenses/LICENSE-2.0
除非适用法律要求或书面同意,根据许可证分发的软件按"原样"分发,无任何明示或暗示的担保或条件。有关许可证下特定语言的权限和限制,请参阅许可证。
-->
# 概述
> [!WARNING]
> 模块化Diffusers正在积极开发中,其API可能会发生变化。
模块化Diffusers是一个统一的管道系统,通过*管道块*简化您的工作流程... | diffusers/docs/source/zh/modular_diffusers/overview.md/0 | {
"file_path": "diffusers/docs/source/zh/modular_diffusers/overview.md",
"repo_id": "diffusers",
"token_count": 1430
} | 137 |
<!--版权所有 2024 The HuggingFace Team。保留所有权利。
根据 Apache 许可证 2.0 版(“许可证”)授权;除非符合许可证,否则不得使用此文件。
您可以在以下网址获取许可证副本:
http://www.apache.org/licenses/LICENSE-2.0
除非适用法律要求或书面同意,根据许可证分发的软件按“原样”分发,不附带任何明示或暗示的担保或条件。有关许可证的特定语言,请参阅许可证。
-->
# 编译和卸载量化模型
优化模型通常涉及[推理速度](./fp16)和[内存使用](./memory)之间的权衡。例如,虽然[缓存](./cache)可以提高推理速度,但它也会增加内存... | diffusers/docs/source/zh/optimization/speed-memory-optims.md/0 | {
"file_path": "diffusers/docs/source/zh/optimization/speed-memory-optims.md",
"repo_id": "diffusers",
"token_count": 4097
} | 138 |
<!--版权声明 2025 由 HuggingFace 团队所有。保留所有权利。
根据 Apache 许可证 2.0 版("许可证")授权;除非符合许可证要求,否则不得使用本文件。
您可以通过以下网址获取许可证副本:
http://www.apache.org/licenses/LICENSE-2.0
除非适用法律要求或书面同意,本软件按"原样"分发,不附带任何明示或暗示的担保或条件。详见许可证中规定的特定语言权限和限制。
-->
# 文本反转(Textual Inversion)
[文本反转](https://hf.co/papers/2208.01618)是一种训练技术,仅需少量示例图像即可个性化图像生成模型。该技术通... | diffusers/docs/source/zh/training/text_inversion.md/0 | {
"file_path": "diffusers/docs/source/zh/training/text_inversion.md",
"repo_id": "diffusers",
"token_count": 6739
} | 139 |
# 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/examples/community/ddim_noise_comparative_analysis.py/0 | {
"file_path": "diffusers/examples/community/ddim_noise_comparative_analysis.py",
"repo_id": "diffusers",
"token_count": 3415
} | 140 |
# Copyright 2025 Long Lian, the GLIGEN 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... | diffusers/examples/community/llm_grounded_diffusion.py/0 | {
"file_path": "diffusers/examples/community/llm_grounded_diffusion.py",
"repo_id": "diffusers",
"token_count": 32839
} | 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/examples/community/pipeline_animatediff_img2video.py/0 | {
"file_path": "diffusers/examples/community/pipeline_animatediff_img2video.py",
"repo_id": "diffusers",
"token_count": 20617
} | 142 |
import inspect
import os
import numpy as np
import torch
import torch.nn.functional as nnf
from PIL import Image
from torch.optim.adam import Adam
from tqdm import tqdm
from diffusers import StableDiffusionPipeline
from diffusers.pipelines.stable_diffusion import StableDiffusionPipelineOutput
def retrieve_timesteps... | diffusers/examples/community/pipeline_null_text_inversion.py/0 | {
"file_path": "diffusers/examples/community/pipeline_null_text_inversion.py",
"repo_id": "diffusers",
"token_count": 5423
} | 143 |
from typing import Any, Callable, Dict, List, Optional, Union
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers import (
AutoencoderKL,
DDIMScheduler,
DiffusionPipeline,
LMSDiscreteScheduler,
PNDMScheduler,
StableDiffusionPipeline,
UNet2D... | diffusers/examples/community/stable_diffusion_comparison.py/0 | {
"file_path": "diffusers/examples/community/stable_diffusion_comparison.py",
"repo_id": "diffusers",
"token_count": 7371
} | 144 |
# Copyright 2025 Peter Willemsen <peter@codebuffet.co>. 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/examples/community/tiled_upscaling.py/0 | {
"file_path": "diffusers/examples/community/tiled_upscaling.py",
"repo_id": "diffusers",
"token_count": 5901
} | 145 |
# ControlNet training example for Stable Diffusion 3/3.5 (SD3/3.5)
The `train_controlnet_sd3.py` script shows how to implement the ControlNet training procedure and adapt it for [Stable Diffusion 3](https://huggingface.co/papers/2403.03206) and [Stable Diffusion 3.5](https://stability.ai/news/introducing-stable-diffus... | diffusers/examples/controlnet/README_sd3.md/0 | {
"file_path": "diffusers/examples/controlnet/README_sd3.md",
"repo_id": "diffusers",
"token_count": 2839
} | 146 |
# 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/custom_diffusion/test_custom_diffusion.py/0 | {
"file_path": "diffusers/examples/custom_diffusion/test_custom_diffusion.py",
"repo_id": "diffusers",
"token_count": 2234
} | 147 |
import warnings
from diffusers import StableDiffusionImg2ImgPipeline # noqa F401
warnings.warn(
"The `image_to_image.py` script is outdated. Please use directly `from diffusers import"
" StableDiffusionImg2ImgPipeline` instead."
)
| diffusers/examples/inference/image_to_image.py/0 | {
"file_path": "diffusers/examples/inference/image_to_image.py",
"repo_id": "diffusers",
"token_count": 84
} | 148 |
#!/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/diffusion_orpo/train_diffusion_orpo_sdxl_lora.py/0 | {
"file_path": "diffusers/examples/research_projects/diffusion_orpo/train_diffusion_orpo_sdxl_lora.py",
"repo_id": "diffusers",
"token_count": 19746
} | 149 |
import os
from typing import List
import faiss
import numpy as np
import torch
from datasets import Dataset, load_dataset
from PIL import Image
from transformers import CLIPImageProcessor, CLIPModel, PretrainedConfig
from diffusers import logging
logger = logging.get_logger(__name__) # pylint: disable=invalid-name... | diffusers/examples/research_projects/rdm/retriever.py/0 | {
"file_path": "diffusers/examples/research_projects/rdm/retriever.py",
"repo_id": "diffusers",
"token_count": 3929
} | 150 |
# Running Stable Diffusion 3 DreamBooth LoRA training under 16GB
This is an **EDUCATIONAL** project that provides utilities for DreamBooth LoRA training for [Stable Diffusion 3 (SD3)](ttps://huggingface.co/papers/2403.03206) under 16GB GPU VRAM. This means you can successfully try out this project using a [free-tier C... | diffusers/examples/research_projects/sd3_lora_colab/README.md/0 | {
"file_path": "diffusers/examples/research_projects/sd3_lora_colab/README.md",
"repo_id": "diffusers",
"token_count": 704
} | 151 |
torch~=2.7.0
transformers==4.46.1
sentencepiece
aiohttp
py-consul
prometheus_client >= 0.18.0
prometheus-fastapi-instrumentator >= 7.0.0
fastapi
uvicorn | diffusers/examples/server/requirements.in/0 | {
"file_path": "diffusers/examples/server/requirements.in",
"repo_id": "diffusers",
"token_count": 65
} | 152 |
# 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/unconditional_image_generation/test_unconditional.py/0 | {
"file_path": "diffusers/examples/unconditional_image_generation/test_unconditional.py",
"repo_id": "diffusers",
"token_count": 2492
} | 153 |
import argparse
import torch
from huggingface_hub import hf_hub_download
from diffusers.models.transformers.auraflow_transformer_2d import AuraFlowTransformer2DModel
def load_original_state_dict(args):
model_pt = hf_hub_download(repo_id=args.original_state_dict_repo_id, filename="aura_diffusion_pytorch_model.bi... | diffusers/scripts/convert_aura_flow_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_aura_flow_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 2540
} | 154 |
import argparse
from contextlib import nullcontext
import safetensors.torch
import torch
from accelerate import init_empty_weights
from huggingface_hub import hf_hub_download
from diffusers import AutoencoderKL, FluxTransformer2DModel
from diffusers.loaders.single_file_utils import convert_ldm_vae_checkpoint
from dif... | diffusers/scripts/convert_flux_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_flux_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 6443
} | 155 |
import argparse
from contextlib import nullcontext
import torch
from accelerate import init_empty_weights
from safetensors.torch import load_file
from transformers import T5EncoderModel, T5Tokenizer
from diffusers import AutoencoderKLMochi, FlowMatchEulerDiscreteScheduler, MochiPipeline, MochiTransformer3DModel
from ... | diffusers/scripts/convert_mochi_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_mochi_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 11197
} | 156 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.