text stringlengths 96 319k | id stringlengths 14 178 | metadata dict |
|---|---|---|
import { env } from "$env/dynamic/private";
import { buildPrompt } from "$lib/buildPrompt";
import { textGenerationStream } from "@huggingface/inference";
import type { Endpoint, EndpointMessage } from "../endpoints";
import { z } from "zod";
import {
createImageProcessorOptionsValidator,
makeImageProcessor,
type Im... | chat-ui/src/lib/server/endpoints/tgi/endpointTgi.ts/0 | {
"file_path": "chat-ui/src/lib/server/endpoints/tgi/endpointTgi.ts",
"repo_id": "chat-ui",
"token_count": 1016
} |
import pino from "pino";
import { dev } from "$app/environment";
import { env } from "$env/dynamic/private";
let options: pino.LoggerOptions = {};
if (dev) {
options = {
transport: {
target: "pino-pretty",
options: {
colorize: true,
},
},
};
}
export const logger = pino({ ...options, level: env.LO... | chat-ui/src/lib/server/logger.ts/0 | {
"file_path": "chat-ui/src/lib/server/logger.ts",
"repo_id": "chat-ui",
"token_count": 135
} |
import { env } from "$env/dynamic/private";
import { Client } from "@gradio/client";
import { SignJWT } from "jose";
import JSON5 from "json5";
import {
MessageToolUpdateType,
MessageUpdateType,
type MessageToolUpdate,
} from "$lib/types/MessageUpdate";
import { logger } from "$lib/server/logger";
export async funct... | chat-ui/src/lib/server/tools/utils.ts/0 | {
"file_path": "chat-ui/src/lib/server/tools/utils.ts",
"repo_id": "chat-ui",
"token_count": 1176
} |
import type { WebSearchScrapedSource, WebSearchSource } from "$lib/types/WebSearch";
import type { MessageWebSearchUpdate } from "$lib/types/MessageUpdate";
import { withPage } from "./playwright";
import { spatialParser } from "./parser";
import { htmlToMarkdownTree } from "../markdown/tree";
import { timeout } from ... | chat-ui/src/lib/server/websearch/scrape/scrape.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/scrape/scrape.ts",
"repo_id": "chat-ui",
"token_count": 863
} |
import { browser } from "$app/environment";
export function cookiesAreEnabled(): boolean {
if (!browser) return false;
if (navigator.cookieEnabled) return navigator.cookieEnabled;
// Create cookie
document.cookie = "cookietest=1";
const ret = document.cookie.indexOf("cookietest=") != -1;
// Delete cookie
docum... | chat-ui/src/lib/utils/cookiesAreEnabled.ts/0 | {
"file_path": "chat-ui/src/lib/utils/cookiesAreEnabled.ts",
"repo_id": "chat-ui",
"token_count": 127
} |
import type { Conversation } from "$lib/types/Conversation";
import type { Message } from "$lib/types/Message";
import { v4 } from "uuid";
export function addSibling(
conv: Pick<Conversation, "messages" | "rootMessageId">,
message: Omit<Message, "id">,
siblingId: Message["id"]
): Message["id"] {
if (conv.messages.... | chat-ui/src/lib/utils/tree/addSibling.ts/0 | {
"file_path": "chat-ui/src/lib/utils/tree/addSibling.ts",
"repo_id": "chat-ui",
"token_count": 439
} |
import { collections } from "$lib/server/database";
import { authCondition } from "$lib/server/auth";
import { z } from "zod";
import { models } from "$lib/server/models";
import { ObjectId } from "mongodb";
export async function GET({ locals, params }) {
const id = z.string().parse(params.id);
const convId = new Ob... | chat-ui/src/routes/api/conversation/[id]/+server.ts/0 | {
"file_path": "chat-ui/src/routes/api/conversation/[id]/+server.ts",
"repo_id": "chat-ui",
"token_count": 492
} |
<script lang="ts">
import { run } from "svelte/legacy";
import ChatWindow from "$lib/components/chat/ChatWindow.svelte";
import { pendingMessage } from "$lib/stores/pendingMessage";
import { isAborted } from "$lib/stores/isAborted";
import { onMount } from "svelte";
import { page } from "$app/state";
import { g... | chat-ui/src/routes/conversation/[id]/+page.svelte/0 | {
"file_path": "chat-ui/src/routes/conversation/[id]/+page.svelte",
"repo_id": "chat-ui",
"token_count": 5730
} |
<script lang="ts">
import type { PageData, ActionData } from "./$types";
import { page } from "$app/state";
import AssistantSettings from "$lib/components/AssistantSettings.svelte";
interface Props {
data: PageData;
form: ActionData;
}
let { data, form = $bindable() }: Props = $props();
let assistant = da... | chat-ui/src/routes/settings/(nav)/assistants/[assistantId]/edit/+page@settings.svelte/0 | {
"file_path": "chat-ui/src/routes/settings/(nav)/assistants/[assistantId]/edit/+page@settings.svelte",
"repo_id": "chat-ui",
"token_count": 156
} |
import { env } from "$env/dynamic/private";
import { authCondition, requiresUser } from "$lib/server/auth.js";
import { collections } from "$lib/server/database.js";
import { editableToolSchema } from "$lib/server/tools/index.js";
import { usageLimits } from "$lib/server/usageLimits.js";
import { ReviewStatus } from "$... | chat-ui/src/routes/tools/new/+page.server.ts/0 | {
"file_path": "chat-ui/src/routes/tools/new/+page.server.ts",
"repo_id": "chat-ui",
"token_count": 818
} |
const defaultTheme = require("tailwindcss/defaultTheme");
const colors = require("tailwindcss/colors");
/** @type {import('tailwindcss').Config} */
export default {
darkMode: "class",
mode: "jit",
content: ["./src/**/*.{html,js,svelte,ts}"],
theme: {
extend: {
colors: {
primary: colors[process.env.PUBLIC_... | chat-ui/tailwind.config.cjs/0 | {
"file_path": "chat-ui/tailwind.config.cjs",
"repo_id": "chat-ui",
"token_count": 220
} |
import json
import os
import tempfile
import datasets
from utils import generate_example_dataset, get_duration
SPEED_TEST_N_EXAMPLES = 50_000
SMALL_TEST = 5_000
RESULTS_BASEPATH, RESULTS_FILENAME = os.path.split(__file__)
RESULTS_FILE_PATH = os.path.join(RESULTS_BASEPATH, "results", RESULTS_FILENAME.replace(".py", ... | datasets/benchmarks/benchmark_iterating.py/0 | {
"file_path": "datasets/benchmarks/benchmark_iterating.py",
"repo_id": "datasets",
"token_count": 1697
} |
# Dataset features
[`Features`] defines the internal structure of a dataset. It is used to specify the underlying serialization format. What's more interesting to you though is that [`Features`] contains high-level information about everything from the column names and types, to the [`ClassLabel`]. You can think of [`... | datasets/docs/source/about_dataset_features.mdx/0 | {
"file_path": "datasets/docs/source/about_dataset_features.mdx",
"repo_id": "datasets",
"token_count": 2322
} |
# Main classes
## DatasetInfo
[[autodoc]] datasets.DatasetInfo
## Dataset
The base class [`Dataset`] implements a Dataset backed by an Apache Arrow table.
[[autodoc]] datasets.Dataset
- add_column
- add_item
- from_file
- from_buffer
- from_pandas
- from_dict
- from_generator
- dat... | datasets/docs/source/package_reference/main_classes.mdx/0 | {
"file_path": "datasets/docs/source/package_reference/main_classes.mdx",
"repo_id": "datasets",
"token_count": 1897
} |
# Use with Pandas
This document is a quick introduction to using `datasets` with Pandas, with a particular focus on how to process
datasets using Pandas functions, and how to convert a dataset to Pandas or from Pandas.
This is particularly useful as it allows fast operations, since `datasets` uses PyArrow under the h... | datasets/docs/source/use_with_pandas.mdx/0 | {
"file_path": "datasets/docs/source/use_with_pandas.mdx",
"repo_id": "datasets",
"token_count": 1012
} |
from typing import List, Optional, TypeVar
from .arrow_dataset import Dataset, _concatenate_map_style_datasets, _interleave_map_style_datasets
from .dataset_dict import DatasetDict, IterableDatasetDict
from .info import DatasetInfo
from .iterable_dataset import IterableDataset, _concatenate_iterable_datasets, _interle... | datasets/src/datasets/combine.py/0 | {
"file_path": "datasets/src/datasets/combine.py",
"repo_id": "datasets",
"token_count": 4607
} |
# SPDX-License-Identifier: Apache-2.0
# Copyright 2023 The HuggingFace Authors.
from typing import Any, Dict, List, Optional, Union
from huggingface_hub import HfFileSystem
from . import config
from .table import CastError
from .utils.track import TrackedIterableFromGenerator, tracked_list, tracked_str
class Datase... | datasets/src/datasets/exceptions.py/0 | {
"file_path": "datasets/src/datasets/exceptions.py",
"repo_id": "datasets",
"token_count": 1552
} |
# 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/torch_formatter.py/0 | {
"file_path": "datasets/src/datasets/formatting/torch_formatter.py",
"repo_id": "datasets",
"token_count": 2062
} |
# 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/naming.py/0 | {
"file_path": "datasets/src/datasets/naming.py",
"repo_id": "datasets",
"token_count": 1179
} |
import io
import json
import re
from itertools import islice
from typing import Any, Callable, Dict, List
import fsspec
import numpy as np
import pyarrow as pa
import datasets
from datasets.features.features import cast_to_python_objects
from datasets.utils.file_utils import SINGLE_FILE_COMPRESSION_EXTENSION_TO_PROTO... | datasets/src/datasets/packaged_modules/webdataset/webdataset.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/webdataset/webdataset.py",
"repo_id": "datasets",
"token_count": 4913
} |
import bz2
import gzip
import lzma
import os
import shutil
import struct
import tarfile
import warnings
import zipfile
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Dict, List, Optional, Type, Union
from .. import config
from ._filelock import FileLock
from .logging import get_logger
... | datasets/src/datasets/utils/extract.py/0 | {
"file_path": "datasets/src/datasets/utils/extract.py",
"repo_id": "datasets",
"token_count": 5809
} |
import numpy as np
def approximate_mode(class_counts, n_draws, rng):
"""Computes approximate mode of multivariate hypergeometric.
This is an approximation to the mode of the multivariate
hypergeometric given by class_counts and n_draws.
It shouldn't be off by more than one.
It is the mostly likely... | datasets/src/datasets/utils/stratify.py/0 | {
"file_path": "datasets/src/datasets/utils/stratify.py",
"repo_id": "datasets",
"token_count": 1670
} |
import os
from argparse import ArgumentParser
from typing import List
import torch.utils.data
from datasets import Dataset, IterableDataset
from datasets.distributed import split_dataset_by_node
NUM_SHARDS = 4
NUM_ITEMS_PER_SHARD = 3
class FailedTestError(RuntimeError):
pass
def gen(shards: List[str]):
... | datasets/tests/distributed_scripts/run_torch_distributed.py/0 | {
"file_path": "datasets/tests/distributed_scripts/run_torch_distributed.py",
"repo_id": "datasets",
"token_count": 617
} |
import contextlib
import csv
import json
import os
import sqlite3
import tarfile
import textwrap
import zipfile
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
import pytest
import datasets
import datasets.config
# dataset + arrow_file
@pytest.fixture(scope="session")
def dataset():
n = ... | datasets/tests/fixtures/files.py/0 | {
"file_path": "datasets/tests/fixtures/files.py",
"repo_id": "datasets",
"token_count": 8339
} |
import os
import textwrap
import pyarrow as pa
import pytest
from datasets import ClassLabel, Features, Image
from datasets.builder import InvalidConfigName
from datasets.data_files import DataFilesList
from datasets.packaged_modules.csv.csv import Csv, CsvConfig
from ..utils import require_pil
@pytest.fixture
def... | datasets/tests/packaged_modules/test_csv.py/0 | {
"file_path": "datasets/tests/packaged_modules/test_csv.py",
"repo_id": "datasets",
"token_count": 1880
} |
from unittest import TestCase
from datasets import Sequence, Value
from datasets.arrow_dataset import Dataset
class DatasetListTest(TestCase):
def _create_example_records(self):
return [
{"col_1": 3, "col_2": "a"},
{"col_1": 2, "col_2": "b"},
{"col_1": 1, "col_2": "c"}... | datasets/tests/test_dataset_list.py/0 | {
"file_path": "datasets/tests/test_dataset_list.py",
"repo_id": "datasets",
"token_count": 875
} |
import importlib
import os
import pickle
import shutil
import tempfile
import time
from hashlib import sha256
from multiprocessing import Pool
from pathlib import Path
from unittest import TestCase
from unittest.mock import patch
import dill
import pyarrow as pa
import pytest
import requests
import datasets
from data... | datasets/tests/test_load.py/0 | {
"file_path": "datasets/tests/test_load.py",
"repo_id": "datasets",
"token_count": 35796
} |
import argparse
import csv
import gc
import os
from dataclasses import dataclass
from typing import Dict, List, Union
import torch
import torch.utils.benchmark as benchmark
GITHUB_SHA = os.getenv("GITHUB_SHA", None)
BENCHMARK_FIELDS = [
"pipeline_cls",
"ckpt_id",
"batch_size",
"num_inference_steps",
... | diffusers/benchmarks/utils.py/0 | {
"file_path": "diffusers/benchmarks/utils.py",
"repo_id": "diffusers",
"token_count": 1254
} |
<!--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 to... | diffusers/docs/source/en/api/pipelines/kandinsky_v22.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/kandinsky_v22.md",
"repo_id": "diffusers",
"token_count": 1046
} |
<!--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/pix2pix.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/pix2pix.md",
"repo_id": "diffusers",
"token_count": 703
} |
<!--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_diffusion/latent_upscale.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/stable_diffusion/latent_upscale.md",
"repo_id": "diffusers",
"token_count": 543
} |
<!--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/optimization/fp16.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/fp16.md",
"repo_id": "diffusers",
"token_count": 2117
} |
<!-- 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/quantization/torchao.md/0 | {
"file_path": "diffusers/docs/source/en/quantization/torchao.md",
"repo_id": "diffusers",
"token_count": 2673
} |
<!--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/sdxl.md/0 | {
"file_path": "diffusers/docs/source/en/training/sdxl.md",
"repo_id": "diffusers",
"token_count": 4393
} |
<!--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/merge_loras.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/merge_loras.md",
"repo_id": "diffusers",
"token_count": 4779
} |
<!--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/unconditional_image_generation.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/unconditional_image_generation.md",
"repo_id": "diffusers",
"token_count": 635
} |
# 학습을 위한 데이터셋 만들기
[Hub](https://huggingface.co/datasets?task_categories=task_categories:text-to-image&sort=downloads) 에는 모델 교육을 위한 많은 데이터셋이 있지만,
관심이 있거나 사용하고 싶은 데이터셋을 찾을 수 없는 경우 🤗 [Datasets](https://huggingface.co/docs/datasets) 라이브러리를 사용하여 데이터셋을 만들 수 있습니다.
데이터셋 구조는 모델을 학습하려는 작업에 따라 달라집니다.
가장 기본적인 데이터셋 구조는 unconditio... | diffusers/docs/source/ko/training/create_dataset.md/0 | {
"file_path": "diffusers/docs/source/ko/training/create_dataset.md",
"repo_id": "diffusers",
"token_count": 3224
} |
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ko/using-diffusers/diffedit.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/diffedit.md",
"repo_id": "diffusers",
"token_count": 6631
} |
<!--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/write_own_pipeline.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/write_own_pipeline.md",
"repo_id": "diffusers",
"token_count": 9960
} |
# 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/advanced_diffusion_training/test_dreambooth_lora_flux_advanced.py/0 | {
"file_path": "diffusers/examples/advanced_diffusion_training/test_dreambooth_lora_flux_advanced.py",
"repo_id": "diffusers",
"token_count": 6082
} |
import inspect
from typing import List, Optional, Union
import torch
from torch import nn
from torch.nn import functional as F
from torchvision import transforms
from transformers import CLIPImageProcessor, CLIPModel, CLIPTextModel, CLIPTokenizer
from diffusers import (
AutoencoderKL,
DDIMScheduler,
DPMSo... | diffusers/examples/community/clip_guided_stable_diffusion.py/0 | {
"file_path": "diffusers/examples/community/clip_guided_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 6483
} |
import math
import tempfile
from typing import List, Optional
import numpy as np
import PIL.Image
import torch
from accelerate import Accelerator
from torchvision import transforms
from tqdm.auto import tqdm
from transformers import CLIPTextModel, CLIPTokenizer
from diffusers import AutoencoderKL, DiffusionPipeline, ... | diffusers/examples/community/sde_drag.py/0 | {
"file_path": "diffusers/examples/community/sde_drag.py",
"repo_id": "diffusers",
"token_count": 11672
} |
# Custom Diffusion training example
[Custom Diffusion](https://arxiv.org/abs/2212.04488) is a method to customize text-to-image models like Stable Diffusion given just a few (4~5) images of a subject.
The `train_custom_diffusion.py` script shows how to implement the training procedure and adapt it for stable diffusion... | diffusers/examples/custom_diffusion/README.md/0 | {
"file_path": "diffusers/examples/custom_diffusion/README.md",
"repo_id": "diffusers",
"token_count": 3533
} |
import torch
from diffusers import StableDiffusionPipeline
model_id = "path-to-your-trained-model"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")
prompt = "A photo of sks dog in a bucket"
image = pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]
imag... | diffusers/examples/research_projects/colossalai/inference.py/0 | {
"file_path": "diffusers/examples/research_projects/colossalai/inference.py",
"repo_id": "diffusers",
"token_count": 127
} |
# from accelerate.utils import write_basic_config
#
# write_basic_config()
import argparse
import logging
import math
import os
import shutil
from pathlib import Path
import accelerate
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
import transformers
from accelerate import Accelerator
from... | diffusers/examples/research_projects/gligen/train_gligen_text.py/0 | {
"file_path": "diffusers/examples/research_projects/gligen/train_gligen_text.py",
"repo_id": "diffusers",
"token_count": 13024
} |
#!/bin/bash
# run
# accelerate config
# check with
# accelerate env
export MODEL_DIR="PixArt-alpha/PixArt-XL-2-512x512"
export OUTPUT_DIR="output/pixart-controlnet-hf-diffusers-test"
accelerate launch ./train_pixart_controlnet_hf.py --mixed_precision="fp16" \
--pretrained_model_name_or_path=$MODEL_DIR \
--output_... | diffusers/examples/research_projects/pixart/train_controlnet_hf_diffusers.sh/0 | {
"file_path": "diffusers/examples/research_projects/pixart/train_controlnet_hf_diffusers.sh",
"repo_id": "diffusers",
"token_count": 240
} |
import time
import jax
import jax.numpy as jnp
import numpy as np
from flax.jax_utils import replicate
from jax import pmap
# Let's cache the model compilation, so that it doesn't take as long the next time around.
from jax.experimental.compilation_cache import compilation_cache as cc
from diffusers import FlaxStabl... | diffusers/examples/research_projects/sdxl_flax/sdxl_single_aot.py/0 | {
"file_path": "diffusers/examples/research_projects/sdxl_flax/sdxl_single_aot.py",
"repo_id": "diffusers",
"token_count": 1963
} |
# 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/t2i_adapter/test_t2i_adapter.py/0 | {
"file_path": "diffusers/examples/t2i_adapter/test_t2i_adapter.py",
"repo_id": "diffusers",
"token_count": 682
} |
## Textual Inversion fine-tuning example for SDXL
```sh
export MODEL_NAME="stabilityai/stable-diffusion-xl-base-1.0"
export DATA_DIR="./cat"
accelerate launch textual_inversion_sdxl.py \
--pretrained_model_name_or_path=$MODEL_NAME \
--train_data_dir=$DATA_DIR \
--learnable_property="object" \
--placeholder_to... | diffusers/examples/textual_inversion/README_sdxl.md/0 | {
"file_path": "diffusers/examples/textual_inversion/README_sdxl.md",
"repo_id": "diffusers",
"token_count": 537
} |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | diffusers/examples/vqgan/train_vqgan.py/0 | {
"file_path": "diffusers/examples/vqgan/train_vqgan.py",
"repo_id": "diffusers",
"token_count": 19248
} |
#!/usr/bin/env python3
import argparse
import math
import os
from copy import deepcopy
import requests
import torch
from audio_diffusion.models import DiffusionAttnUnet1D
from diffusion import sampling
from torch import nn
from diffusers import DanceDiffusionPipeline, IPNDMScheduler, UNet1DModel
MODELS_MAP = {
... | diffusers/scripts/convert_dance_diffusion_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_dance_diffusion_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 4637
} |
import argparse
import tempfile
import torch
from accelerate import load_checkpoint_and_dispatch
from transformers import CLIPTextModelWithProjection, CLIPTokenizer
from diffusers import UnCLIPPipeline, UNet2DConditionModel, UNet2DModel
from diffusers.models.transformers.prior_transformer import PriorTransformer
from... | diffusers/scripts/convert_kakao_brain_unclip_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_kakao_brain_unclip_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 18242
} |
# 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
} |
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
} |
# 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
} |
# 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_conversion_utils.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/lora_conversion_utils.py",
"repo_id": "diffusers",
"token_count": 28355
} |
# 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/attention.py/0 | {
"file_path": "diffusers/src/diffusers/models/attention.py",
"repo_id": "diffusers",
"token_count": 24281
} |
# 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/vae.py/0 | {
"file_path": "diffusers/src/diffusers/models/autoencoders/vae.py",
"repo_id": "diffusers",
"token_count": 15722
} |
import os
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import torch
from torch import nn
from ...models.controlnets.controlnet import ControlNetModel, ControlNetOutput
from ...models.modeling_utils import ModelMixin
from ...utils import logging
logger = logging.get_logger(__name__)
class M... | diffusers/src/diffusers/models/controlnets/multicontrolnet.py/0 | {
"file_path": "diffusers/src/diffusers/models/controlnets/multicontrolnet.py",
"repo_id": "diffusers",
"token_count": 3881
} |
# Copyright 2024 The CogVideoX team, Tsinghua University & ZhipuAI 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.o... | diffusers/src/diffusers/models/transformers/cogvideox_transformer_3d.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/cogvideox_transformer_3d.py",
"repo_id": "diffusers",
"token_count": 10182
} |
# Copyright 2024 The Hunyuan Team and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | diffusers/src/diffusers/models/transformers/transformer_hunyuan_video.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/transformer_hunyuan_video.py",
"repo_id": "diffusers",
"token_count": 14518
} |
# 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/unets/unet_kandinsky3.py/0 | {
"file_path": "diffusers/src/diffusers/models/unets/unet_kandinsky3.py",
"repo_id": "diffusers",
"token_count": 9581
} |
# 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/pipelines/amused/pipeline_amused_img2img.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/amused/pipeline_amused_img2img.py",
"repo_id": "diffusers",
"token_count": 7695
} |
# Copyright 2024 AuraFlow Authors and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | diffusers/src/diffusers/pipelines/aura_flow/pipeline_aura_flow.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/aura_flow/pipeline_aura_flow.py",
"repo_id": "diffusers",
"token_count": 12668
} |
# 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/pipelines/ddpm/pipeline_ddpm.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/ddpm/pipeline_ddpm.py",
"repo_id": "diffusers",
"token_count": 2200
} |
# Copyright 2022 The Music Spectrogram Diffusion Authors.
# 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... | diffusers/src/diffusers/pipelines/deprecated/spectrogram_diffusion/midi_utils.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/spectrogram_diffusion/midi_utils.py",
"repo_id": "diffusers",
"token_count": 10185
} |
# 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/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_image_variation.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion_image_variation.py",
"repo_id": "diffusers",
"token_count": 8244
} |
import inspect
import math
from itertools import repeat
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import torch
import torch.nn.functional as F
from packaging import version
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from ...configuration_utils import FrozenDic... | diffusers/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/ledits_pp/pipeline_leditspp_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 36663
} |
# 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/pipelines/stable_cascade/pipeline_stable_cascade.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade.py",
"repo_id": "diffusers",
"token_count": 11845
} |
# 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/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py",
"repo_id": "diffusers",
"token_count": 19605
} |
# Copyright 2024 Stability AI and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | diffusers/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py",
"repo_id": "diffusers",
"token_count": 31184
} |
from dataclasses import dataclass
from typing import List, Optional, Union
import numpy as np
import PIL.Image
from ...utils import (
BaseOutput,
)
@dataclass
class StableDiffusionSafePipelineOutput(BaseOutput):
"""
Output class for Safe Stable Diffusion pipelines.
Args:
images (`List[PIL.I... | diffusers/src/diffusers/pipelines/stable_diffusion_safe/pipeline_output.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_safe/pipeline_output.py",
"repo_id": "diffusers",
"token_count": 527
} |
import inspect
from dataclasses import dataclass
from typing import Callable, List, Optional, Union
import numpy as np
import PIL.Image
import torch
from transformers import (
CLIPImageProcessor,
CLIPTextModel,
CLIPTokenizer,
CLIPVisionModelWithProjection,
GPT2Tokenizer,
)
from ...image_processor ... | diffusers/src/diffusers/pipelines/unidiffuser/pipeline_unidiffuser.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/unidiffuser/pipeline_unidiffuser.py",
"repo_id": "diffusers",
"token_count": 31161
} |
# Copyright 2024 Katherine Crowson and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | diffusers/src/diffusers/schedulers/scheduling_edm_euler.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_edm_euler.py",
"repo_id": "diffusers",
"token_count": 8158
} |
# Copyright 2024 ETH Zurich Computer Vision Lab and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | diffusers/src/diffusers/schedulers/scheduling_repaint.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_repaint.py",
"repo_id": "diffusers",
"token_count": 6642
} |
# This file is autogenerated by the command `make fix-copies`, do not edit.
from ..utils import DummyObject, requires_backends
class FlaxStableDiffusionControlNetPipeline(metaclass=DummyObject):
_backends = ["flax", "transformers"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax",... | diffusers/src/diffusers/utils/dummy_flax_and_transformers_objects.py/0 | {
"file_path": "diffusers/src/diffusers/utils/dummy_flax_and_transformers_objects.py",
"repo_id": "diffusers",
"token_count": 957
} |
# 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/utils/import_utils.py/0 | {
"file_path": "diffusers/src/diffusers/utils/import_utils.py",
"repo_id": "diffusers",
"token_count": 12188
} |
# 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/tests/models/autoencoders/test_models_autoencoder_dc.py/0 | {
"file_path": "diffusers/tests/models/autoencoders/test_models_autoencoder_dc.py",
"repo_id": "diffusers",
"token_count": 1183
} |
import inspect
from diffusers.utils import is_flax_available
from diffusers.utils.testing_utils import require_flax
if is_flax_available():
import jax
@require_flax
class FlaxModelTesterMixin:
def test_output(self):
init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common()
mo... | diffusers/tests/models/test_modeling_common_flax.py/0 | {
"file_path": "diffusers/tests/models/test_modeling_common_flax.py",
"repo_id": "diffusers",
"token_count": 1124
} |
# 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/tests/models/transformers/test_models_transformer_mochi.py/0 | {
"file_path": "diffusers/tests/models/transformers/test_models_transformer_mochi.py",
"repo_id": "diffusers",
"token_count": 1188
} |
# 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/tests/others/test_check_dummies.py/0 | {
"file_path": "diffusers/tests/others/test_check_dummies.py",
"repo_id": "diffusers",
"token_count": 1872
} |
import gc
import unittest
import numpy as np
import pytest
import torch
from huggingface_hub import hf_hub_download
from transformers import AutoTokenizer, CLIPTextConfig, CLIPTextModel, CLIPTokenizer, T5EncoderModel
from diffusers import AutoencoderKL, FlowMatchEulerDiscreteScheduler, FluxPipeline, FluxTransformer2D... | diffusers/tests/pipelines/flux/test_pipeline_flux.py/0 | {
"file_path": "diffusers/tests/pipelines/flux/test_pipeline_flux.py",
"repo_id": "diffusers",
"token_count": 7539
} |
# Copyright 2024 The HuggingFace 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 law or agreed to in... | diffusers/tests/pipelines/ltx/test_ltx.py/0 | {
"file_path": "diffusers/tests/pipelines/ltx/test_ltx.py",
"repo_id": "diffusers",
"token_count": 4586
} |
# 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/tests/pipelines/pag/test_pag_controlnet_sdxl_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/pag/test_pag_controlnet_sdxl_img2img.py",
"repo_id": "diffusers",
"token_count": 4823
} |
import random
import unittest
import numpy as np
import torch
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer
import diffusers
from diffusers import (
AutoencoderKL,
DDIMScheduler,
DPMSolverMultistepScheduler,
LCMScheduler,
MotionAdapter,
PIAPipeline,
StableDiffusionP... | diffusers/tests/pipelines/pia/test_pia.py/0 | {
"file_path": "diffusers/tests/pipelines/pia/test_pia.py",
"repo_id": "diffusers",
"token_count": 7939
} |
# 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/tests/pipelines/stable_audio/test_stable_audio.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_audio/test_stable_audio.py",
"repo_id": "diffusers",
"token_count": 7648
} |
# 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/tests/pipelines/stable_diffusion_2/test_stable_diffusion_attend_and_excite.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_attend_and_excite.py",
"repo_id": "diffusers",
"token_count": 4018
} |
# 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/tests/pipelines/stable_diffusion_gligen/test_stable_diffusion_gligen.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_gligen/test_stable_diffusion_gligen.py",
"repo_id": "diffusers",
"token_count": 2800
} |
# 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/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl.py",
"repo_id": "diffusers",
"token_count": 22330
} |
# 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/tests/pipelines/test_pipelines_flax.py/0 | {
"file_path": "diffusers/tests/pipelines/test_pipelines_flax.py",
"repo_id": "diffusers",
"token_count": 4559
} |
The tests here are adapted from [`transformers` tests](https://github.com/huggingface/transformers/tree/409fcfdfccde77a14b7cc36972b774cabc371ae1/tests/quantization/bnb).
They were conducted on the `audace` machine, using a single RTX 4090. Below is `nvidia-smi`:
```bash
+----------------------------------------------... | diffusers/tests/quantization/bnb/README.md/0 | {
"file_path": "diffusers/tests/quantization/bnb/README.md",
"repo_id": "diffusers",
"token_count": 1033
} |
import tempfile
import torch
from diffusers import DPMSolverMultistepInverseScheduler, DPMSolverMultistepScheduler
from .test_schedulers import SchedulerCommonTest
class DPMSolverMultistepSchedulerTest(SchedulerCommonTest):
scheduler_classes = (DPMSolverMultistepInverseScheduler,)
forward_default_kwargs = ... | diffusers/tests/schedulers/test_scheduler_dpm_multi_inverse.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_dpm_multi_inverse.py",
"repo_id": "diffusers",
"token_count": 5529
} |
import tempfile
import unittest
import numpy as np
import torch
from diffusers import ScoreSdeVeScheduler
class ScoreSdeVeSchedulerTest(unittest.TestCase):
# TODO adapt with class SchedulerCommonTest (scheduler needs Numpy Integration)
scheduler_classes = (ScoreSdeVeScheduler,)
forward_default_kwargs = ... | diffusers/tests/schedulers/test_scheduler_score_sde_ve.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_score_sde_ve.py",
"repo_id": "diffusers",
"token_count": 3215
} |
# 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/utils/check_table.py/0 | {
"file_path": "diffusers/utils/check_table.py",
"repo_id": "diffusers",
"token_count": 3011
} |
#!/usr/bin/env python
# Copyright 2024 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
#
# ... | lerobot/benchmarks/video/capture_camera_feed.py/0 | {
"file_path": "lerobot/benchmarks/video/capture_camera_feed.py",
"repo_id": "lerobot",
"token_count": 1061
} |
import shutil
from pathlib import Path
import numpy as np
import torch
from lerobot.common.datasets.lerobot_dataset import LEROBOT_HOME, LeRobotDataset
from lerobot.common.datasets.push_dataset_to_hub._download_raw import download_raw
PUSHT_TASK = "Push the T-shaped blue block onto the T-shaped green target surface.... | lerobot/examples/port_datasets/pusht_zarr.py/0 | {
"file_path": "lerobot/examples/port_datasets/pusht_zarr.py",
"repo_id": "lerobot",
"token_count": 3177
} |
#!/usr/bin/env python
# Copyright 2024 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
#
# ... | lerobot/lerobot/common/datasets/sampler.py/0 | {
"file_path": "lerobot/lerobot/common/datasets/sampler.py",
"repo_id": "lerobot",
"token_count": 952
} |
#!/usr/bin/env python
# Copyright 2024 Tony Z. Zhao and 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... | lerobot/lerobot/common/policies/act/configuration_act.py/0 | {
"file_path": "lerobot/lerobot/common/policies/act/configuration_act.py",
"repo_id": "lerobot",
"token_count": 3354
} |
#!/usr/bin/env python
# Copyright 2024 Nicklas Hansen, Xiaolong Wang, Hao Su,
# and 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
#
# ht... | lerobot/lerobot/common/policies/tdmpc/modeling_tdmpc.py/0 | {
"file_path": "lerobot/lerobot/common/policies/tdmpc/modeling_tdmpc.py",
"repo_id": "lerobot",
"token_count": 17261
} |
"""Logic to calibrate a robot arm built with dynamixel motors"""
# TODO(rcadene, aliberts): move this logic into the robot code when refactoring
import numpy as np
from lerobot.common.robot_devices.motors.dynamixel import (
CalibrationMode,
TorqueMode,
convert_degrees_to_steps,
)
from lerobot.common.robot... | lerobot/lerobot/common/robot_devices/robots/dynamixel_calibration.py/0 | {
"file_path": "lerobot/lerobot/common/robot_devices/robots/dynamixel_calibration.py",
"repo_id": "lerobot",
"token_count": 2148
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.