text stringlengths 7 1.24M | id stringlengths 14 166 | metadata dict | __index_level_0__ int64 0 519 |
|---|---|---|---|
import { MetricsServer } from "$lib/server/metrics";
import type { WebSearchScrapedSource, WebSearchUsedSource } from "$lib/types/WebSearch";
import type { EmbeddingBackendModel } from "../../embeddingModels";
import { getSentenceSimilarity, innerProduct } from "../../sentenceSimilarity";
import { MarkdownElementType, ... | chat-ui/src/lib/server/websearch/embed/embed.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/embed/embed.ts",
"repo_id": "chat-ui",
"token_count": 1027
} | 68 |
import { env } from "$env/dynamic/private";
import { logger } from "$lib/server/logger";
import type { WebSearchSource } from "$lib/types/WebSearch";
import { isURL } from "$lib/utils/isUrl";
export default async function searchSearxng(query: string): Promise<WebSearchSource[]> {
const abortController = new AbortCont... | chat-ui/src/lib/server/websearch/search/endpoints/searxng.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/search/endpoints/searxng.ts",
"repo_id": "chat-ui",
"token_count": 417
} | 69 |
import { writable } from "svelte/store";
export interface WebSearchParameters {
useSearch: boolean;
nItems: number;
}
export const webSearchParameters = writable<WebSearchParameters>({
useSearch: false,
nItems: 5,
});
| chat-ui/src/lib/stores/webSearchParameters.ts/0 | {
"file_path": "chat-ui/src/lib/stores/webSearchParameters.ts",
"repo_id": "chat-ui",
"token_count": 68
} | 70 |
import { defaultModel } from "$lib/server/models";
import type { Assistant } from "./Assistant";
import type { Timestamps } from "./Timestamps";
import type { User } from "./User";
export interface Settings extends Timestamps {
userId?: User["_id"];
sessionId?: string;
/**
* Note: Only conversations with this se... | chat-ui/src/lib/types/Settings.ts/0 | {
"file_path": "chat-ui/src/lib/types/Settings.ts",
"repo_id": "chat-ui",
"token_count": 353
} | 71 |
export function getHref(
url: URL | string,
modifications: {
newKeys?: Record<string, string | undefined | null>;
existingKeys?: { behaviour: "delete_except" | "delete"; keys: string[] };
}
) {
const newUrl = new URL(url);
const { newKeys, existingKeys } = modifications;
// exsiting keys logic
if (existingK... | chat-ui/src/lib/utils/getHref.ts/0 | {
"file_path": "chat-ui/src/lib/utils/getHref.ts",
"repo_id": "chat-ui",
"token_count": 373
} | 72 |
export function sum(nums: number[]): number {
return nums.reduce((a, b) => a + b, 0);
}
| chat-ui/src/lib/utils/sum.ts/0 | {
"file_path": "chat-ui/src/lib/utils/sum.ts",
"repo_id": "chat-ui",
"token_count": 35
} | 73 |
import type { LayoutServerLoad } from "./$types";
import { collections } from "$lib/server/database";
import type { Conversation } from "$lib/types/Conversation";
import { UrlDependency } from "$lib/types/UrlDependency";
import { defaultModel, models, oldModels, validateModel } from "$lib/server/models";
import { authC... | chat-ui/src/routes/+layout.server.ts/0 | {
"file_path": "chat-ui/src/routes/+layout.server.ts",
"repo_id": "chat-ui",
"token_count": 3166
} | 74 |
<script lang="ts">
import { base } from "$app/paths";
import { clickOutside } from "$lib/actions/clickOutside";
import { afterNavigate, goto } from "$app/navigation";
import { useSettingsStore } from "$lib/stores/settings";
import type { PageData } from "./$types";
import { applyAction, enhance } from "$app/form... | chat-ui/src/routes/assistant/[assistantId]/+page.svelte/0 | {
"file_path": "chat-ui/src/routes/assistant/[assistantId]/+page.svelte",
"repo_id": "chat-ui",
"token_count": 1829
} | 75 |
import { redirect } from "@sveltejs/kit";
import { getOIDCAuthorizationUrl } from "$lib/server/auth";
import { base } from "$app/paths";
import { env } from "$env/dynamic/private";
export const actions = {
async default({ url, locals, request }) {
const referer = request.headers.get("referer");
let redirectURI = ... | chat-ui/src/routes/login/+page.server.ts/0 | {
"file_path": "chat-ui/src/routes/login/+page.server.ts",
"repo_id": "chat-ui",
"token_count": 280
} | 76 |
import { base } from "$app/paths";
import { redirect } from "@sveltejs/kit";
export async function load({ parent, params }) {
const data = await parent();
const model = data.models.find((m: { id: string }) => m.id === params.model);
if (!model || model.unlisted) {
redirect(302, `${base}/settings`);
}
return ... | chat-ui/src/routes/settings/(nav)/[...model]/+page.ts/0 | {
"file_path": "chat-ui/src/routes/settings/(nav)/[...model]/+page.ts",
"repo_id": "chat-ui",
"token_count": 111
} | 77 |
<script lang="ts">
import {
ToolOutputComponents,
type CommunityToolEditable,
type ToolInput,
} from "$lib/types/Tool";
import { createEventDispatcher, onMount } from "svelte";
import { browser } from "$app/environment";
import ToolLogo from "$lib/components/ToolLogo.svelte";
import { colors, icons } from "... | chat-ui/src/routes/tools/ToolEdit.svelte/0 | {
"file_path": "chat-ui/src/routes/tools/ToolEdit.svelte",
"repo_id": "chat-ui",
"token_count": 10116
} | 78 |
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "ES2018"
},
"exclude": ["vite.config.t... | chat-ui/tsconfig.json/0 | {
"file_path": "chat-ui/tsconfig.json",
"repo_id": "chat-ui",
"token_count": 211
} | 79 |
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
} | 80 |
# 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": 2334
} | 81 |
# Overview
The how-to guides offer a more comprehensive overview of all the tools 🤗 Datasets offers and how to use them. This will help you tackle messier real-world datasets where you may need to manipulate the dataset structure or content to get it ready for training.
The guides assume you are familiar and comfort... | datasets/docs/source/how_to.md/0 | {
"file_path": "datasets/docs/source/how_to.md",
"repo_id": "datasets",
"token_count": 469
} | 82 |
# 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": 1864
} | 83 |
# Use with Spark
This document is a quick introduction to using 🤗 Datasets with Spark, with a particular focus on how to load a Spark DataFrame into a [`Dataset`] object.
From there, you have fast access to any element and you can use it as a data loader to train models.
## Load from Spark
A [`Dataset`] object is ... | datasets/docs/source/use_with_spark.mdx/0 | {
"file_path": "datasets/docs/source/use_with_spark.mdx",
"repo_id": "datasets",
"token_count": 962
} | 84 |
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
} | 85 |
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Union
import pyarrow as pa
if TYPE_CHECKING:
from .features import FeatureType
@dataclass
class Translation:
"""`Feature` for translations with fixed languages per example.
Here for compatibl... | datasets/src/datasets/features/translation.py/0 | {
"file_path": "datasets/src/datasets/features/translation.py",
"repo_id": "datasets",
"token_count": 1678
} | 86 |
import multiprocessing
import os
from typing import BinaryIO, Optional, Union
import fsspec
from .. import Dataset, Features, NamedSplit, config
from ..formatting import query_table
from ..packaged_modules.csv.csv import Csv
from ..utils import tqdm as hf_tqdm
from ..utils.typing import NestedDataStructureLike, PathL... | datasets/src/datasets/io/csv.py/0 | {
"file_path": "datasets/src/datasets/io/csv.py",
"repo_id": "datasets",
"token_count": 2556
} | 87 |
from typing import Any, Dict, List, Optional, Union
from huggingface_hub.utils import get_session
from .. import config
from ..exceptions import DatasetsError
from .file_utils import (
get_authentication_headers_for_url,
)
from .logging import get_logger
logger = get_logger(__name__)
class DatasetViewerError(... | datasets/src/datasets/utils/_dataset_viewer.py/0 | {
"file_path": "datasets/src/datasets/utils/_dataset_viewer.py",
"repo_id": "datasets",
"token_count": 1884
} | 88 |
{
"language": [
"found",
"crowdsourced",
"expert-generated",
"machine-generated",
"other"
],
"annotations": [
"found",
"crowdsourced",
"expert-generated",
"machine-generated",
"no-annotation",
"other"
]
}
| datasets/src/datasets/utils/resources/creators.json/0 | {
"file_path": "datasets/src/datasets/utils/resources/creators.json",
"repo_id": "datasets",
"token_count": 119
} | 89 |
import os
import tarfile
import pyarrow as pa
import pytest
from datasets import Dataset, concatenate_datasets, load_dataset
from datasets.features import Audio, Features, Sequence, Value
from ..utils import (
require_librosa,
require_sndfile,
)
@pytest.fixture()
def tar_wav_path(shared_datadir, tmp_path_f... | datasets/tests/features/test_audio.py/0 | {
"file_path": "datasets/tests/features/test_audio.py",
"repo_id": "datasets",
"token_count": 11701
} | 90 |
import copy
import os
import tempfile
from unittest import TestCase
from unittest.mock import patch
import numpy as np
import pyarrow as pa
import pyarrow.parquet as pq
import pytest
from datasets.arrow_writer import ArrowWriter, OptimizedTypedSequence, ParquetWriter, TypedSequence
from datasets.features import Array... | datasets/tests/test_arrow_writer.py/0 | {
"file_path": "datasets/tests/test_arrow_writer.py",
"repo_id": "datasets",
"token_count": 6236
} | 91 |
import os
import pytest
import yaml
from datasets.features.features import Features, Value
from datasets.info import DatasetInfo, DatasetInfosDict
from datasets.utils.py_utils import asdict
@pytest.mark.parametrize(
"files",
[
["full:README.md", "dataset_infos.json"],
["empty:README.md", "da... | datasets/tests/test_info.py/0 | {
"file_path": "datasets/tests/test_info.py",
"repo_id": "datasets",
"token_count": 2860
} | 92 |
import fnmatch
import gc
import os
import shutil
import tempfile
import textwrap
import time
import unittest
from io import BytesIO
from pathlib import Path
from unittest.mock import patch
import numpy as np
import pytest
from huggingface_hub import DatasetCard, HfApi
from datasets import (
Audio,
ClassLabel,... | datasets/tests/test_upstream_hub.py/0 | {
"file_path": "datasets/tests/test_upstream_hub.py",
"repo_id": "datasets",
"token_count": 23090
} | 93 |
# Mid-way Recap [[mid-way-recap]]
Before diving into Q-Learning, let's summarize what we've just learned.
We have two types of value-based functions:
- State-value function: outputs the expected return if **the agent starts at a given state and acts according to the policy forever after.**
- Action-value function: o... | deep-rl-class/units/en/unit2/mid-way-recap.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit2/mid-way-recap.mdx",
"repo_id": "deep-rl-class",
"token_count": 317
} | 94 |
# Additional Readings
These are **optional readings** if you want to go deeper.
## Introduction to Policy Optimization
- [Part 3: Intro to Policy Optimization - Spinning Up documentation](https://spinningup.openai.com/en/latest/spinningup/rl_intro3.html)
## Policy Gradient
- [https://johnwlambert.github.io/polic... | deep-rl-class/units/en/unit4/additional-readings.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit4/additional-readings.mdx",
"repo_id": "deep-rl-class",
"token_count": 281
} | 95 |
# The Pyramid environment
The goal in this environment is to train our agent to **get the gold brick on the top of the Pyramid. To do that, it needs to press a button to spawn a Pyramid, navigate to the Pyramid, knock it over, and move to the gold brick at the top**.
<img src="https://huggingface.co/datasets/huggingf... | deep-rl-class/units/en/unit5/pyramids.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit5/pyramids.mdx",
"repo_id": "deep-rl-class",
"token_count": 645
} | 96 |
# Quiz
The best way to learn and [to avoid the illusion of competence](https://www.coursera.org/lecture/learning-how-to-learn/illusions-of-competence-BuFzf) **is to test yourself.** This will help you to find **where you need to reinforce your knowledge**.
### Q1: Chose the option which fits better when comparing di... | deep-rl-class/units/en/unit7/quiz.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit7/quiz.mdx",
"repo_id": "deep-rl-class",
"token_count": 1361
} | 97 |
# Let's train and play with Huggy 🐶 [[train]]
<CourseFloatingBanner classNames="absolute z-10 right-0 top-0"
notebooks={[
{label: "Google Colab", value: "https://colab.research.google.com/github/huggingface/deep-rl-class/blob/master/notebooks/bonus-unit1/bonus-unit1.ipynb"}
... | deep-rl-class/units/en/unitbonus1/train.mdx/0 | {
"file_path": "deep-rl-class/units/en/unitbonus1/train.mdx",
"repo_id": "deep-rl-class",
"token_count": 4041
} | 98 |
# Student Works
Since the launch of the Deep Reinforcement Learning Course, **many students have created amazing projects that you should check out and consider participating in**.
If you've created an interesting project, don't hesitate to [add it to this list by opening a pull request on the GitHub repository](http... | deep-rl-class/units/en/unitbonus3/student-works.mdx/0 | {
"file_path": "deep-rl-class/units/en/unitbonus3/student-works.mdx",
"repo_id": "deep-rl-class",
"token_count": 629
} | 99 |
import argparse
import sys
sys.path.append(".")
from base_classes import ImageToImageBenchmark, TurboImageToImageBenchmark # noqa: E402
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--ckpt",
type=str,
default="runwayml/stable-diffusion-v1-5",
... | diffusers/benchmarks/benchmark_sd_img.py/0 | {
"file_path": "diffusers/benchmarks/benchmark_sd_img.py",
"repo_id": "diffusers",
"token_count": 415
} | 100 |
<!--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/loaders/unet.md/0 | {
"file_path": "diffusers/docs/source/en/api/loaders/unet.md",
"repo_id": "diffusers",
"token_count": 406
} | 101 |
<!--Copyright 2024 The HuggingFace Team and The InstantX Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by ap... | diffusers/docs/source/en/api/pipelines/controlnet_flux.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/controlnet_flux.md",
"repo_id": "diffusers",
"token_count": 881
} | 102 |
<!--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/kandinsky3.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/kandinsky3.md",
"repo_id": "diffusers",
"token_count": 764
} | 103 |
<!--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/overview.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/stable_diffusion/overview.md",
"repo_id": "diffusers",
"token_count": 4759
} | 104 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/schedulers/heun.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/heun.md",
"repo_id": "diffusers",
"token_count": 306
} | 105 |
<!--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/utilities.md/0 | {
"file_path": "diffusers/docs/source/en/api/utilities.md",
"repo_id": "diffusers",
"token_count": 329
} | 106 |
<!--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/mps.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/mps.md",
"repo_id": "diffusers",
"token_count": 1061
} | 107 |
<!--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/instructpix2pix.md/0 | {
"file_path": "diffusers/docs/source/en/training/instructpix2pix.md",
"repo_id": "diffusers",
"token_count": 4157
} | 108 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/tutorials/using_peft_for_inference.md/0 | {
"file_path": "diffusers/docs/source/en/tutorials/using_peft_for_inference.md",
"repo_id": "diffusers",
"token_count": 3362
} | 109 |
<!--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/loading_adapters.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/loading_adapters.md",
"repo_id": "diffusers",
"token_count": 5734
} | 110 |
<!--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/text-img2vid.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/text-img2vid.md",
"repo_id": "diffusers",
"token_count": 7527
} | 111 |
<!--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/conceptual/evaluation.md/0 | {
"file_path": "diffusers/docs/source/ko/conceptual/evaluation.md",
"repo_id": "diffusers",
"token_count": 16734
} | 112 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ko/training/adapt_a_model.md/0 | {
"file_path": "diffusers/docs/source/ko/training/adapt_a_model.md",
"repo_id": "diffusers",
"token_count": 1826
} | 113 |
<!--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/custom_pipeline_overview.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/custom_pipeline_overview.md",
"repo_id": "diffusers",
"token_count": 2382
} | 114 |
<!--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/unconditional_image_generation.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/unconditional_image_generation.md",
"repo_id": "diffusers",
"token_count": 1740
} | 115 |
import math
import numbers
from typing import Any, Callable, Dict, List, Optional, Union
import torch
import torch.nn.functional as F
from torch import nn
from diffusers.image_processor import PipelineImageInput
from diffusers.models import AsymmetricAutoencoderKL, ImageProjection
from diffusers.models.attention_proc... | diffusers/examples/community/hd_painter.py/0 | {
"file_path": "diffusers/examples/community/hd_painter.py",
"repo_id": "diffusers",
"token_count": 20581
} | 116 |
# Copyright 2024 Bingxin Ke, ETH Zurich 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
#
# U... | diffusers/examples/community/marigold_depth_estimation.py/0 | {
"file_path": "diffusers/examples/community/marigold_depth_estimation.py",
"repo_id": "diffusers",
"token_count": 12108
} | 117 |
# Copyright 2024 Jingyang Zhang and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | diffusers/examples/community/pipeline_stable_diffusion_boxdiff.py/0 | {
"file_path": "diffusers/examples/community/pipeline_stable_diffusion_boxdiff.py",
"repo_id": "diffusers",
"token_count": 36129
} | 118 |
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
} | 119 |
import types
from typing import List, Optional, Tuple, Union
import torch
from transformers import CLIPTextModelWithProjection, CLIPTokenizer
from transformers.models.clip.modeling_clip import CLIPTextModelOutput
from diffusers.models import PriorTransformer
from diffusers.pipelines import DiffusionPipeline, StableDi... | diffusers/examples/community/stable_unclip.py/0 | {
"file_path": "diffusers/examples/community/stable_unclip.py",
"repo_id": "diffusers",
"token_count": 5488
} | 120 |
# ControlNet training example
[Adding Conditional Control to Text-to-Image Diffusion Models](https://arxiv.org/abs/2302.05543) by Lvmin Zhang and Maneesh Agrawala.
This example is based on the [training example in the original ControlNet repository](https://github.com/lllyasviel/ControlNet/blob/main/docs/train.md). I... | diffusers/examples/controlnet/README.md/0 | {
"file_path": "diffusers/examples/controlnet/README.md",
"repo_id": "diffusers",
"token_count": 6032
} | 121 |
# DreamBooth training example for Stable Diffusion 3 (SD3)
[DreamBooth](https://arxiv.org/abs/2208.12242) is a method to personalize text2image models like stable diffusion given just a few (3~5) images of a subject.
The `train_dreambooth_sd3.py` script shows how to implement the training procedure and adapt it for [... | diffusers/examples/dreambooth/README_sd3.md/0 | {
"file_path": "diffusers/examples/dreambooth/README_sd3.md",
"repo_id": "diffusers",
"token_count": 2384
} | 122 |
# Diffusion Model Alignment Using Direct Preference Optimization
This directory provides LoRA implementations of Diffusion DPO proposed in [DiffusionModel Alignment Using Direct Preference Optimization](https://arxiv.org/abs/2311.12908) by Bram Wallace, Meihua Dang, Rafael Rafailov, Linqi Zhou, Aaron Lou, Senthil Puru... | diffusers/examples/research_projects/diffusion_dpo/README.md/0 | {
"file_path": "diffusers/examples/research_projects/diffusion_dpo/README.md",
"repo_id": "diffusers",
"token_count": 1249
} | 123 |
<jupyter_start><jupyter_code>%load_ext autoreload
%autoreload 2
import torch
from diffusers import StableDiffusionGLIGENTextImagePipeline, StableDiffusionGLIGENPipeline
import os
import diffusers
from diffusers import (
AutoencoderKL,
DDPMScheduler,
UNet2DConditionModel,
UniPCMultistepScheduler,
Eu... | diffusers/examples/research_projects/gligen/demo.ipynb/0 | {
"file_path": "diffusers/examples/research_projects/gligen/demo.ipynb",
"repo_id": "diffusers",
"token_count": 1210
} | 124 |
# Stable Diffusion text-to-image fine-tuning
This extended LoRA training script was authored by [haofanwang](https://github.com/haofanwang).
This is an experimental LoRA extension of [this example](https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_lora.py). We further support... | diffusers/examples/research_projects/lora/README.md/0 | {
"file_path": "diffusers/examples/research_projects/lora/README.md",
"repo_id": "diffusers",
"token_count": 1624
} | 125 |
# Stable Diffusion text-to-image fine-tuning
The `train_text_to_image.py` script shows how to fine-tune stable diffusion model on your own dataset.
___Note___:
___This script is experimental. The script fine-tunes the whole model and often times the model overfits and runs into issues like catastrophic forgetting. I... | diffusers/examples/research_projects/onnxruntime/text_to_image/README.md/0 | {
"file_path": "diffusers/examples/research_projects/onnxruntime/text_to_image/README.md",
"repo_id": "diffusers",
"token_count": 847
} | 126 |
# RealFill
[RealFill](https://arxiv.org/abs/2309.16668) is a method to personalize text2image inpainting models like stable diffusion inpainting given just a few(1~5) images of a scene.
The `train_realfill.py` script shows how to implement the training procedure for stable diffusion inpainting.
## Running locally wi... | diffusers/examples/research_projects/realfill/README.md/0 | {
"file_path": "diffusers/examples/research_projects/realfill/README.md",
"repo_id": "diffusers",
"token_count": 1321
} | 127 |
# Stable Diffusion XL for JAX + TPUv5e
[TPU v5e](https://cloud.google.com/blog/products/compute/how-cloud-tpu-v5e-accelerates-large-scale-ai-inference) is a new generation of TPUs from Google Cloud. It is the most cost-effective, versatile, and scalable Cloud TPU to date. This makes them ideal for serving and scaling ... | diffusers/examples/research_projects/sdxl_flax/README.md/0 | {
"file_path": "diffusers/examples/research_projects/sdxl_flax/README.md",
"repo_id": "diffusers",
"token_count": 3344
} | 128 |
#!/usr/bin/env python
# coding=utf-8
# 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/LI... | diffusers/examples/text_to_image/test_text_to_image.py/0 | {
"file_path": "diffusers/examples/text_to_image/test_text_to_image.py",
"repo_id": "diffusers",
"token_count": 7427
} | 129 |
## Training an unconditional diffusion model
Creating a training image set is [described in a different document](https://huggingface.co/docs/datasets/image_process#image-datasets).
### Installing the dependencies
Before running the scripts, make sure to install the library's training dependencies:
**Important**
T... | diffusers/examples/unconditional_image_generation/README.md/0 | {
"file_path": "diffusers/examples/unconditional_image_generation/README.md",
"repo_id": "diffusers",
"token_count": 1939
} | 130 |
# Script for converting a HF Diffusers saved pipeline to a Stable Diffusion checkpoint.
# *Only* converts the UNet, VAE, and Text Encoder.
# Does not convert optimizer state or any other thing.
import argparse
import os.path as osp
import re
import torch
from safetensors.torch import load_file, save_file
# ========... | diffusers/scripts/convert_diffusers_to_original_sdxl.py/0 | {
"file_path": "diffusers/scripts/convert_diffusers_to_original_sdxl.py",
"repo_id": "diffusers",
"token_count": 6297
} | 131 |
import json
import os
import torch
from diffusers import UNet1DModel
os.makedirs("hub/hopper-medium-v2/unet/hor32", exist_ok=True)
os.makedirs("hub/hopper-medium-v2/unet/hor128", exist_ok=True)
os.makedirs("hub/hopper-medium-v2/value_function", exist_ok=True)
def unet(hor):
if hor == 128:
down_block_... | diffusers/scripts/convert_models_diffuser_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_models_diffuser_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 1700
} | 132 |
__version__ = "0.31.0.dev0"
from typing import TYPE_CHECKING
from .utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
is_flax_available,
is_k_diffusion_available,
is_librosa_available,
is_note_seq_available,
is_onnx_available,
is_scipy_available,
... | diffusers/src/diffusers/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/__init__.py",
"repo_id": "diffusers",
"token_count": 17087
} | 133 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/loaders/lora_base.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/lora_base.py",
"repo_id": "diffusers",
"token_count": 14643
} | 134 |
# 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_flax.py/0 | {
"file_path": "diffusers/src/diffusers/models/attention_flax.py",
"repo_id": "diffusers",
"token_count": 9031
} | 135 |
# Copyright 2024 Stability AI, The HuggingFace Team and The InstantX Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | diffusers/src/diffusers/models/controlnet_sd3.py/0 | {
"file_path": "diffusers/src/diffusers/models/controlnet_sd3.py",
"repo_id": "diffusers",
"token_count": 7741
} | 136 |
from ...utils import is_torch_available
if is_torch_available():
from .auraflow_transformer_2d import AuraFlowTransformer2DModel
from .cogvideox_transformer_3d import CogVideoXTransformer3DModel
from .dit_transformer_2d import DiTTransformer2DModel
from .dual_transformer_2d import DualTransformer2DMod... | diffusers/src/diffusers/models/transformers/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/__init__.py",
"repo_id": "diffusers",
"token_count": 330
} | 137 |
from ...utils import is_flax_available, is_torch_available
if is_torch_available():
from .unet_1d import UNet1DModel
from .unet_2d import UNet2DModel
from .unet_2d_condition import UNet2DConditionModel
from .unet_3d_condition import UNet3DConditionModel
from .unet_i2vgen_xl import I2VGenXLUNet
... | diffusers/src/diffusers/models/unets/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/models/unets/__init__.py",
"repo_id": "diffusers",
"token_count": 265
} | 138 |
# 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/upsampling.py/0 | {
"file_path": "diffusers/src/diffusers/models/upsampling.py",
"repo_id": "diffusers",
"token_count": 8879
} | 139 |
from dataclasses import dataclass
from typing import List, Union
import numpy as np
import PIL.Image
import torch
from ...utils import BaseOutput
@dataclass
class AnimateDiffPipelineOutput(BaseOutput):
r"""
Output class for AnimateDiff pipelines.
Args:
frames (`torch.Tensor`, `np.ndarray`, or... | diffusers/src/diffusers/pipelines/animatediff/pipeline_output.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/animatediff/pipeline_output.py",
"repo_id": "diffusers",
"token_count": 264
} | 140 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
_LazyModule,
)
_import_structure = {
"pipeline_consistency_models": ["ConsistencyModelPipeline"],
}
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
from .pipeline_consistency_models import ConsistencyModelPipeline
else:
i... | diffusers/src/diffusers/pipelines/consistency_models/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/consistency_models/__init__.py",
"repo_id": "diffusers",
"token_count": 209
} | 141 |
# 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/latent_diffusion_uncond/pipeline_latent_diffusion_uncond.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/latent_diffusion_uncond/pipeline_latent_diffusion_uncond.py",
"repo_id": "diffusers",
"token_count": 2148
} | 142 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_available() and is... | diffusers/src/diffusers/pipelines/kandinsky2_2/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/kandinsky2_2/__init__.py",
"repo_id": "diffusers",
"token_count": 1190
} | 143 |
# Copyright 2024 Alpha-VLLM 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 requir... | diffusers/src/diffusers/pipelines/lumina/pipeline_lumina.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/lumina/pipeline_lumina.py",
"repo_id": "diffusers",
"token_count": 19497
} | 144 |
# Stable Diffusion
## Overview
Stable Diffusion was proposed in [Stable Diffusion Announcement](https://stability.ai/blog/stable-diffusion-announcement) by Patrick Esser and Robin Rombach and the Stability AI team.
The summary of the model is the following:
*Stable Diffusion is a text-to-image model that will empow... | diffusers/src/diffusers/pipelines/stable_diffusion/README.md/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/README.md",
"repo_id": "diffusers",
"token_count": 2465
} | 145 |
from dataclasses import dataclass
from typing import List, Union
import numpy as np
import PIL
import torch
from ...utils import (
BaseOutput,
)
@dataclass
class TextToVideoSDPipelineOutput(BaseOutput):
"""
Output class for text-to-video pipelines.
Args:
frames (`torch.Tensor`, `np.ndarra... | diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_output.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_output.py",
"repo_id": "diffusers",
"token_count": 272
} | 146 |
# Copyright (c) 2023 Dominic Rampas MIT License
# 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/licen... | diffusers/src/diffusers/pipelines/wuerstchen/modeling_wuerstchen_diffnext.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/wuerstchen/modeling_wuerstchen_diffnext.py",
"repo_id": "diffusers",
"token_count": 5544
} | 147 |
# 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": 7286
} | 148 |
# 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": 6493
} | 149 |
# 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
} | 150 |
# 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": 10876
} | 151 |
import gc
import unittest
from parameterized import parameterized
from diffusers import FlaxUNet2DConditionModel
from diffusers.utils import is_flax_available
from diffusers.utils.testing_utils import load_hf_numpy, require_flax, slow
if is_flax_available():
import jax
import jax.numpy as jnp
@slow
@requi... | diffusers/tests/models/unets/test_models_unet_2d_flax.py/0 | {
"file_path": "diffusers/tests/models/unets/test_models_unet_2d_flax.py",
"repo_id": "diffusers",
"token_count": 2141
} | 152 |
# 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/others/test_utils.py/0 | {
"file_path": "diffusers/tests/others/test_utils.py",
"repo_id": "diffusers",
"token_count": 3332
} | 153 |
# 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/audioldm2/test_audioldm2.py/0 | {
"file_path": "diffusers/tests/pipelines/audioldm2/test_audioldm2.py",
"repo_id": "diffusers",
"token_count": 11115
} | 154 |
# 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/i2vgen_xl/test_i2vgenxl.py/0 | {
"file_path": "diffusers/tests/pipelines/i2vgen_xl/test_i2vgenxl.py",
"repo_id": "diffusers",
"token_count": 4258
} | 155 |
# coding=utf-8
# Copyright 2023 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/ledits_pp/test_ledits_pp_stable_diffusion.py/0 | {
"file_path": "diffusers/tests/pipelines/ledits_pp/test_ledits_pp_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 4241
} | 156 |
# 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_pixart_sigma.py/0 | {
"file_path": "diffusers/tests/pipelines/pag/test_pag_pixart_sigma.py",
"repo_id": "diffusers",
"token_count": 7280
} | 157 |
# 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/pndm/test_pndm.py/0 | {
"file_path": "diffusers/tests/pipelines/pndm/test_pndm.py",
"repo_id": "diffusers",
"token_count": 1314
} | 158 |
# coding=utf-8
# Copyright 2022 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/test_onnx_stable_diffusion_upscale.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_upscale.py",
"repo_id": "diffusers",
"token_count": 3917
} | 159 |
# 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/unclip/test_unclip_image_variation.py/0 | {
"file_path": "diffusers/tests/pipelines/unclip/test_unclip_image_variation.py",
"repo_id": "diffusers",
"token_count": 8231
} | 160 |
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": 5443
} | 161 |
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
} | 162 |
import gc
import unittest
import torch
from diffusers import (
StableDiffusionInpaintPipeline,
)
from diffusers.utils import load_image
from diffusers.utils.testing_utils import (
enable_full_determinism,
require_torch_gpu,
slow,
)
from .single_file_testing_utils import SDSingleFileTesterMixin
enab... | diffusers/tests/single_file/test_stable_diffusion_inpaint_single_file.py/0 | {
"file_path": "diffusers/tests/single_file/test_stable_diffusion_inpaint_single_file.py",
"repo_id": "diffusers",
"token_count": 1889
} | 163 |
# coding=utf-8
# 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 requir... | diffusers/utils/fetch_latest_release_branch.py/0 | {
"file_path": "diffusers/utils/fetch_latest_release_branch.py",
"repo_id": "diffusers",
"token_count": 824
} | 164 |
"""This scripts demonstrates how to train Diffusion Policy on the PushT environment.
Once you have trained a model with this script, you can try to evaluate it on
examples/2_evaluate_pretrained_policy.py
"""
from pathlib import Path
import torch
from lerobot.common.datasets.lerobot_dataset import LeRobotDataset
fro... | lerobot/examples/3_train_policy.py/0 | {
"file_path": "lerobot/examples/3_train_policy.py",
"repo_id": "lerobot",
"token_count": 1000
} | 165 |
#!/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 Licens e.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | lerobot/lerobot/common/datasets/push_dataset_to_hub/openx/data_utils.py/0 | {
"file_path": "lerobot/lerobot/common/datasets/push_dataset_to_hub/openx/data_utils.py",
"repo_id": "lerobot",
"token_count": 1593
} | 166 |
#!/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/modeling_act.py/0 | {
"file_path": "lerobot/lerobot/common/policies/act/modeling_act.py",
"repo_id": "lerobot",
"token_count": 15622
} | 167 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.