text stringlengths 7 1.24M | id stringlengths 14 166 | metadata dict | __index_level_0__ int64 0 519 |
|---|---|---|---|
import init, { Model } from "./build/m.js";
async function fetchArrayBuffer(url) {
const cacheName = "phi-mixformer-candle-cache";
const cache = await caches.open(cacheName);
const cachedResponse = await cache.match(url);
if (cachedResponse) {
const data = await cachedResponse.arrayBuffer();
return new... | candle/candle-wasm-examples/phi/phiWorker.js/0 | {
"file_path": "candle/candle-wasm-examples/phi/phiWorker.js",
"repo_id": "candle",
"token_count": 1667
} | 51 |
use candle::{Device, Tensor};
use candle_transformers::generation::LogitsProcessor;
pub use candle_transformers::models::quantized_t5::{
Config, T5EncoderModel, T5ForConditionalGeneration, VarBuilder,
};
use candle_wasm_example_t5::console_log;
use tokenizers::Tokenizer;
use wasm_bindgen::prelude::*;
const DEVICE:... | candle/candle-wasm-examples/t5/src/bin/m-quantized.rs/0 | {
"file_path": "candle/candle-wasm-examples/t5/src/bin/m-quantized.rs",
"repo_id": "candle",
"token_count": 3555
} | 52 |
pub const WITH_TIMER: bool = true;
mod app;
mod audio;
pub mod languages;
pub mod worker;
pub use app::App;
pub use worker::Worker;
| candle/candle-wasm-examples/whisper/src/lib.rs/0 | {
"file_path": "candle/candle-wasm-examples/whisper/src/lib.rs",
"repo_id": "candle",
"token_count": 47
} | 53 |
//load the candle yolo wasm module
import init, { Model, ModelPose } from "./build/m.js";
async function fetchArrayBuffer(url) {
const cacheName = "yolo-candle-cache";
const cache = await caches.open(cacheName);
const cachedResponse = await cache.match(url);
if (cachedResponse) {
const data = await cachedR... | candle/candle-wasm-examples/yolo/yoloWorker.js/0 | {
"file_path": "candle/candle-wasm-examples/yolo/yoloWorker.js",
"repo_id": "candle",
"token_count": 756
} | 54 |
apiVersion: v2
name: chat-ui
version: 0.0.0-latest
type: application
icon: https://huggingface.co/front/assets/huggingface_logo-noborder.svg
| chat-ui/chart/Chart.yaml/0 | {
"file_path": "chat-ui/chart/Chart.yaml",
"repo_id": "chat-ui",
"token_count": 55
} | 55 |
# Multimodal
We currently support [IDEFICS](https://huggingface.co/blog/idefics) (hosted on [TGI](./providers/tgi)), OpenAI and Anthropic Claude 3 as multimodal models. You can enable it by setting `multimodal: true` in your `MODELS` configuration. For IDEFICS, you must have a [PRO HF Api token](https://huggingface.co... | chat-ui/docs/source/configuration/models/multimodal.md/0 | {
"file_path": "chat-ui/docs/source/configuration/models/multimodal.md",
"repo_id": "chat-ui",
"token_count": 439
} | 56 |
# Web Search
Chat UI features a powerful Web Search feature. A high level overview of how it works:
1. Generate an appropriate search query from the user prompt using the `TASK_MODEL`
2. Perform web search via an external provider (i.e. Serper) or via locally scrape Google results
3. Load each search result into play... | chat-ui/docs/source/configuration/web-search.md/0 | {
"file_path": "chat-ui/docs/source/configuration/web-search.md",
"repo_id": "chat-ui",
"token_count": 838
} | 57 |
/// <reference types="@sveltejs/kit" />
/// <reference types="unplugin-icons/types/svelte" />
import type { User } from "$lib/types/User";
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
interface Locals {
sessionId:... | chat-ui/src/app.d.ts/0 | {
"file_path": "chat-ui/src/app.d.ts",
"repo_id": "chat-ui",
"token_count": 190
} | 58 |
<script lang="ts">
import { navigating } from "$app/stores";
import { createEventDispatcher } from "svelte";
import { browser } from "$app/environment";
import { base } from "$app/paths";
import { page } from "$app/stores";
import CarbonClose from "~icons/carbon/close";
import CarbonTextAlignJustify from "~icon... | chat-ui/src/lib/components/MobileNav.svelte/0 | {
"file_path": "chat-ui/src/lib/components/MobileNav.svelte",
"repo_id": "chat-ui",
"token_count": 692
} | 59 |
<script lang="ts">
import ToolLogo from "./ToolLogo.svelte";
import { base } from "$app/paths";
import { browser } from "$app/environment";
export let toolId: string;
</script>
<div
class="relative flex items-center justify-center space-x-2 rounded border border-gray-300 bg-gray-200 px-2 py-1"
>
{#if browser}
... | chat-ui/src/lib/components/ToolBadge.svelte/0 | {
"file_path": "chat-ui/src/lib/components/ToolBadge.svelte",
"repo_id": "chat-ui",
"token_count": 476
} | 60 |
<script lang="ts">
export let classNames = "";
</script>
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
class={classNames}
fill="none"
viewBox="0 0 26 23"
>
<path
fill="url(#a)"
d="M.93 10.65A10.17 10.17 0 0 1 11.11.48h4.67a9.45 9.45 0 0 1 0 18.89H4.53L1.62 22.2a.38.38 0 0 1-.69-.28V10.65... | chat-ui/src/lib/components/icons/IconDazzled.svelte/0 | {
"file_path": "chat-ui/src/lib/components/icons/IconDazzled.svelte",
"repo_id": "chat-ui",
"token_count": 916
} | 61 |
import type { Migration } from ".";
import { collections } from "$lib/server/database";
import { ObjectId } from "mongodb";
import { logger } from "$lib/server/logger";
const addToolsToSettings: Migration = {
_id: new ObjectId("5c9c4c4c4c4c4c4c4c4c4c4c"),
name: "Add empty 'tools' record in settings",
up: async () =... | chat-ui/src/lib/migrations/routines/03-add-tools-in-settings.ts/0 | {
"file_path": "chat-ui/src/lib/migrations/routines/03-add-tools-in-settings.ts",
"repo_id": "chat-ui",
"token_count": 272
} | 62 |
import { z } from "zod";
import type { Endpoint } from "../endpoints";
import type { TextGenerationStreamOutput } from "@huggingface/inference";
import { createImageProcessorOptionsValidator } from "../images";
import { endpointMessagesToAnthropicMessages } from "./utils";
export const endpointAnthropicVertexParameter... | chat-ui/src/lib/server/endpoints/anthropic/endpointAnthropicVertex.ts/0 | {
"file_path": "chat-ui/src/lib/server/endpoints/anthropic/endpointAnthropicVertex.ts",
"repo_id": "chat-ui",
"token_count": 1143
} | 63 |
import type { Message } from "$lib/types/Message";
import { format } from "date-fns";
import type { EndpointMessage } from "./endpoints";
import { downloadFile } from "../files/downloadFile";
import type { ObjectId } from "mongodb";
export async function preprocessMessages(
messages: Message[],
webSearch: Message["w... | chat-ui/src/lib/server/endpoints/preprocessMessages.ts/0 | {
"file_path": "chat-ui/src/lib/server/endpoints/preprocessMessages.ts",
"repo_id": "chat-ui",
"token_count": 629
} | 64 |
import { ToolResultStatus, type ToolCall, type Tool, type ToolResult } from "$lib/types/Tool";
import { v4 as uuidV4 } from "uuid";
import { getCallMethod, toolFromConfigs, type BackendToolContext } from "../tools";
import {
MessageToolUpdateType,
MessageUpdateStatus,
MessageUpdateType,
type MessageUpdate,
} from "... | chat-ui/src/lib/server/textGeneration/tools.ts/0 | {
"file_path": "chat-ui/src/lib/server/textGeneration/tools.ts",
"repo_id": "chat-ui",
"token_count": 2996
} | 65 |
import { sentences as splitBySentences } from "sbd";
import { MarkdownElementType, type MarkdownElement } from "../types";
export function chunkElements(elements: MarkdownElement[], maxLength: number): MarkdownElement[] {
return elements.flatMap((elem) => {
// Can't split headers because it would break the tree, an... | chat-ui/src/lib/server/websearch/markdown/utils/chunk.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/markdown/utils/chunk.ts",
"repo_id": "chat-ui",
"token_count": 801
} | 66 |
import { env } from "$env/dynamic/private";
import { isURL } from "$lib/utils/isUrl";
import type { WebSearchSource } from "$lib/types/WebSearch";
interface YouWebSearch {
hits: YouSearchHit[];
latency: number;
}
interface YouSearchHit {
url: string;
title: string;
description: string;
snippets: string[];
}
ex... | chat-ui/src/lib/server/websearch/search/endpoints/youApi.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/search/endpoints/youApi.ts",
"repo_id": "chat-ui",
"token_count": 402
} | 67 |
export interface ConvSidebar {
id: string;
title: string;
updatedAt: Date;
model?: string;
assistantId?: string;
avatarHash?: string;
}
| chat-ui/src/lib/types/ConvSidebar.ts/0 | {
"file_path": "chat-ui/src/lib/types/ConvSidebar.ts",
"repo_id": "chat-ui",
"token_count": 50
} | 68 |
import type { ObjectId } from "mongodb";
import type { User } from "./User";
import type { Timestamps } from "./Timestamps";
import type { BackendToolContext } from "$lib/server/tools";
import type { MessageUpdate } from "./MessageUpdate";
import { z } from "zod";
export const ToolColor = z.union([
z.literal("purple"... | chat-ui/src/lib/types/Tool.ts/0 | {
"file_path": "chat-ui/src/lib/types/Tool.ts",
"repo_id": "chat-ui",
"token_count": 1426
} | 69 |
import { env as envPublic } from "$env/dynamic/public";
export const isHuggingChat = envPublic.PUBLIC_APP_ASSETS === "huggingchat";
| chat-ui/src/lib/utils/isHuggingChat.ts/0 | {
"file_path": "chat-ui/src/lib/utils/isHuggingChat.ts",
"repo_id": "chat-ui",
"token_count": 43
} | 70 |
import type { Conversation } from "$lib/types/Conversation";
import type { Message } from "$lib/types/Message";
import { v4 } from "uuid";
export function addChildren(
conv: Pick<Conversation, "messages" | "rootMessageId">,
message: Omit<Message, "id">,
parentId?: Message["id"]
): Message["id"] {
// if this is the... | chat-ui/src/lib/utils/tree/addChildren.ts/0 | {
"file_path": "chat-ui/src/lib/utils/tree/addChildren.ts",
"repo_id": "chat-ui",
"token_count": 501
} | 71 |
import { collections } from "$lib/server/database";
import { ObjectId } from "mongodb";
export async function GET({ params }) {
const id = params.id;
const assistantId = new ObjectId(id);
const assistant = await collections.assistants.findOne({
_id: assistantId,
});
if (assistant) {
return Response.json(ass... | chat-ui/src/routes/api/assistant/[id]/+server.ts/0 | {
"file_path": "chat-ui/src/routes/api/assistant/[id]/+server.ts",
"repo_id": "chat-ui",
"token_count": 133
} | 72 |
import type { RequestHandler } from "./$types";
import { collections } from "$lib/server/database";
import { ObjectId } from "mongodb";
import { error, redirect } from "@sveltejs/kit";
import { base } from "$app/paths";
import { z } from "zod";
import type { Message } from "$lib/types/Message";
import { models, validat... | chat-ui/src/routes/conversation/+server.ts/0 | {
"file_path": "chat-ui/src/routes/conversation/+server.ts",
"repo_id": "chat-ui",
"token_count": 1252
} | 73 |
<script lang="ts">
import type { PageData } from "./$types";
import { env as envPublic } from "$env/dynamic/public";
import { isHuggingChat } from "$lib/utils/isHuggingChat";
import { base } from "$app/paths";
import { page } from "$app/stores";
import CarbonHelpFilled from "~icons/carbon/help-filled";
import... | chat-ui/src/routes/models/+page.svelte/0 | {
"file_path": "chat-ui/src/routes/models/+page.svelte",
"repo_id": "chat-ui",
"token_count": 1278
} | 74 |
import { collections } from "$lib/server/database";
import { error, type RequestHandler } from "@sveltejs/kit";
import { ObjectId } from "mongodb";
export const GET: RequestHandler = async ({ params }) => {
const assistant = await collections.assistants.findOne({
_id: new ObjectId(params.assistantId),
});
if (!a... | chat-ui/src/routes/settings/(nav)/assistants/[assistantId]/avatar.jpg/+server.ts/0 | {
"file_path": "chat-ui/src/routes/settings/(nav)/assistants/[assistantId]/avatar.jpg/+server.ts",
"repo_id": "chat-ui",
"token_count": 420
} | 75 |
import { base } from "$app/paths";
import { requiresUser } from "$lib/server/auth.js";
import { collections } from "$lib/server/database.js";
import { editableToolSchema } from "$lib/server/tools/index.js";
import { generateSearchTokens } from "$lib/utils/searchTokens.js";
import { error, fail, redirect } from "@svelte... | chat-ui/src/routes/tools/[toolId]/edit/+page.server.ts/0 | {
"file_path": "chat-ui/src/routes/tools/[toolId]/edit/+page.server.ts",
"repo_id": "chat-ui",
"token_count": 650
} | 76 |
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"values": "<DVC_METRIC_DATA>"
},
"title": "<DVC_METRIC_TITLE>",
"mark": {
"type": "line"
},
"encoding": {
"x": {
"field": "<DVC_METRIC_X>",
"type": "quantitative",
... | datasets/.dvc/plots/default.json/0 | {
"file_path": "datasets/.dvc/plots/default.json",
"repo_id": "datasets",
"token_count": 419
} | 77 |
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
title: "huggingface/datasets"
authors:
- family-names: Lhoest
given-names: Quentin
- family-names: Villanova del Moral
given-names: Albert
orcid: "https://orcid.org/0000-0003-1727-1045"
- family-names: von Platen
given-names: Patri... | datasets/CITATION.cff/0 | {
"file_path": "datasets/CITATION.cff",
"repo_id": "datasets",
"token_count": 1428
} | 78 |
# Create an audio dataset
You can share a dataset with your team or with anyone in the community by creating a dataset repository on the Hugging Face Hub:
```py
from datasets import load_dataset
dataset = load_dataset("<username>/my_dataset")
```
There are several methods for creating and sharing an audio dataset:
... | datasets/docs/source/audio_dataset.mdx/0 | {
"file_path": "datasets/docs/source/audio_dataset.mdx",
"repo_id": "datasets",
"token_count": 9772
} | 79 |
# Structure your repository
To host and share your dataset, create a dataset repository on the Hugging Face Hub and upload your data files.
This guide will show you how to structure your dataset repository when you upload it.
A dataset with a supported structure and file format (`.txt`, `.csv`, `.parquet`, `.jsonl`, ... | datasets/docs/source/repository_structure.mdx/0 | {
"file_path": "datasets/docs/source/repository_structure.mdx",
"repo_id": "datasets",
"token_count": 2555
} | 80 |
# Lint as: python3
"""HuggingFace/Datasets is an open library of datasets.
Note:
VERSION needs to be formatted following the MAJOR.MINOR.PATCH convention
(we need to follow this convention to be able to retrieve versioned scripts)
Simple check list for release from AllenNLP repo: https://github.com/allenai/all... | datasets/setup.py/0 | {
"file_path": "datasets/setup.py",
"repo_id": "datasets",
"token_count": 3782
} | 81 |
import contextlib
import copy
import fnmatch
import json
import math
import posixpath
import re
from io import BytesIO
from pathlib import Path
from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union
import fsspec
import numpy as np
from fsspec.core import url_to_fs
from huggingface_hub import (
... | datasets/src/datasets/dataset_dict.py/0 | {
"file_path": "datasets/src/datasets/dataset_dict.py",
"repo_id": "datasets",
"token_count": 45678
} | 82 |
# Copyright 2020 The HuggingFace Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | datasets/src/datasets/formatting/formatting.py/0 | {
"file_path": "datasets/src/datasets/formatting/formatting.py",
"repo_id": "datasets",
"token_count": 10919
} | 83 |
import multiprocessing
from typing import TYPE_CHECKING, Optional, Union
from .. import Dataset, Features, config
from ..formatting import query_table
from ..packaged_modules.sql.sql import Sql
from ..utils import tqdm as hf_tqdm
from .abc import AbstractDatasetInputStream
if TYPE_CHECKING:
import sqlite3
i... | datasets/src/datasets/io/sql.py/0 | {
"file_path": "datasets/src/datasets/io/sql.py",
"repo_id": "datasets",
"token_count": 2007
} | 84 |
import collections
import itertools
import os
from dataclasses import dataclass
from typing import List, Optional, Tuple, Type
import pandas as pd
import pyarrow as pa
import pyarrow.json as paj
import datasets
from datasets.features.features import FeatureType
logger = datasets.utils.logging.get_logger(__name__)
... | datasets/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py",
"repo_id": "datasets",
"token_count": 11915
} | 85 |
import itertools
from dataclasses import dataclass
from io import StringIO
from typing import Optional
import pyarrow as pa
import datasets
from datasets.features.features import require_storage_cast
from datasets.table import table_cast
logger = datasets.utils.logging.get_logger(__name__)
@dataclass
class TextCo... | datasets/src/datasets/packaged_modules/text/text.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/text/text.py",
"repo_id": "datasets",
"token_count": 2703
} | 86 |
"""Contains utilities to flag a feature as "experimental" in datasets."""
import warnings
from functools import wraps
from typing import Callable
def experimental(fn: Callable) -> Callable:
"""Decorator to flag a feature as experimental.
An experimental feature trigger a warning when used as it might be sub... | datasets/src/datasets/utils/experimental.py/0 | {
"file_path": "datasets/src/datasets/utils/experimental.py",
"repo_id": "datasets",
"token_count": 386
} | 87 |
from typing import List
import numpy as np
def _number_of_shards_in_gen_kwargs(gen_kwargs: dict) -> int:
"""Return the number of possible shards according to the input gen_kwargs"""
# Having lists of different sizes makes sharding ambigious, raise an error in this case
# until we decide how to define sha... | datasets/src/datasets/utils/sharding.py/0 | {
"file_path": "datasets/src/datasets/utils/sharding.py",
"repo_id": "datasets",
"token_count": 1742
} | 88 |
import pytest
import datasets
import datasets.config
# Import fixture modules as plugins
pytest_plugins = ["tests.fixtures.files", "tests.fixtures.hub", "tests.fixtures.fsspec"]
def pytest_collection_modifyitems(config, items):
# Mark tests as "unit" by default if not marked as "integration" (or already marked... | datasets/tests/conftest.py/0 | {
"file_path": "datasets/tests/conftest.py",
"repo_id": "datasets",
"token_count": 909
} | 89 |
import posixpath
from pathlib import Path
from unittest.mock import patch
import pytest
from fsspec.implementations.local import AbstractFileSystem, LocalFileSystem, stringify_path
from fsspec.registry import _registry as _fsspec_registry
class MockFileSystem(AbstractFileSystem):
protocol = "mock"
def __ini... | datasets/tests/fixtures/fsspec.py/0 | {
"file_path": "datasets/tests/fixtures/fsspec.py",
"repo_id": "datasets",
"token_count": 1757
} | 90 |
import importlib
import shutil
import textwrap
import pytest
from datasets import ClassLabel, DownloadManager, Features, Value
from datasets.builder import InvalidConfigName
from datasets.data_files import DataFilesDict, DataFilesList, get_data_patterns
from datasets.download.streaming_download_manager import Streami... | datasets/tests/packaged_modules/test_folder_based_builder.py/0 | {
"file_path": "datasets/tests/packaged_modules/test_folder_based_builder.py",
"repo_id": "datasets",
"token_count": 9076
} | 91 |
import os
import sys
from pathlib import Path
import pytest
from datasets import Dataset, IterableDataset
from datasets.distributed import split_dataset_by_node
from .utils import execute_subprocess_async, get_torch_dist_unique_port, require_torch
def test_split_dataset_by_node_map_style():
full_ds = Dataset.f... | datasets/tests/test_distributed.py/0 | {
"file_path": "datasets/tests/test_distributed.py",
"repo_id": "datasets",
"token_count": 2244
} | 92 |
import re
import sys
import tempfile
import unittest
from pathlib import Path
import pytest
import yaml
from huggingface_hub import DatasetCard, DatasetCardData
from datasets.config import METADATA_CONFIGS_FIELD
from datasets.info import DatasetInfo
from datasets.utils.metadata import MetadataConfigs
def _dedent(st... | datasets/tests/test_metadata_util.py/0 | {
"file_path": "datasets/tests/test_metadata_util.py",
"repo_id": "datasets",
"token_count": 5453
} | 93 |
# [The Hugging Face Deep Reinforcement Learning Course 🤗 (v2.0)](https://huggingface.co/deep-rl-course/unit0/introduction)
<img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit0/thumbnail.jpg" alt="Thumbnail"/>
If you like the course, don't hesitate to **⭐ star this ... | deep-rl-class/README.md/0 | {
"file_path": "deep-rl-class/README.md",
"repo_id": "deep-rl-class",
"token_count": 388
} | 94 |
# The certification process
The certification process is **completely free**:
- To get a *certificate of completion*: you need **to pass 80% of the assignments**.
- To get a *certificate of excellence*: you need **to pass 100% of the assignments**.
There's **no deadlines, the course is self-paced**.
<img src="http... | deep-rl-class/units/en/communication/certification.mdx/0 | {
"file_path": "deep-rl-class/units/en/communication/certification.mdx",
"repo_id": "deep-rl-class",
"token_count": 418
} | 95 |
# Type of tasks [[tasks]]
A task is an **instance** of a Reinforcement Learning problem. We can have two types of tasks: **episodic** and **continuing**.
## Episodic task [[episodic-task]]
In this case, we have a starting point and an ending point **(a terminal state). This creates an episode**: a list of States, Ac... | deep-rl-class/units/en/unit1/tasks.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit1/tasks.mdx",
"repo_id": "deep-rl-class",
"token_count": 436
} | 96 |
# Two types of value-based methods [[two-types-value-based-methods]]
In value-based methods, **we learn a value function** that **maps a state to the expected value of being at that state.**
<img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit3/vbm-1.jpg" alt="Value ... | deep-rl-class/units/en/unit2/two-types-value-based-methods.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit2/two-types-value-based-methods.mdx",
"repo_id": "deep-rl-class",
"token_count": 1727
} | 97 |
# Introduction [[introduction]]
<img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit6/thumbnail.png" alt="thumbnail"/>
In the last unit, we learned about Deep Q-Learning. In this value-based deep reinforcement learning algorithm, we **used a deep neural network to ... | deep-rl-class/units/en/unit4/introduction.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit4/introduction.mdx",
"repo_id": "deep-rl-class",
"token_count": 462
} | 98 |
# Conclusion [[conclusion]]
Congrats on finishing this unit and the tutorial. You've just trained your first virtual robots 🥳.
**Take time to grasp the material before continuing**. You can also look at the additional reading materials we provided in the *additional reading* section.
Finally, we would love **to hea... | deep-rl-class/units/en/unit6/conclusion.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit6/conclusion.mdx",
"repo_id": "deep-rl-class",
"token_count": 145
} | 99 |
# Conclusion [[Conclusion]]
That’s all for today. Congrats on finishing this unit and the tutorial!
The best way to learn is to practice and try stuff. **Why not improve the implementation to handle frames as input?**.
See you on second part of this Unit 🔥
## Keep Learning, Stay awesome 🤗
| deep-rl-class/units/en/unit8/conclusion.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit8/conclusion.mdx",
"repo_id": "deep-rl-class",
"token_count": 78
} | 100 |
# Decision Transformers
The Decision Transformer model was introduced by ["Decision Transformer: Reinforcement Learning via Sequence Modeling” by Chen L. et al](https://arxiv.org/abs/2106.01345). It abstracts Reinforcement Learning as a conditional-sequence modeling problem.
The main idea is that instead of training ... | deep-rl-class/units/en/unitbonus3/decision-transformers.mdx/0 | {
"file_path": "deep-rl-class/units/en/unitbonus3/decision-transformers.mdx",
"repo_id": "deep-rl-class",
"token_count": 543
} | 101 |
# The environment
<img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit13/il_tutorial_env.png" alt="IL tutorial environment"/>
The tutorial environment features a robot that needs to:
- Pull a lever to raise the stairs leading to the second room,
- Navigate to the ke... | deep-rl-class/units/en/unitbonus5/the-environment.mdx/0 | {
"file_path": "deep-rl-class/units/en/unitbonus5/the-environment.mdx",
"repo_id": "deep-rl-class",
"token_count": 140
} | 102 |
import glob
import sys
import pandas as pd
from huggingface_hub import hf_hub_download, upload_file
from huggingface_hub.utils._errors import EntryNotFoundError
sys.path.append(".")
from utils import BASE_PATH, FINAL_CSV_FILE, GITHUB_SHA, REPO_ID, collate_csv # noqa: E402
def has_previous_benchmark() -> str:
... | diffusers/benchmarks/push_results.py/0 | {
"file_path": "diffusers/benchmarks/push_results.py",
"repo_id": "diffusers",
"token_count": 1089
} | 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/advanced_inference/outpaint.md/0 | {
"file_path": "diffusers/docs/source/en/advanced_inference/outpaint.md",
"repo_id": "diffusers",
"token_count": 3145
} | 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/models/autoencoder_tiny.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/autoencoder_tiny.md",
"repo_id": "diffusers",
"token_count": 670
} | 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/pipelines/amused.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/amused.md",
"repo_id": "diffusers",
"token_count": 770
} | 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/api/pipelines/stable_audio.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/stable_audio.md",
"repo_id": "diffusers",
"token_count": 810
} | 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/api/pipelines/stable_diffusion/stable_diffusion_xl.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/stable_diffusion/stable_diffusion_xl.md",
"repo_id": "diffusers",
"token_count": 1005
} | 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/api/schedulers/multistep_dpm_solver_inverse.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/multistep_dpm_solver_inverse.md",
"repo_id": "diffusers",
"token_count": 547
} | 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/conceptual/evaluation.md/0 | {
"file_path": "diffusers/docs/source/en/conceptual/evaluation.md",
"repo_id": "diffusers",
"token_count": 8299
} | 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/optimization/torch2.0.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/torch2.0.md",
"repo_id": "diffusers",
"token_count": 7491
} | 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/en/training/sdxl.md/0 | {
"file_path": "diffusers/docs/source/en/training/sdxl.md",
"repo_id": "diffusers",
"token_count": 4393
} | 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/en/using-diffusers/custom_pipeline_overview.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/custom_pipeline_overview.md",
"repo_id": "diffusers",
"token_count": 6351
} | 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/en/using-diffusers/pag.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/pag.md",
"repo_id": "diffusers",
"token_count": 5181
} | 114 |
- sections:
- local: index
title: 🧨 Diffusers
- local: quicktour
title: クイックツアー
- local: stable_diffusion
title: 有効で効率の良い拡散モデル
- local: installation
title: インストール
title: はじめに
- sections:
- local: tutorials/tutorial_overview
title: 概要
- local: tutorials/autopipeline
title: AutoPipe... | diffusers/docs/source/ja/_toctree.yml/0 | {
"file_path": "diffusers/docs/source/ja/_toctree.yml",
"repo_id": "diffusers",
"token_count": 166
} | 115 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ko/optimization/coreml.md/0 | {
"file_path": "diffusers/docs/source/ko/optimization/coreml.md",
"repo_id": "diffusers",
"token_count": 8284
} | 116 |
<!--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/dreambooth.md/0 | {
"file_path": "diffusers/docs/source/ko/training/dreambooth.md",
"repo_id": "diffusers",
"token_count": 11694
} | 117 |
<!--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/kandinsky.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/kandinsky.md",
"repo_id": "diffusers",
"token_count": 16319
} | 118 |
<!--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/pt/installation.md/0 | {
"file_path": "diffusers/docs/source/pt/installation.md",
"repo_id": "diffusers",
"token_count": 2101
} | 119 |
from typing import Optional, Tuple, Union
import torch
from einops import rearrange, reduce
from diffusers import DDIMScheduler, DDPMScheduler, DiffusionPipeline, ImagePipelineOutput, UNet2DConditionModel
from diffusers.schedulers.scheduling_ddim import DDIMSchedulerOutput
from diffusers.schedulers.scheduling_ddpm im... | diffusers/examples/community/bit_diffusion.py/0 | {
"file_path": "diffusers/examples/community/bit_diffusion.py",
"repo_id": "diffusers",
"token_count": 4354
} | 120 |
import inspect
import time
from pathlib import Path
from typing import Callable, List, Optional, Union
import numpy as np
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers.configuration_utils import FrozenDict
from diffusers.models import AutoencoderKL, UNet2DCondit... | diffusers/examples/community/interpolate_stable_diffusion.py/0 | {
"file_path": "diffusers/examples/community/interpolate_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 11215
} | 121 |
#!/usr/bin/env python3
import torch
from diffusers import DiffusionPipeline
class UnetSchedulerOneForwardPipeline(DiffusionPipeline):
def __init__(self, unet, scheduler):
super().__init__()
self.register_modules(unet=unet, scheduler=scheduler)
def __call__(self):
image = torch.randn... | diffusers/examples/community/one_step_unet.py/0 | {
"file_path": "diffusers/examples/community/one_step_unet.py",
"repo_id": "diffusers",
"token_count": 299
} | 122 |
# Inspired by: https://github.com/haofanwang/ControlNet-for-Diffusers/
import inspect
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import PIL.Image
import torch
import torch.nn.functional as F
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from di... | diffusers/examples/community/stable_diffusion_controlnet_inpaint.py/0 | {
"file_path": "diffusers/examples/community/stable_diffusion_controlnet_inpaint.py",
"repo_id": "diffusers",
"token_count": 23757
} | 123 |
# 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/controlnet/test_controlnet.py/0 | {
"file_path": "diffusers/examples/controlnet/test_controlnet.py",
"repo_id": "diffusers",
"token_count": 2010
} | 124 |
# Overview
These examples show how to run [Diffuser](https://arxiv.org/abs/2205.09991) in Diffusers.
There are two ways to use the script, `run_diffuser_locomotion.py`.
The key option is a change of the variable `n_guide_steps`.
When `n_guide_steps=0`, the trajectories are sampled from the diffusion model, but not fi... | diffusers/examples/reinforcement_learning/README.md/0 | {
"file_path": "diffusers/examples/reinforcement_learning/README.md",
"repo_id": "diffusers",
"token_count": 349
} | 125 |
# InstructPix2Pix text-to-edit-image fine-tuning
This extended LoRA training script was authored by [Aiden-Frost](https://github.com/Aiden-Frost).
This is an experimental LoRA extension of [this example](https://github.com/huggingface/diffusers/blob/main/examples/instruct_pix2pix/train_instruct_pix2pix.py). This script... | diffusers/examples/research_projects/instructpix2pix_lora/README.md/0 | {
"file_path": "diffusers/examples/research_projects/instructpix2pix_lora/README.md",
"repo_id": "diffusers",
"token_count": 1120
} | 126 |
import argparse
import itertools
import json
import logging
import math
import uuid
import warnings
from os import environ, listdir, makedirs
from os.path import basename, join
from pathlib import Path
from typing import List
import datasets
import numpy as np
import torch
import torch.nn.functional as F
import torch.... | diffusers/examples/research_projects/multi_subject_dreambooth/train_multi_subject_dreambooth.py/0 | {
"file_path": "diffusers/examples/research_projects/multi_subject_dreambooth/train_multi_subject_dreambooth.py",
"repo_id": "diffusers",
"token_count": 21771
} | 127 |
"""
Ported from Paella
"""
import torch
from torch import nn
from diffusers.configuration_utils import ConfigMixin, register_to_config
from diffusers.models.modeling_utils import ModelMixin
# Discriminator model ported from Paella https://github.com/dome272/Paella/blob/main/src_distributed/vqgan.py
class Discrimina... | diffusers/examples/vqgan/discriminator.py/0 | {
"file_path": "diffusers/examples/vqgan/discriminator.py",
"repo_id": "diffusers",
"token_count": 871
} | 128 |
import argparse
import torch
from safetensors.torch import load_file
from diffusers import MotionAdapter
def convert_motion_module(original_state_dict):
converted_state_dict = {}
for k, v in original_state_dict.items():
if "pos_encoder" in k:
continue
else:
converted... | diffusers/scripts/convert_animatediff_motion_module_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_animatediff_motion_module_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 873
} | 129 |
import argparse
import torch
from diffusers import HunyuanDiT2DControlNetModel
def main(args):
state_dict = torch.load(args.pt_checkpoint_path, map_location="cpu")
if args.load_key != "none":
try:
state_dict = state_dict[args.load_key]
except KeyError:
raise KeyError... | diffusers/scripts/convert_hunyuandit_controlnet_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_hunyuandit_controlnet_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 5703
} | 130 |
import argparse
import safetensors.torch
from diffusers import AutoencoderTiny
"""
Example - From the diffusers root directory:
Download the weights:
```sh
$ wget -q https://huggingface.co/madebyollin/taesd/resolve/main/taesd_encoder.safetensors
$ wget -q https://huggingface.co/madebyollin/taesd/resolve/main/taesd... | diffusers/scripts/convert_tiny_autoencoder_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_tiny_autoencoder_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 990
} | 131 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/commands/fp16_safetensors.py/0 | {
"file_path": "diffusers/src/diffusers/commands/fp16_safetensors.py",
"repo_id": "diffusers",
"token_count": 2248
} | 132 |
# 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/single_file_model.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/single_file_model.py",
"repo_id": "diffusers",
"token_count": 6195
} | 133 |
# 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/autoencoders/autoencoder_kl_cogvideox.py/0 | {
"file_path": "diffusers/src/diffusers/models/autoencoders/autoencoder_kl_cogvideox.py",
"repo_id": "diffusers",
"token_count": 24149
} | 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/embeddings_flax.py/0 | {
"file_path": "diffusers/src/diffusers/models/embeddings_flax.py",
"repo_id": "diffusers",
"token_count": 1401
} | 135 |
# Copyright 2024 HunyuanDiT Authors, Qixun Wang 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/models/transformers/hunyuan_transformer_2d.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/hunyuan_transformer_2d.py",
"repo_id": "diffusers",
"token_count": 10620
} | 136 |
# 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_2d_blocks_flax.py/0 | {
"file_path": "diffusers/src/diffusers/models/unets/unet_2d_blocks_flax.py",
"repo_id": "diffusers",
"token_count": 6961
} | 137 |
from typing import TYPE_CHECKING
from ..utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_flax_available,
is_k_diffusion_available,
is_librosa_available,
is_note_seq_available,
is_onnx_available,
is_sentencepiece_avail... | diffusers/src/diffusers/pipelines/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/__init__.py",
"repo_id": "diffusers",
"token_count": 12743
} | 138 |
# Copyright 2024 CVSSP, ByteDance and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | diffusers/src/diffusers/pipelines/audioldm2/pipeline_audioldm2.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/audioldm2/pipeline_audioldm2.py",
"repo_id": "diffusers",
"token_count": 23741
} | 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/dance_diffusion/pipeline_dance_diffusion.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/dance_diffusion/pipeline_dance_diffusion.py",
"repo_id": "diffusers",
"token_count": 2622
} | 140 |
# Deprecated Pipelines
This folder contains pipelines that have very low usage as measured by model downloads, issues and PRs. While you can still use the pipelines just as before, we will stop testing the pipelines and will not accept any changes to existing files. | diffusers/src/diffusers/pipelines/deprecated/README.md/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/README.md",
"repo_id": "diffusers",
"token_count": 54
} | 141 |
from typing import TYPE_CHECKING
from ....utils import DIFFUSERS_SLOW_IMPORT, _LazyModule
_import_structure = {"pipeline_score_sde_ve": ["ScoreSdeVePipeline"]}
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
from .pipeline_score_sde_ve import ScoreSdeVePipeline
else:
import sys
sys.modules[__name__] = _Laz... | diffusers/src/diffusers/pipelines/deprecated/score_sde_ve/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/score_sde_ve/__init__.py",
"repo_id": "diffusers",
"token_count": 193
} | 142 |
from typing import TYPE_CHECKING
from ....utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
is_torch_available,
is_transformers_available,
is_transformers_version,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_available() and i... | diffusers/src/diffusers/pipelines/deprecated/versatile_diffusion/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/versatile_diffusion/__init__.py",
"repo_id": "diffusers",
"token_count": 1112
} | 143 |
# 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_img2img.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py",
"repo_id": "diffusers",
"token_count": 7952
} | 144 |
# Copyright 2024 Open AI and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | diffusers/src/diffusers/pipelines/shap_e/camera.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/shap_e/camera.py",
"repo_id": "diffusers",
"token_count": 2274
} | 145 |
# 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_flax_stable_diffusion_img2img.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py",
"repo_id": "diffusers",
"token_count": 9901
} | 146 |
# 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_unclip_img2img.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py",
"repo_id": "diffusers",
"token_count": 17373
} | 147 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_k_diffusion_available,
is_k_diffusion_version,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure... | diffusers/src/diffusers/pipelines/stable_diffusion_k_diffusion/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_k_diffusion/__init__.py",
"repo_id": "diffusers",
"token_count": 812
} | 148 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
is_torch_available,
is_transformers_available,
is_transformers_version,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_available() and is... | diffusers/src/diffusers/pipelines/unclip/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/unclip/__init__.py",
"repo_id": "diffusers",
"token_count": 700
} | 149 |
# Copyright 2024 UC Berkeley Team and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | diffusers/src/diffusers/schedulers/scheduling_ddpm_flax.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_ddpm_flax.py",
"repo_id": "diffusers",
"token_count": 5292
} | 150 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.