text
stringlengths
7
1.24M
id
stringlengths
14
166
metadata
dict
__index_level_0__
int64
0
519
# OpenID The login feature is disabled by default and users are attributed a unique ID based on their browser. But if you want to use OpenID to authenticate your users, you can add the following to your `.env.local` file: ```ini OPENID_CONFIG=`{ PROVIDER_URL: "<your OIDC issuer>", CLIENT_ID: "<your OIDC client ID...
chat-ui/docs/source/configuration/open-id.md/0
{ "file_path": "chat-ui/docs/source/configuration/open-id.md", "repo_id": "chat-ui", "token_count": 160 }
54
import { vi } from "vitest"; import dotenv from "dotenv"; import { resolve } from "path"; import fs from "fs"; // Load the .env file const envPath = resolve(__dirname, "../.env"); dotenv.config({ path: envPath }); // Read the .env file content const envContent = fs.readFileSync(envPath, "utf-8"); // Parse the .env c...
chat-ui/scripts/setupTest.ts/0
{ "file_path": "chat-ui/scripts/setupTest.ts", "repo_id": "chat-ui", "token_count": 310 }
55
<script lang="ts"> export let isCollapsed: boolean; export let classNames: string; </script> <button on:click class="{classNames} group flex h-16 w-6 flex-col items-center justify-center -space-y-1 outline-none *:h-3 *:w-1 *:rounded-full *:hover:bg-gray-300 dark:*:hover:bg-gray-600 max-md:hidden {!isCollapsed ? ...
chat-ui/src/lib/components/ExpandNavigation.svelte/0
{ "file_path": "chat-ui/src/lib/components/ExpandNavigation.svelte", "repo_id": "chat-ui", "token_count": 238 }
56
<script lang="ts"> import Modal from "./Modal.svelte"; import CarbonClose from "~icons/carbon/close"; import CarbonBlockchain from "~icons/carbon/blockchain"; export let preprompt: string; let isOpen = false; </script> <button type="button" class="mx-auto flex items-center gap-1.5 rounded-full border border-g...
chat-ui/src/lib/components/SystemPromptModal.svelte/0
{ "file_path": "chat-ui/src/lib/components/SystemPromptModal.svelte", "repo_id": "chat-ui", "token_count": 508 }
57
<script lang="ts"> import { createEventDispatcher } from "svelte"; import { page } from "$app/stores"; import type { MessageFile } from "$lib/types/Message"; import CarbonClose from "~icons/carbon/close"; import CarbonDocumentBlank from "~icons/carbon/document-blank"; import CarbonDownload from "~icons/carbon/dow...
chat-ui/src/lib/components/chat/UploadedFile.svelte/0
{ "file_path": "chat-ui/src/lib/components/chat/UploadedFile.svelte", "repo_id": "chat-ui", "token_count": 2065 }
58
import { Database } from "$lib/server/database"; import { migrations } from "./routines"; import { acquireLock, releaseLock, isDBLocked, refreshLock } from "./lock"; import { isHuggingChat } from "$lib/utils/isHuggingChat"; import { logger } from "$lib/server/logger"; const LOCK_KEY = "migrations"; export async funct...
chat-ui/src/lib/migrations/migrations.ts/0
{ "file_path": "chat-ui/src/lib/migrations/migrations.ts", "repo_id": "chat-ui", "token_count": 1286 }
59
import { z } from "zod"; import type { EmbeddingEndpoint } from "../embeddingEndpoints"; import type { Tensor, FeatureExtractionPipeline } from "@huggingface/transformers"; import { pipeline } from "@huggingface/transformers"; export const embeddingEndpointTransformersJSParametersSchema = z.object({ weight: z.number(...
chat-ui/src/lib/server/embeddingEndpoints/transformersjs/embeddingEndpoints.ts/0
{ "file_path": "chat-ui/src/lib/server/embeddingEndpoints/transformersjs/embeddingEndpoints.ts", "repo_id": "chat-ui", "token_count": 542 }
60
import { z } from "zod"; import { openAICompletionToTextGenerationStream } from "./openAICompletionToTextGenerationStream"; import { openAIChatToTextGenerationStream } from "./openAIChatToTextGenerationStream"; import type { CompletionCreateParamsStreaming } from "openai/resources/completions"; import type { ChatComple...
chat-ui/src/lib/server/endpoints/openai/endpointOai.ts/0
{ "file_path": "chat-ui/src/lib/server/endpoints/openai/endpointOai.ts", "repo_id": "chat-ui", "token_count": 1937 }
61
import type { ToolResult } from "$lib/types/Tool"; import { MessageUpdateType, type MessageUpdate } from "$lib/types/MessageUpdate"; import { AbortedGenerations } from "../abortedGenerations"; import type { TextGenerationContext } from "./types"; import type { EndpointMessage } from "../endpoints/endpoints"; type Gene...
chat-ui/src/lib/server/textGeneration/generate.ts/0
{ "file_path": "chat-ui/src/lib/server/textGeneration/generate.ts", "repo_id": "chat-ui", "token_count": 519 }
62
import { collapseString, sanitizeString } from "./utils/nlp"; import { stringifyHTMLElements, stringifyHTMLElementsUnformatted } from "./utils/stringify"; import { MarkdownElementType, tagNameMap, type HeaderElement, type MarkdownElement } from "./types"; import type { SerializedHTMLElement } from "../scrape/types"; i...
chat-ui/src/lib/server/websearch/markdown/fromHtml.ts/0
{ "file_path": "chat-ui/src/lib/server/websearch/markdown/fromHtml.ts", "repo_id": "chat-ui", "token_count": 1033 }
63
import { env } from "$env/dynamic/private"; import { isURL } from "$lib/utils/isUrl"; import type { WebSearchSource } from "$lib/types/WebSearch"; type SerpStackResponse = { organic_results: { title: string; url: string; snippet?: string; }[]; error?: string; }; export default async function searchSerpStack(...
chat-ui/src/lib/server/websearch/search/endpoints/serpStack.ts/0
{ "file_path": "chat-ui/src/lib/server/websearch/search/endpoints/serpStack.ts", "repo_id": "chat-ui", "token_count": 344 }
64
// Ideally shouldn't be needed, see https://github.com/huggingface/chat-ui/pull/88#issuecomment-1523173850 import type { Conversation } from "./Conversation"; import type { Timestamps } from "./Timestamps"; export interface AbortedGeneration extends Timestamps { conversationId: Conversation["_id"]; }
chat-ui/src/lib/types/AbortedGeneration.ts/0
{ "file_path": "chat-ui/src/lib/types/AbortedGeneration.ts", "repo_id": "chat-ui", "token_count": 93 }
65
import type { Message } from "./Message"; import type { Tool, ToolResult } from "./Tool"; export type ChatTemplateInput = { messages: Pick<Message, "from" | "content" | "files">[]; preprompt?: string; tools?: Tool[]; toolResults?: ToolResult[]; };
chat-ui/src/lib/types/Template.ts/0
{ "file_path": "chat-ui/src/lib/types/Template.ts", "repo_id": "chat-ui", "token_count": 82 }
66
import type { Model } from "$lib/types/Model"; import { AutoTokenizer, PreTrainedTokenizer } from "@huggingface/transformers"; export async function getTokenizer(_modelTokenizer: Exclude<Model["tokenizer"], undefined>) { if (typeof _modelTokenizer === "string") { // return auto tokenizer return await AutoTokenize...
chat-ui/src/lib/utils/getTokenizer.ts/0
{ "file_path": "chat-ui/src/lib/utils/getTokenizer.ts", "repo_id": "chat-ui", "token_count": 229 }
67
export const timeout = <T>(prom: Promise<T>, time: number): Promise<T> => { let timer: NodeJS.Timeout; return Promise.race([ prom, new Promise<T>((_, reject) => { timer = setTimeout(() => reject(new Error(`Timeout after ${time / 1000} seconds`)), time); }), ]).finally(() => clearTimeout(timer)); };
chat-ui/src/lib/utils/timeout.ts/0
{ "file_path": "chat-ui/src/lib/utils/timeout.ts", "repo_id": "chat-ui", "token_count": 110 }
68
<script lang="ts"> import { goto } from "$app/navigation"; import { base } from "$app/paths"; import { page } from "$app/stores"; import { env as envPublic } from "$env/dynamic/public"; import ChatWindow from "$lib/components/chat/ChatWindow.svelte"; import { ERROR_MESSAGES, error } from "$lib/stores/errors"; im...
chat-ui/src/routes/+page.svelte/0
{ "file_path": "chat-ui/src/routes/+page.svelte", "repo_id": "chat-ui", "token_count": 984 }
69
<script lang="ts"> export let name: string; export let description: string = ""; export let createdByName: string | undefined; export let avatar: string | undefined; import logo from "../../../../../static/huggingchat/logo.svg?raw"; </script> <div class="flex h-full w-full flex-col items-center justify-center bg...
chat-ui/src/routes/assistant/[assistantId]/thumbnail.png/ChatThumbnail.svelte/0
{ "file_path": "chat-ui/src/routes/assistant/[assistantId]/thumbnail.png/ChatThumbnail.svelte", "repo_id": "chat-ui", "token_count": 545 }
70
import { assert, it, describe, afterEach, vi, expect } from "vitest"; import type { Cookies } from "@sveltejs/kit"; import { collections } from "$lib/server/database"; import { updateUser } from "./updateUser"; import { ObjectId } from "mongodb"; import { DEFAULT_SETTINGS } from "$lib/types/Settings"; import { defaultM...
chat-ui/src/routes/login/callback/updateUser.spec.ts/0
{ "file_path": "chat-ui/src/routes/login/callback/updateUser.spec.ts", "repo_id": "chat-ui", "token_count": 1408 }
71
<script lang="ts"> import { enhance } from "$app/forms"; import { base } from "$app/paths"; import { page } from "$app/stores"; import { goto } from "$app/navigation"; import { env as envPublic } from "$env/dynamic/public"; import { useSettingsStore } from "$lib/stores/settings"; import type { PageData } from "....
chat-ui/src/routes/settings/(nav)/assistants/[assistantId]/+page.svelte/0
{ "file_path": "chat-ui/src/routes/settings/(nav)/assistants/[assistantId]/+page.svelte", "repo_id": "chat-ui", "token_count": 4338 }
72
import { base } from "$app/paths"; import { collections } from "$lib/server/database.js"; import { toolFromConfigs } from "$lib/server/tools/index.js"; import { redirect } from "@sveltejs/kit"; import { ObjectId } from "mongodb"; export const load = async ({ params, locals }) => { const tool = await collections.tools...
chat-ui/src/routes/tools/[toolId]/+layout.server.ts/0
{ "file_path": "chat-ui/src/routes/tools/[toolId]/+layout.server.ts", "repo_id": "chat-ui", "token_count": 430 }
73
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="none"> <path fill="#2063EC" d="M4 15.55C4 9.72 8.72 5 14.55 5h4.11a9.34 9.34 0 1 1 0 18.68H7.58l-2.89 2.8a.41.41 0 0 1-.69-.3V15.55Z" /> </svg>
chat-ui/static/chatui/logo.svg/0
{ "file_path": "chat-ui/static/chatui/logo.svg", "repo_id": "chat-ui", "token_count": 125 }
74
{ "license": "Apache-2.0", "creators": [ { "affiliation": "Hugging Face", "name": "Quentin Lhoest" }, { "orcid": "0000-0003-1727-1045", "affiliation": "Hugging Face", "name": "Albert Villanova del Moral" }, { ...
datasets/.zenodo.json/0
{ "file_path": "datasets/.zenodo.json", "repo_id": "datasets", "token_count": 1953 }
75
import json import sys def format_json_to_md(input_json_file, output_md_file): with open(input_json_file, encoding="utf-8") as f: results = json.load(f) output_md = ["<details>", "<summary>Show updated benchmarks!</summary>", " "] for benchmark_name in sorted(results): benchmark_res = re...
datasets/benchmarks/format.py/0
{ "file_path": "datasets/benchmarks/format.py", "repo_id": "datasets", "token_count": 746 }
76
# Batch mapping Combining the utility of [`Dataset.map`] with batch mode is very powerful. It allows you to speed up processing, and freely control the size of the generated dataset. ## Need for speed The primary objective of batch mapping is to speed up processing. Often times, it is faster to work with batches of...
datasets/docs/source/about_map_batch.mdx/0
{ "file_path": "datasets/docs/source/about_map_batch.mdx", "repo_id": "datasets", "token_count": 722 }
77
# Create an image dataset There are two methods for creating and sharing an image dataset. This guide will show you how to: * Create an audio dataset from local files in python with [`Dataset.push_to_hub`]. This is an easy way that requires only a few steps in python. * Create an image dataset with `ImageFolder` and...
datasets/docs/source/image_dataset.mdx/0
{ "file_path": "datasets/docs/source/image_dataset.mdx", "repo_id": "datasets", "token_count": 5689 }
78
# Utilities ## Configure logging 🤗 Datasets strives to be transparent and explicit about how it works, but this can be quite verbose at times. We have included a series of logging methods which allow you to easily adjust the level of verbosity of the entire library. Currently the default verbosity of the library is ...
datasets/docs/source/package_reference/utilities.mdx/0
{ "file_path": "datasets/docs/source/package_reference/utilities.mdx", "repo_id": "datasets", "token_count": 725 }
79
stages: benchmark_array_xd: cmd: python ./benchmarks/benchmark_array_xd.py deps: - ./benchmarks/benchmark_array_xd.py metrics: - ./benchmarks/results/benchmark_array_xd.json: cache: false benchmark_indices_mapping: cmd: python ./benchmarks/benchmark_indices_mapping.py deps: ...
datasets/dvc.yaml/0
{ "file_path": "datasets/dvc.yaml", "repo_id": "datasets", "token_count": 456 }
80
import logging import os from argparse import ArgumentParser from pathlib import Path from shutil import copyfile, rmtree from typing import Generator, Optional import datasets.config from datasets.builder import DatasetBuilder from datasets.commands import BaseDatasetsCLICommand from datasets.download.download_manage...
datasets/src/datasets/commands/test.py/0
{ "file_path": "datasets/src/datasets/commands/test.py", "repo_id": "datasets", "token_count": 4309 }
81
import os from functools import partial from typing import Optional import fsspec from fsspec.archive import AbstractArchiveFileSystem class BaseCompressedFileFileSystem(AbstractArchiveFileSystem): """Read contents of compressed file as a filesystem with one file inside.""" root_marker = "" protocol: st...
datasets/src/datasets/filesystems/compression.py/0
{ "file_path": "datasets/src/datasets/filesystems/compression.py", "repo_id": "datasets", "token_count": 1812 }
82
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.json.json import Json from ..utils import tqdm as hf_tqdm from ..utils.typing import NestedDataStructureLike, Pa...
datasets/src/datasets/io/json.py/0
{ "file_path": "datasets/src/datasets/io/json.py", "repo_id": "datasets", "token_count": 3049 }
83
#!/usr/bin/env python # coding=utf-8 # Copyright 2023 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...
datasets/src/datasets/utils/_filelock.py/0
{ "file_path": "datasets/src/datasets/utils/_filelock.py", "repo_id": "datasets", "token_count": 903 }
84
{ "monolingual": "contains a single language", "multilingual": "contains multiple languages", "translation": "contains translated or aligned text", "other": "other type of language distribution" }
datasets/src/datasets/utils/resources/multilingualities.json/0
{ "file_path": "datasets/src/datasets/utils/resources/multilingualities.json", "repo_id": "datasets", "token_count": 55 }
85
import os import tarfile import warnings from io import BytesIO import numpy as np import pandas as pd import pyarrow as pa import pytest from datasets import Dataset, Features, Image, Sequence, Value, concatenate_datasets, load_dataset from datasets.features.image import encode_np_array, image_to_bytes from ..utils...
datasets/tests/features/test_image.py/0
{ "file_path": "datasets/tests/features/test_image.py", "repo_id": "datasets", "token_count": 11833 }
86
import shutil import textwrap import numpy as np import pytest import soundfile as sf from datasets import Audio, ClassLabel, Features, Value from datasets.builder import InvalidConfigName from datasets.data_files import DataFilesDict, DataFilesList, get_data_patterns from datasets.download.streaming_download_manager...
datasets/tests/packaged_modules/test_audiofolder.py/0
{ "file_path": "datasets/tests/packaged_modules/test_audiofolder.py", "repo_id": "datasets", "token_count": 8839 }
87
import copy import os from pathlib import Path from typing import List from unittest.mock import patch import fsspec import pytest from fsspec.registry import _registry as _fsspec_registry from fsspec.spec import AbstractFileSystem from datasets.data_files import ( DataFilesDict, DataFilesList, DataFilesP...
datasets/tests/test_data_files.py/0
{ "file_path": "datasets/tests/test_data_files.py", "repo_id": "datasets", "token_count": 12329 }
88
import pytest from datasets.exceptions import DatasetNotFoundError from datasets.inspect import ( get_dataset_config_info, get_dataset_config_names, get_dataset_default_config_name, get_dataset_infos, get_dataset_split_names, ) pytestmark = pytest.mark.integration @pytest.mark.parametrize( ...
datasets/tests/test_inspect.py/0
{ "file_path": "datasets/tests/test_inspect.py", "repo_id": "datasets", "token_count": 2052 }
89
import asyncio import importlib.metadata import os import re import sys import tempfile import unittest from contextlib import contextmanager from copy import deepcopy from distutils.util import strtobool from enum import Enum from importlib.util import find_spec from pathlib import Path from unittest.mock import patch...
datasets/tests/utils.py/0
{ "file_path": "datasets/tests/utils.py", "repo_id": "datasets", "token_count": 6329 }
90
<jupyter_start><jupyter_text>Unit 8: Proximal Policy Gradient (PPO) with PyTorch 🤖In this notebook, you'll learn to **code your PPO agent from scratch with PyTorch using CleanRL implementation as model**.To test its robustness, we're going to train it in:- [LunarLander-v2 🚀](https://www.gymlibrary.dev/environments/bo...
deep-rl-class/notebooks/unit8/unit8_part1.ipynb/0
{ "file_path": "deep-rl-class/notebooks/unit8/unit8_part1.ipynb", "repo_id": "deep-rl-class", "token_count": 15492 }
91
# Quiz [[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: What is Reinforcement Learning? <details> <...
deep-rl-class/units/en/unit1/quiz.mdx/0
{ "file_path": "deep-rl-class/units/en/unit1/quiz.mdx", "repo_id": "deep-rl-class", "token_count": 1866 }
92
# Q-Learning Recap [[q-learning-recap]] *Q-Learning* **is the RL algorithm that** : - Trains a *Q-function*, an **action-value function** encoded, in internal memory, by a *Q-table* **containing all the state-action pair values.** - Given a state and action, our Q-function **will search its Q-table for the correspo...
deep-rl-class/units/en/unit2/q-learning-recap.mdx/0
{ "file_path": "deep-rl-class/units/en/unit2/q-learning-recap.mdx", "repo_id": "deep-rl-class", "token_count": 505 }
93
# Conclusion **Congrats on finishing this unit**! There was a lot of information. And congrats on finishing the tutorial. You've just coded your first Deep Reinforcement Learning agent from scratch using PyTorch and shared it on the Hub 🥳. Don't hesitate to iterate on this unit **by improving the implementation for...
deep-rl-class/units/en/unit4/conclusion.mdx/0
{ "file_path": "deep-rl-class/units/en/unit4/conclusion.mdx", "repo_id": "deep-rl-class", "token_count": 250 }
94
# The SnowballTarget Environment <img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/snowballtarget.gif" alt="SnowballTarget"/> SnowballTarget is an environment we created at Hugging Face using assets from [Kay Lousberg](https://kaylousberg.com/). We have an option...
deep-rl-class/units/en/unit5/snowball-target.mdx/0
{ "file_path": "deep-rl-class/units/en/unit5/snowball-target.mdx", "repo_id": "deep-rl-class", "token_count": 1019 }
95
# Additional Readings [[additional-readings]] These are **optional readings** if you want to go deeper. ## PPO Explained - [Towards Delivering a Coherent Self-Contained Explanation of Proximal Policy Optimization by Daniel Bick](https://fse.studenttheses.ub.rug.nl/25709/1/mAI_2021_BickD.pdf) - [What is the way to un...
deep-rl-class/units/en/unit8/additional-readings.mdx/0
{ "file_path": "deep-rl-class/units/en/unit8/additional-readings.mdx", "repo_id": "deep-rl-class", "token_count": 418 }
96
# Introduction [[introduction]] One of the most critical tasks in Deep Reinforcement Learning is to **find a good set of training hyperparameters**. <img src="https://raw.githubusercontent.com/optuna/optuna/master/docs/image/optuna-logo.png" alt="Optuna Logo"/> [Optuna](https://optuna.org/) is a library that helps y...
deep-rl-class/units/en/unitbonus2/introduction.mdx/0
{ "file_path": "deep-rl-class/units/en/unitbonus2/introduction.mdx", "repo_id": "deep-rl-class", "token_count": 156 }
97
import argparse import sys sys.path.append(".") from base_classes import T2IAdapterBenchmark, T2IAdapterSDXLBenchmark # noqa: E402 if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--ckpt", type=str, default="TencentARC/t2iadapter_canny_sd14v1", ...
diffusers/benchmarks/benchmark_t2i_adapter.py/0
{ "file_path": "diffusers/benchmarks/benchmark_t2i_adapter.py", "repo_id": "diffusers", "token_count": 393 }
98
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/api/pipelines/stable_diffusion/stable_diffusion_2.md/0
{ "file_path": "diffusers/docs/source/en/api/pipelines/stable_diffusion/stable_diffusion_2.md", "repo_id": "diffusers", "token_count": 2283 }
99
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/api/schedulers/cosine_dpm.md/0
{ "file_path": "diffusers/docs/source/en/api/schedulers/cosine_dpm.md", "repo_id": "diffusers", "token_count": 357 }
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/schedulers/lcm.md/0
{ "file_path": "diffusers/docs/source/en/api/schedulers/lcm.md", "repo_id": "diffusers", "token_count": 291 }
101
<!--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/community_projects.md/0
{ "file_path": "diffusers/docs/source/en/community_projects.md", "repo_id": "diffusers", "token_count": 1257 }
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...
diffusers/docs/source/en/optimization/open_vino.md/0
{ "file_path": "diffusers/docs/source/en/optimization/open_vino.md", "repo_id": "diffusers", "token_count": 1109 }
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/training/lcm_distill.md/0
{ "file_path": "diffusers/docs/source/en/training/lcm_distill.md", "repo_id": "diffusers", "token_count": 4583 }
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/using-diffusers/conditional_image_generation.md/0
{ "file_path": "diffusers/docs/source/en/using-diffusers/conditional_image_generation.md", "repo_id": "diffusers", "token_count": 5136 }
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/using-diffusers/merge_loras.md/0
{ "file_path": "diffusers/docs/source/en/using-diffusers/merge_loras.md", "repo_id": "diffusers", "token_count": 4779 }
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/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 }
107
# 학습을 위한 데이터셋 만들기 [Hub](https://huggingface.co/datasets?task_categories=task_categories:text-to-image&sort=downloads) 에는 모델 교육을 위한 많은 데이터셋이 있지만, 관심이 있거나 사용하고 싶은 데이터셋을 찾을 수 없는 경우 🤗 [Datasets](hf.co/docs/datasets) 라이브러리를 사용하여 데이터셋을 만들 수 있습니다. 데이터셋 구조는 모델을 학습하려는 작업에 따라 달라집니다. 가장 기본적인 데이터셋 구조는 unconditional 이미지 생성과 같은 작업...
diffusers/docs/source/ko/training/create_dataset.md/0
{ "file_path": "diffusers/docs/source/ko/training/create_dataset.md", "repo_id": "diffusers", "token_count": 3214 }
108
<!--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 }
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/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": 9948 }
110
# coding=utf-8 # Copyright 2024 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/amused/train_amused.py/0
{ "file_path": "diffusers/examples/amused/train_amused.py", "repo_id": "diffusers", "token_count": 17513 }
111
""" modeled after the textual_inversion.py / train_dreambooth.py and the work of justinpinkney here: https://github.com/justinpinkney/stable-diffusion/blob/main/notebooks/imagic.ipynb """ import inspect import warnings from typing import List, Optional, Union import numpy as np import PIL.Image import torch import to...
diffusers/examples/community/imagic_stable_diffusion.py/0
{ "file_path": "diffusers/examples/community/imagic_stable_diffusion.py", "repo_id": "diffusers", "token_count": 9825 }
112
import re from copy import deepcopy from dataclasses import asdict, dataclass from enum import Enum from typing import List, Optional, Union import numpy as np import torch from numpy import exp, pi, sqrt from torchvision.transforms.functional import resize from tqdm.auto import tqdm from transformers import CLIPImage...
diffusers/examples/community/mixture_canvas.py/0
{ "file_path": "diffusers/examples/community/mixture_canvas.py", "repo_id": "diffusers", "token_count": 9675 }
113
import inspect from typing import Callable, List, Optional, Union import torch from transformers import ( CLIPImageProcessor, CLIPTextModel, CLIPTokenizer, WhisperForConditionalGeneration, WhisperProcessor, ) from diffusers import ( AutoencoderKL, DDIMScheduler, DiffusionPipeline, ...
diffusers/examples/community/speech_to_image_diffusion.py/0
{ "file_path": "diffusers/examples/community/speech_to_image_diffusion.py", "repo_id": "diffusers", "token_count": 5031 }
114
# Copyright 2024 Peter Willemsen <peter@codebuffet.co>. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
diffusers/examples/community/tiled_upscaling.py/0
{ "file_path": "diffusers/examples/community/tiled_upscaling.py", "repo_id": "diffusers", "token_count": 5900 }
115
#!/usr/bin/env python # coding=utf-8 # Copyright 2024 bram-w, 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/lic...
diffusers/examples/research_projects/diffusion_dpo/train_diffusion_dpo.py/0
{ "file_path": "diffusers/examples/research_projects/diffusion_dpo/train_diffusion_dpo.py", "repo_id": "diffusers", "token_count": 17502 }
116
import argparse import os import random import torch import torchvision import torchvision.transforms as TS from PIL import Image from ram import inference_ram from ram.models import ram from tqdm import tqdm from transformers import ( AutoModelForZeroShotObjectDetection, AutoProcessor, Blip2ForConditional...
diffusers/examples/research_projects/gligen/make_datasets.py/0
{ "file_path": "diffusers/examples/research_projects/gligen/make_datasets.py", "repo_id": "diffusers", "token_count": 2102 }
117
# 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/LICENSE-2.0 # # Unless r...
diffusers/examples/research_projects/lora/train_text_to_image_lora.py/0
{ "file_path": "diffusers/examples/research_projects/lora/train_text_to_image_lora.py", "repo_id": "diffusers", "token_count": 19108 }
118
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 }
119
# 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/unconditional_image_generation/test_unconditional.py/0
{ "file_path": "diffusers/examples/unconditional_image_generation/test_unconditional.py", "repo_id": "diffusers", "token_count": 2492 }
120
import argparse import torch import yaml from diffusers import DDIMScheduler, LDMPipeline, UNetLDMModel, VQModel def convert_ldm_original(checkpoint_path, config_path, output_path): config = yaml.safe_load(config_path) state_dict = torch.load(checkpoint_path, map_location="cpu")["model"] keys = list(sta...
diffusers/scripts/conversion_ldm_uncond.py/0
{ "file_path": "diffusers/scripts/conversion_ldm_uncond.py", "repo_id": "diffusers", "token_count": 793 }
121
import argparse import os import torch from torchvision.datasets.utils import download_url from diffusers import AutoencoderKL, DDIMScheduler, DiTPipeline, Transformer2DModel pretrained_models = {512: "DiT-XL-2-512x512.pt", 256: "DiT-XL-2-256x256.pt"} def download_model(model_name): """ Downloads a pre-tr...
diffusers/scripts/convert_dit_to_diffusers.py/0
{ "file_path": "diffusers/scripts/convert_dit_to_diffusers.py", "repo_id": "diffusers", "token_count": 3037 }
122
#!/usr/bin/env python3 import argparse import os import jax as jnp import numpy as onp import torch import torch.nn as nn from music_spectrogram_diffusion import inference from t5x import checkpoints from diffusers import DDPMScheduler, OnnxRuntimeModel, SpectrogramDiffusionPipeline from diffusers.pipelines.spectrogr...
diffusers/scripts/convert_music_spectrogram_to_diffusers.py/0
{ "file_path": "diffusers/scripts/convert_music_spectrogram_to_diffusers.py", "repo_id": "diffusers", "token_count": 4350 }
123
import argparse import os import shutil from pathlib import Path import onnx import onnx_graphsurgeon as gs import torch from onnx import shape_inference from packaging import version from polygraphy.backend.onnx.loader import fold_constants from torch.onnx import export from diffusers import ( ControlNetModel, ...
diffusers/scripts/convert_stable_diffusion_controlnet_to_onnx.py/0
{ "file_path": "diffusers/scripts/convert_stable_diffusion_controlnet_to_onnx.py", "repo_id": "diffusers", "token_count": 8995 }
124
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
diffusers/src/diffusers/loaders/lora_pipeline.py/0
{ "file_path": "diffusers/src/diffusers/loaders/lora_pipeline.py", "repo_id": "diffusers", "token_count": 50262 }
125
from .autoencoder_asym_kl import AsymmetricAutoencoderKL from .autoencoder_kl import AutoencoderKL from .autoencoder_kl_cogvideox import AutoencoderKLCogVideoX from .autoencoder_kl_temporal_decoder import AutoencoderKLTemporalDecoder from .autoencoder_oobleck import AutoencoderOobleck from .autoencoder_tiny import Auto...
diffusers/src/diffusers/models/autoencoders/__init__.py/0
{ "file_path": "diffusers/src/diffusers/models/autoencoders/__init__.py", "repo_id": "diffusers", "token_count": 154 }
126
# 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/controlnet_xs.py/0
{ "file_path": "diffusers/src/diffusers/models/controlnet_xs.py", "repo_id": "diffusers", "token_count": 40357 }
127
# 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": 8997 }
128
# 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_1d_blocks.py/0
{ "file_path": "diffusers/src/diffusers/models/unets/unet_1d_blocks.py", "repo_id": "diffusers", "token_count": 11971 }
129
# 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/vq_model.py/0
{ "file_path": "diffusers/src/diffusers/models/vq_model.py", "repo_id": "diffusers", "token_count": 490 }
130
# 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/audioldm/pipeline_audioldm.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/audioldm/pipeline_audioldm.py", "repo_id": "diffusers", "token_count": 11527 }
131
from typing import TYPE_CHECKING from ...utils import ( DIFFUSERS_SLOW_IMPORT, OptionalDependencyNotAvailable, _LazyModule, get_objects_from_module, is_flax_available, is_torch_available, is_transformers_available, ) _dummy_objects = {} _import_structure = {} try: if not (is_transfor...
diffusers/src/diffusers/pipelines/controlnet/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/controlnet/__init__.py", "repo_id": "diffusers", "token_count": 1294 }
132
import numpy as np import torch import torch.nn as nn from transformers import CLIPConfig, CLIPVisionModelWithProjection, PreTrainedModel from ...utils import logging logger = logging.get_logger(__name__) class IFSafetyChecker(PreTrainedModel): config_class = CLIPConfig _no_split_modules = ["CLIPEncoderLa...
diffusers/src/diffusers/pipelines/deepfloyd_if/safety_checker.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/deepfloyd_if/safety_checker.py", "repo_id": "diffusers", "token_count": 913 }
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/pipelines/deprecated/pndm/pipeline_pndm.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/deprecated/pndm/pipeline_pndm.py", "repo_id": "diffusers", "token_count": 1866 }
134
# Copyright 2024 Pix2Pix Zero 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 # # Unl...
diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py", "repo_id": "diffusers", "token_count": 28191 }
135
# 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/kandinsky2_2/pipeline_kandinsky2_2_combined.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py", "repo_id": "diffusers", "token_count": 18875 }
136
# Copyright 2024 ChatGLM3-6B Model Team, Kwai-Kolors 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...
diffusers/src/diffusers/pipelines/kolors/tokenizer.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/kolors/tokenizer.py", "repo_id": "diffusers", "token_count": 5798 }
137
from typing import List, Optional, Tuple, Union import numpy as np import PIL import torch import torch.nn.functional as F from PIL import Image from ... import ConfigMixin from ...configuration_utils import register_to_config from ...image_processor import PipelineImageInput from ...utils import CONFIG_NAME, logging...
diffusers/src/diffusers/pipelines/marigold/marigold_image_processing.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/marigold/marigold_image_processing.py", "repo_id": "diffusers", "token_count": 11971 }
138
# Copyright 2024 The GLIGEN Authors and 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/src/diffusers/pipelines/stable_diffusion/clip_image_project_model.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/clip_image_project_model.py", "repo_id": "diffusers", "token_count": 336 }
139
# 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_latent_upscale.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py", "repo_id": "diffusers", "token_count": 13815 }
140
from typing import TYPE_CHECKING from ...utils import ( DIFFUSERS_SLOW_IMPORT, OptionalDependencyNotAvailable, _LazyModule, get_objects_from_module, is_flax_available, is_torch_available, is_transformers_available, ) _dummy_objects = {} _additional_imports = {} _import_structure = {"pipel...
diffusers/src/diffusers/pipelines/stable_diffusion_xl/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_xl/__init__.py", "repo_id": "diffusers", "token_count": 1202 }
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/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py", "repo_id": "diffusers", "token_count": 15239 }
142
# 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/wuerstchen/pipeline_wuerstchen.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/wuerstchen/pipeline_wuerstchen.py", "repo_id": "diffusers", "token_count": 9223 }
143
# Copyright 2024 Google Brain 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/schedulers/scheduling_sde_ve.py/0
{ "file_path": "diffusers/src/diffusers/schedulers/scheduling_sde_ve.py", "repo_id": "diffusers", "token_count": 5379 }
144
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..utils import DummyObject, requires_backends class MidiProcessor(metaclass=DummyObject): _backends = ["note_seq"] def __init__(self, *args, **kwargs): requires_backends(self, ["note_seq"]) @classmethod def from...
diffusers/src/diffusers/utils/dummy_note_seq_objects.py/0
{ "file_path": "diffusers/src/diffusers/utils/dummy_note_seq_objects.py", "repo_id": "diffusers", "token_count": 201 }
145
# coding=utf-8 # Copyright 2024 Optuna, Hugging Face # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
diffusers/src/diffusers/utils/logging.py/0
{ "file_path": "diffusers/src/diffusers/utils/logging.py", "repo_id": "diffusers", "token_count": 3654 }
146
# 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/lora/test_lora_layers_sd.py/0
{ "file_path": "diffusers/tests/lora/test_lora_layers_sd.py", "repo_id": "diffusers", "token_count": 11874 }
147
# 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_pixart_transformer2d.py/0
{ "file_path": "diffusers/tests/models/transformers/test_models_pixart_transformer2d.py", "repo_id": "diffusers", "token_count": 1583 }
148
# 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/unets/test_models_unet_controlnetxs.py/0
{ "file_path": "diffusers/tests/models/unets/test_models_unet_controlnetxs.py", "repo_id": "diffusers", "token_count": 6601 }
149
import unittest import numpy as np import torch from transformers import AutoTokenizer, UMT5EncoderModel from diffusers import AuraFlowPipeline, AuraFlowTransformer2DModel, AutoencoderKL, FlowMatchEulerDiscreteScheduler from diffusers.utils.testing_utils import ( torch_device, ) from ..test_pipelines_common impo...
diffusers/tests/pipelines/aura_flow/test_pipeline_aura_flow.py/0
{ "file_path": "diffusers/tests/pipelines/aura_flow/test_pipeline_aura_flow.py", "repo_id": "diffusers", "token_count": 2858 }
150
import tempfile import numpy as np import torch from transformers import AutoTokenizer, T5EncoderModel from diffusers import DDPMScheduler, UNet2DConditionModel from diffusers.models.attention_processor import AttnAddedKVProcessor from diffusers.pipelines.deepfloyd_if import IFWatermarker from diffusers.utils.testing...
diffusers/tests/pipelines/deepfloyd_if/__init__.py/0
{ "file_path": "diffusers/tests/pipelines/deepfloyd_if/__init__.py", "repo_id": "diffusers", "token_count": 4583 }
151
# 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/kandinsky3/test_kandinsky3.py/0
{ "file_path": "diffusers/tests/pipelines/kandinsky3/test_kandinsky3.py", "repo_id": "diffusers", "token_count": 3586 }
152
import inspect import unittest import numpy as np import torch from transformers import AutoTokenizer, CLIPTextConfig, CLIPTextModelWithProjection, CLIPTokenizer, T5EncoderModel from diffusers import ( AutoencoderKL, FlowMatchEulerDiscreteScheduler, SD3Transformer2DModel, StableDiffusion3PAGPipeline, ...
diffusers/tests/pipelines/pag/test_pag_sd3.py/0
{ "file_path": "diffusers/tests/pipelines/pag/test_pag_sd3.py", "repo_id": "diffusers", "token_count": 5315 }
153