text stringlengths 7 1.24M | id stringlengths 14 166 | metadata dict | __index_level_0__ int64 0 519 |
|---|---|---|---|
//! Group Normalization.
//!
//! This layer applies Group Normalization over a mini-batch of inputs.
use candle::{DType, Result, Tensor};
// This group norm version handles both weight and bias so removes the mean.
#[derive(Clone, Debug)]
pub struct GroupNorm {
weight: Tensor,
bias: Tensor,
eps: f64,
n... | candle/candle-nn/src/group_norm.rs/0 | {
"file_path": "candle/candle-nn/src/group_norm.rs",
"repo_id": "candle",
"token_count": 1372
} | 40 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use anyhow::Result;
use candle::{test_utils, Device, Tensor};
use candle_nn::{LayerNorm, Module};
#[test]
fn layer_norm() -> Result<()> {
let device = &Device::Cpu;
let w = Tensor::new(&[3f32], dev... | candle/candle-nn/tests/layer_norm.rs/0 | {
"file_path": "candle/candle-nn/tests/layer_norm.rs",
"repo_id": "candle",
"token_count": 892
} | 41 |
from .module import Module
from typing import Optional, Tuple, Any
from candle import Tensor
import candle
class Embedding(Module):
"""A simple lookup table that stores embeddings of a fixed dictionary and size.
This module is often used to store word embeddings and retrieve them using indices.
The input... | candle/candle-pyo3/py_src/candle/nn/sparse.py/0 | {
"file_path": "candle/candle-pyo3/py_src/candle/nn/sparse.py",
"repo_id": "candle",
"token_count": 590
} | 42 |
use super::with_tracing::{linear, Embedding, Linear};
use candle::{Module, Result, Tensor, D};
use candle_nn::{layer_norm, LayerNorm, VarBuilder};
use serde::Deserialize;
#[derive(Debug, Clone, Deserialize)]
pub struct Config {
pub vocab_size: usize,
pub hidden_size: usize,
pub encoder_hidden_size: usize,
... | candle/candle-transformers/src/models/blip_text.rs/0 | {
"file_path": "candle/candle-transformers/src/models/blip_text.rs",
"repo_id": "candle",
"token_count": 7148
} | 43 |
use candle::{IndexOp, Result, Tensor, D};
use candle_nn::{layer_norm, LayerNorm, Linear, Module, VarBuilder};
const IMG_SIZE: usize = 448;
const PATCH_SIZE: usize = 14;
const NUM_CLASSES: usize = 1000;
fn linear(vb: VarBuilder, in_dim: usize, out_dim: usize, bias: bool) -> Result<Linear> {
if bias {
candl... | candle/candle-transformers/src/models/eva2.rs/0 | {
"file_path": "candle/candle-transformers/src/models/eva2.rs",
"repo_id": "candle",
"token_count": 7222
} | 44 |
pub mod config;
pub mod utils;
use crate::models::clip::vision_model::{ClipVisionConfig, ClipVisionTransformer};
use crate::models::llama::{Cache, Llama};
use crate::models::with_tracing::linear;
use candle::{bail, Device, IndexOp, Result, Tensor};
use candle_nn::{seq, Activation, Module, Sequential, VarBuilder};
use... | candle/candle-transformers/src/models/llava/mod.rs/0 | {
"file_path": "candle/candle-transformers/src/models/llava/mod.rs",
"repo_id": "candle",
"token_count": 8602
} | 45 |
pub mod based;
pub mod beit;
pub mod bert;
pub mod bigcode;
pub mod blip;
pub mod blip_text;
pub mod chatglm;
pub mod clip;
pub mod codegeex4_9b;
pub mod convmixer;
pub mod convnext;
pub mod dac;
pub mod depth_anything_v2;
pub mod dinov2;
pub mod dinov2reg4;
pub mod distilbert;
pub mod efficientnet;
pub mod efficientvi... | candle/candle-transformers/src/models/mod.rs/0 | {
"file_path": "candle/candle-transformers/src/models/mod.rs",
"repo_id": "candle",
"token_count": 661
} | 46 |
use crate::quantized_nn::{layer_norm, linear, Linear};
pub use crate::quantized_var_builder::VarBuilder;
use candle::{DType, Device, IndexOp, Module, Result, Tensor, D};
use candle_nn::Activation;
pub use crate::models::mixformer::Config;
const MAX_SEQ_LEN: usize = 4096;
#[derive(Debug, Clone)]
struct Embedding {
... | candle/candle-transformers/src/models/quantized_mixformer.rs/0 | {
"file_path": "candle/candle-transformers/src/models/quantized_mixformer.rs",
"repo_id": "candle",
"token_count": 6388
} | 47 |
use super::with_tracing::{layer_norm, linear_no_bias as linear, LayerNorm, Linear};
use candle::{DType, Device, IndexOp, Result, Tensor};
use candle_nn::{embedding, Embedding, Module, VarBuilder};
use std::collections::{HashMap, HashSet};
fn default_num_attention_heads() -> usize {
64
}
// https://huggingface.co/... | candle/candle-transformers/src/models/rwkv_v5.rs/0 | {
"file_path": "candle/candle-transformers/src/models/rwkv_v5.rs",
"repo_id": "candle",
"token_count": 7710
} | 48 |
pub mod attention;
pub mod clip;
pub mod ddim;
pub mod ddpm;
pub mod embeddings;
pub mod euler_ancestral_discrete;
pub mod resnet;
pub mod schedulers;
pub mod unet_2d;
pub mod unet_2d_blocks;
pub mod utils;
pub mod vae;
use std::sync::Arc;
use candle::{DType, Device, Result};
use candle_nn as nn;
use self::scheduler... | candle/candle-transformers/src/models/stable_diffusion/mod.rs/0 | {
"file_path": "candle/candle-transformers/src/models/stable_diffusion/mod.rs",
"repo_id": "candle",
"token_count": 7668
} | 49 |
use candle::{Device, Result, Tensor};
use candle_transformers::generation::LogitsProcessor;
#[test]
fn sample_with_zero_temperature() -> Result<()> {
let mut logits_process = LogitsProcessor::new(1337, None, None);
let logits = Tensor::new(&[0.1, 0.2, 0.3, 0.4], &Device::Cpu)?;
let token = logits_process.s... | candle/candle-transformers/tests/generation_tests.rs/0 | {
"file_path": "candle/candle-transformers/tests/generation_tests.rs",
"repo_id": "candle",
"token_count": 806
} | 50 |
use wasm_bindgen::prelude::*;
pub mod token_output_stream;
#[wasm_bindgen]
extern "C" {
// Use `js_namespace` here to bind `console.log(..)` instead of just
// `log(..)`
#[wasm_bindgen(js_namespace = console)]
pub fn log(s: &str);
}
#[macro_export]
macro_rules! console_log {
// Note that this is u... | candle/candle-wasm-examples/blip/src/lib.rs/0 | {
"file_path": "candle/candle-wasm-examples/blip/src/lib.rs",
"repo_id": "candle",
"token_count": 192
} | 51 |
cargo build --target wasm32-unknown-unknown --release
wasm-bindgen ../../target/wasm32-unknown-unknown/release/m.wasm --out-dir build --target web
| candle/candle-wasm-examples/segment-anything/build-lib.sh/0 | {
"file_path": "candle/candle-wasm-examples/segment-anything/build-lib.sh",
"repo_id": "candle",
"token_count": 48
} | 52 |
## Running Whisper Examples
Here, we provide two examples of how to run Whisper using a Candle-compiled WASM binary and runtimes.
### Pure Rust UI
To build and test the UI made in Rust you will need [Trunk](https://trunkrs.dev/#install)
From the `candle-wasm-examples/whisper` directory run:
Download assets:
```bas... | candle/candle-wasm-examples/whisper/README.md/0 | {
"file_path": "candle/candle-wasm-examples/whisper/README.md",
"repo_id": "candle",
"token_count": 1023
} | 53 |
{
"moz:firefoxOptions": {
"prefs": {
"media.navigator.streams.fake": true,
"media.navigator.permission.disabled": true
},
"args": []
},
"goog:chromeOptions": {
"args": [
"--use-fake-device-for-media-stream",
"--use-fake-ui-for-media-stream"
]
}
}
| candle/candle-wasm-tests/webdriver.json/0 | {
"file_path": "candle/candle-wasm-tests/webdriver.json",
"repo_id": "candle",
"token_count": 143
} | 54 |
export default {
"*.{js,jsx,ts,tsx}": ["prettier --write", "eslint --fix", "eslint"],
"*.json": ["prettier --write"],
};
| chat-ui/.husky/lint-stage-config.js/0 | {
"file_path": "chat-ui/.husky/lint-stage-config.js",
"repo_id": "chat-ui",
"token_count": 54
} | 55 |
{{- if $.Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
labels: {{ include "labels.standard" . | nindent 4 }}
name: {{ include "name" . }}
namespace: {{ .Release.Namespace }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include... | chat-ui/chart/templates/hpa.yaml/0 | {
"file_path": "chat-ui/chart/templates/hpa.yaml",
"repo_id": "chat-ui",
"token_count": 543
} | 56 |
# Cohere
| Feature | Available |
| --------------------------- | --------- |
| [Tools](../tools) | Yes |
| [Multimodal](../multimodal) | No |
You may use Cohere to run their models directly from Chat UI. You will need to have a Cohere account, then get your [API token](https... | chat-ui/docs/source/configuration/models/providers/cohere.md/0 | {
"file_path": "chat-ui/docs/source/configuration/models/providers/cohere.md",
"repo_id": "chat-ui",
"token_count": 342
} | 57 |
# Helm
<Tip warning={true}>
**We highly discourage using the chart**. The Helm chart is a work in progress and should be considered unstable. Breaking changes to the chart may be pushed without migration guides or notice. Contributions welcome!
</Tip>
For installation on Kubernetes, you may use the helm chart in `/... | chat-ui/docs/source/installation/helm.md/0 | {
"file_path": "chat-ui/docs/source/installation/helm.md",
"repo_id": "chat-ui",
"token_count": 292
} | 58 |
import type { EndpointParameters } from "./server/endpoints/endpoints";
import type { BackendModel } from "./server/models";
import type { Tool, ToolResult } from "./types/Tool";
type buildPromptOptions = Pick<EndpointParameters, "messages" | "preprompt" | "continueMessage"> & {
model: BackendModel;
tools?: Tool[];
... | chat-ui/src/lib/buildPrompt.ts/0 | {
"file_path": "chat-ui/src/lib/buildPrompt.ts",
"repo_id": "chat-ui",
"token_count": 421
} | 59 |
<script lang="ts">
import {
MessageWebSearchUpdateType,
type MessageWebSearchUpdate,
} from "$lib/types/MessageUpdate";
import { isMessageWebSearchSourcesUpdate } from "$lib/utils/messageUpdates";
import CarbonError from "~icons/carbon/error-filled";
import EosIconsLoading from "~icons/eos-icons/loading";
im... | chat-ui/src/lib/components/OpenWebSearchResults.svelte/0 | {
"file_path": "chat-ui/src/lib/components/OpenWebSearchResults.svelte",
"repo_id": "chat-ui",
"token_count": 1812
} | 60 |
<script lang="ts">
import { webSearchParameters } from "$lib/stores/webSearchParameters";
import CarbonInformation from "~icons/carbon/information";
import Switch from "./Switch.svelte";
const toggle = () => ($webSearchParameters.useSearch = !$webSearchParameters.useSearch);
</script>
<div
class="flex h-8 cursor... | chat-ui/src/lib/components/WebSearchToggle.svelte/0 | {
"file_path": "chat-ui/src/lib/components/WebSearchToggle.svelte",
"repo_id": "chat-ui",
"token_count": 447
} | 61 |
<script lang="ts">
import { page } from "$app/stores";
import { env as envPublic } from "$env/dynamic/public";
import { base } from "$app/paths";
export let classNames = "";
</script>
{#if envPublic.PUBLIC_APP_ASSETS === "chatui"}
<svg
height="30"
width="30"
viewBox="0 0 30 30"
xmlns="http://www.w3.org/2... | chat-ui/src/lib/components/icons/Logo.svelte/0 | {
"file_path": "chat-ui/src/lib/components/icons/Logo.svelte",
"repo_id": "chat-ui",
"token_count": 550
} | 62 |
import type { ObjectId } from "mongodb";
import updateSearchAssistant from "./01-update-search-assistants";
import updateAssistantsModels from "./02-update-assistants-models";
import type { Database } from "$lib/server/database";
import addToolsToSettings from "./03-add-tools-in-settings";
import updateMessageUpdates ... | chat-ui/src/lib/migrations/routines/index.ts/0 | {
"file_path": "chat-ui/src/lib/migrations/routines/index.ts",
"repo_id": "chat-ui",
"token_count": 322
} | 63 |
import { z } from "zod";
import { env } from "$env/dynamic/private";
import type { Endpoint } from "../endpoints";
import type { TextGenerationStreamOutput } from "@huggingface/inference";
import type { Cohere, CohereClient } from "cohere-ai";
import { buildPrompt } from "$lib/buildPrompt";
import { ToolResultStatus, t... | chat-ui/src/lib/server/endpoints/cohere/endpointCohere.ts/0 | {
"file_path": "chat-ui/src/lib/server/endpoints/cohere/endpointCohere.ts",
"repo_id": "chat-ui",
"token_count": 2177
} | 64 |
import { smallModel } from "$lib/server/models";
import type { EndpointMessage } from "./endpoints/endpoints";
export async function generateFromDefaultEndpoint({
messages,
preprompt,
generateSettings,
}: {
messages: EndpointMessage[];
preprompt?: string;
generateSettings?: Record<string, unknown>;
}): Promise<s... | chat-ui/src/lib/server/generateFromDefaultEndpoint.ts/0 | {
"file_path": "chat-ui/src/lib/server/generateFromDefaultEndpoint.ts",
"repo_id": "chat-ui",
"token_count": 299
} | 65 |
import type { ToolIOType, ToolOutputComponents } from "$lib/types/Tool";
export const ToolOutputPaths: Record<
ToolOutputComponents,
{
type: ToolIOType;
path: string;
}
> = {
textbox: {
type: "str",
path: "$",
},
markdown: {
type: "str",
path: "$",
},
number: {
type: "float",
path: "$",
},
im... | chat-ui/src/lib/server/tools/outputs.ts/0 | {
"file_path": "chat-ui/src/lib/server/tools/outputs.ts",
"repo_id": "chat-ui",
"token_count": 344
} | 66 |
import {
chromium,
devices,
type Page,
type BrowserContextOptions,
type Response,
type Browser,
} from "playwright";
import { PlaywrightBlocker } from "@cliqz/adblocker-playwright";
import { env } from "$env/dynamic/private";
import { logger } from "$lib/server/logger";
import { onExit } from "$lib/server/exitHan... | chat-ui/src/lib/server/websearch/scrape/playwright.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/scrape/playwright.ts",
"repo_id": "chat-ui",
"token_count": 849
} | 67 |
import type { Message } from "$lib/types/Message";
import { getContext, setContext } from "svelte";
import { writable, type Writable } from "svelte/store";
// used to store the id of the message that is the currently displayed leaf of the conversation tree
// (that is the last message in the current branch of the conv... | chat-ui/src/lib/stores/convTree.ts/0 | {
"file_path": "chat-ui/src/lib/stores/convTree.ts",
"repo_id": "chat-ui",
"token_count": 216
} | 68 |
import type { WebSearchSource } from "$lib/types/WebSearch";
import type { ToolCall, ToolResult } from "$lib/types/Tool";
export type MessageUpdate =
| MessageStatusUpdate
| MessageTitleUpdate
| MessageToolUpdate
| MessageWebSearchUpdate
| MessageStreamUpdate
| MessageFileUpdate
| MessageFinalAnswerUpdate;
exp... | chat-ui/src/lib/types/MessageUpdate.ts/0 | {
"file_path": "chat-ui/src/lib/types/MessageUpdate.ts",
"repo_id": "chat-ui",
"token_count": 929
} | 69 |
import { browser } from "$app/environment";
export function cookiesAreEnabled(): boolean {
if (!browser) return false;
if (navigator.cookieEnabled) return navigator.cookieEnabled;
// Create cookie
document.cookie = "cookietest=1";
const ret = document.cookie.indexOf("cookietest=") != -1;
// Delete cookie
docum... | chat-ui/src/lib/utils/cookiesAreEnabled.ts/0 | {
"file_path": "chat-ui/src/lib/utils/cookiesAreEnabled.ts",
"repo_id": "chat-ui",
"token_count": 127
} | 70 |
export function parseStringToList(links: unknown): string[] {
if (typeof links !== "string") {
throw new Error("Expected a string");
}
return links
.split(",")
.map((link) => link.trim())
.filter((link) => link.length > 0);
}
| chat-ui/src/lib/utils/parseStringToList.ts/0 | {
"file_path": "chat-ui/src/lib/utils/parseStringToList.ts",
"repo_id": "chat-ui",
"token_count": 86
} | 71 |
import { collections } from "$lib/server/database";
import { ObjectId } from "mongodb";
import { describe, expect, it } from "vitest";
import { convertLegacyConversation } from "./convertLegacyConversation";
import { insertLegacyConversation } from "./treeHelpers.spec";
describe("convertLegacyConversation", () => {
... | chat-ui/src/lib/utils/tree/convertLegacyConversation.spec.ts/0 | {
"file_path": "chat-ui/src/lib/utils/tree/convertLegacyConversation.spec.ts",
"repo_id": "chat-ui",
"token_count": 425
} | 72 |
import { Client } from "@gradio/client";
export async function GET({ url, locals }) {
// XXX: feature_flag_tools
if (!locals.user?.isEarlyAccess) {
return new Response("Not early access", { status: 403 });
}
const space = url.searchParams.get("space");
if (!space) {
return new Response("Missing space", { st... | chat-ui/src/routes/api/spaces-config/+server.ts/0 | {
"file_path": "chat-ui/src/routes/api/spaces-config/+server.ts",
"repo_id": "chat-ui",
"token_count": 419
} | 73 |
import { authCondition } from "$lib/server/auth";
import { collections } from "$lib/server/database";
import { error } from "@sveltejs/kit";
import { ObjectId } from "mongodb";
import { z } from "zod";
export async function POST({ params, request, locals }) {
const { score } = z
.object({
score: z.number().int()... | chat-ui/src/routes/conversation/[id]/message/[messageId]/vote/+server.ts/0 | {
"file_path": "chat-ui/src/routes/conversation/[id]/message/[messageId]/vote/+server.ts",
"repo_id": "chat-ui",
"token_count": 336
} | 74 |
<script lang="ts">
import { marked } from "marked";
import privacy from "../../../PRIVACY.md?raw";
</script>
<div class="overflow-auto p-6">
<div class="prose mx-auto px-4 pb-24 pt-6 dark:prose-invert md:pt-12">
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html marked(privacy, { gfm: true })}
</d... | chat-ui/src/routes/privacy/+page.svelte/0 | {
"file_path": "chat-ui/src/routes/privacy/+page.svelte",
"repo_id": "chat-ui",
"token_count": 141
} | 75 |
import { collections } from "$lib/server/database";
import type { LayoutServerLoad } from "./$types";
import type { Report } from "$lib/types/Report";
export const load = (async ({ locals, parent }) => {
const { assistants } = await parent();
let reportsByUser: string[] = [];
const createdBy = locals.user?._id ?? ... | chat-ui/src/routes/settings/+layout.server.ts/0 | {
"file_path": "chat-ui/src/routes/settings/+layout.server.ts",
"repo_id": "chat-ui",
"token_count": 262
} | 76 |
@import "./highlight-js.css";
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
.btn {
@apply inline-flex flex-shrink-0 cursor-pointer select-none items-center justify-center whitespace-nowrap outline-none transition-all focus:ring disabled:cursor-default;
}
}
@layer utilities {
.sc... | chat-ui/src/styles/main.css/0 | {
"file_path": "chat-ui/src/styles/main.css",
"repo_id": "chat-ui",
"token_count": 189
} | 77 |
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/datasets-logo-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/d... | datasets/README.md/0 | {
"file_path": "datasets/README.md",
"repo_id": "datasets",
"token_count": 3918
} | 78 |
<!---
Copyright 2020 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 ... | datasets/docs/README.md/0 | {
"file_path": "datasets/docs/README.md",
"repo_id": "datasets",
"token_count": 3059
} | 79 |
# Create a dataset
Sometimes, you may need to create a dataset if you're working with your own data. Creating a dataset with 🤗 Datasets confers all the advantages of the library to your dataset: fast loading and processing, [stream enormous datasets](stream), [memory-mapping](https://huggingface.co/course/chapter5/4?... | datasets/docs/source/create_dataset.mdx/0 | {
"file_path": "datasets/docs/source/create_dataset.mdx",
"repo_id": "datasets",
"token_count": 2035
} | 80 |
# Load
Your data can be stored in various places; they can be on your local machine's disk, in a Github repository, and in in-memory data structures like Python dictionaries and Pandas DataFrames. Wherever a dataset is stored, 🤗 Datasets can help you load it.
This guide will show you how to load a dataset from:
- T... | datasets/docs/source/loading.mdx/0 | {
"file_path": "datasets/docs/source/loading.mdx",
"repo_id": "datasets",
"token_count": 6249
} | 81 |
# Troubleshooting
This guide aims to provide you the tools and knowledge required to navigate some common issues. If the suggestions listed
in this guide do not cover your such situation, please refer to the [Asking for Help](#asking-for-help) section to learn where to
find help with your specific issue.
## Issues w... | datasets/docs/source/troubleshoot.mdx/0 | {
"file_path": "datasets/docs/source/troubleshoot.mdx",
"repo_id": "datasets",
"token_count": 1470
} | 82 |
import io
import os
from typing import Iterable, List, Optional, Tuple, Union
from ..utils.file_utils import ( # noqa: F401 # backward compatibility
SINGLE_FILE_COMPRESSION_PROTOCOLS,
ArchiveIterable,
FilesIterable,
_get_extraction_protocol,
_get_path_extension,
_prepare_path_and_storage_optio... | datasets/src/datasets/download/streaming_download_manager.py/0 | {
"file_path": "datasets/src/datasets/download/streaming_download_manager.py",
"repo_id": "datasets",
"token_count": 3283
} | 83 |
# Copyright 2020 The HuggingFace Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | datasets/src/datasets/formatting/torch_formatter.py/0 | {
"file_path": "datasets/src/datasets/formatting/torch_formatter.py",
"repo_id": "datasets",
"token_count": 1898
} | 84 |
# Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | datasets/src/datasets/naming.py/0 | {
"file_path": "datasets/src/datasets/naming.py",
"repo_id": "datasets",
"token_count": 1179
} | 85 |
import contextlib
from multiprocessing import Pool, RLock
from tqdm.auto import tqdm
from ..utils import experimental, logging
logger = logging.get_logger(__name__)
class ParallelBackendConfig:
backend_name = None
@experimental
def parallel_map(function, iterable, num_proc, batched, batch_size, types, disab... | datasets/src/datasets/parallel/parallel.py/0 | {
"file_path": "datasets/src/datasets/parallel/parallel.py",
"repo_id": "datasets",
"token_count": 1783
} | 86 |
import enum
import os
from typing import Optional
from huggingface_hub.utils import insecure_hashlib
from .. import config
from ..exceptions import (
ExpectedMoreDownloadedFilesError,
ExpectedMoreSplitsError,
NonMatchingChecksumError,
NonMatchingSplitsSizesError,
UnexpectedDownloadedFileError,
... | datasets/src/datasets/utils/info_utils.py/0 | {
"file_path": "datasets/src/datasets/utils/info_utils.py",
"repo_id": "datasets",
"token_count": 1731
} | 87 |
import os
from typing import Dict, List, Tuple, TypeVar, Union
T = TypeVar("T")
ListLike = Union[List[T], Tuple[T, ...]]
NestedDataStructureLike = Union[T, List[T], Dict[str, T]]
PathLike = Union[str, bytes, os.PathLike]
| datasets/src/datasets/utils/typing.py/0 | {
"file_path": "datasets/src/datasets/utils/typing.py",
"repo_id": "datasets",
"token_count": 84
} | 88 |
from unittest.mock import patch
import pyspark
import pytest
from datasets.builder import InvalidConfigName
from datasets.data_files import DataFilesList
from datasets.packaged_modules.spark.spark import (
Spark,
SparkConfig,
SparkExamplesIterable,
_generate_iterable_examples,
)
from ..utils import (... | datasets/tests/packaged_modules/test_spark.py/0 | {
"file_path": "datasets/tests/packaged_modules/test_spark.py",
"repo_id": "datasets",
"token_count": 2261
} | 89 |
import os
import re
from pathlib import Path
from unittest.mock import patch
import pytest
import zstandard as zstd
from fsspec.registry import _registry as _fsspec_registry
from fsspec.spec import AbstractBufferedFile, AbstractFileSystem
from datasets.download.download_config import DownloadConfig
from datasets.util... | datasets/tests/test_file_utils.py/0 | {
"file_path": "datasets/tests/test_file_utils.py",
"repo_id": "datasets",
"token_count": 17513
} | 90 |
import os
import tempfile
from functools import partial
from unittest import TestCase
from unittest.mock import patch
import numpy as np
import pytest
from datasets.arrow_dataset import Dataset
from datasets.search import ElasticSearchIndex, FaissIndex, MissingIndex
from .utils import require_elasticsearch, require_... | datasets/tests/test_search.py/0 | {
"file_path": "datasets/tests/test_search.py",
"repo_id": "datasets",
"token_count": 4505
} | 91 |
# Setup [[setup]]
After all this information, it's time to get started. We're going to do two things:
1. **Create your Hugging Face account** if it's not already done
2. **Sign up to Discord and introduce yourself** (don't be shy 🤗)
### Let's create my Hugging Face account
(If it's not already done) create an acco... | deep-rl-class/units/en/unit0/setup.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit0/setup.mdx",
"repo_id": "deep-rl-class",
"token_count": 389
} | 92 |
# Conclusion [[conclusion]]
Congrats on finishing this chapter! There was a lot of information. And congrats on finishing the tutorials. You’ve just implemented your first RL agent from scratch and shared it on the Hub 🥳.
Implementing from scratch when you study a new architecture **is important to understand how it... | deep-rl-class/units/en/unit2/conclusion.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit2/conclusion.mdx",
"repo_id": "deep-rl-class",
"token_count": 337
} | 93 |
# The Deep Q-Network (DQN) [[deep-q-network]]
This is the architecture of our Deep Q-Learning network:
<img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit4/deep-q-network.jpg" alt="Deep Q Network"/>
As input, we take a **stack of 4 frames** passed through the netwo... | deep-rl-class/units/en/unit3/deep-q-network.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit3/deep-q-network.mdx",
"repo_id": "deep-rl-class",
"token_count": 888
} | 94 |
# Bonus: Learn to create your own environments with Unity and MLAgents
**You can create your own reinforcement learning environments with Unity and MLAgents**. Using a game engine such as Unity can be intimidating at first, but here are the steps you can take to learn smoothly.
## Step 1: Know how to use Unity
- The... | deep-rl-class/units/en/unit5/bonus.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit5/bonus.mdx",
"repo_id": "deep-rl-class",
"token_count": 360
} | 95 |
# Additional Readings [[additional-readings]]
## An introduction to multi-agents
- [Multi-agent reinforcement learning: An overview](https://www.dcsc.tudelft.nl/~bdeschutter/pub/rep/10_003.pdf)
- [Multiagent Reinforcement Learning, Marc Lanctot](https://rlss.inria.fr/files/2019/07/RLSS_Multiagent.pdf)
- [Example of ... | deep-rl-class/units/en/unit7/additional-readings.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit7/additional-readings.mdx",
"repo_id": "deep-rl-class",
"token_count": 432
} | 96 |
# The intuition behind PPO [[the-intuition-behind-ppo]]
The idea with Proximal Policy Optimization (PPO) is that we want to improve the training stability of the policy by limiting the change you make to the policy at each training epoch: **we want to avoid having too large of a policy update.**
For two reasons:
- W... | deep-rl-class/units/en/unit8/intuition-behind-ppo.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit8/intuition-behind-ppo.mdx",
"repo_id": "deep-rl-class",
"token_count": 426
} | 97 |
# Language models in RL
## LMs encode useful knowledge for agents
**Language models** (LMs) can exhibit impressive abilities when manipulating text such as question-answering or even step-by-step reasoning. Additionally, their training on massive text corpora allowed them to **encode various types of knowledge includi... | deep-rl-class/units/en/unitbonus3/language-models.mdx/0 | {
"file_path": "deep-rl-class/units/en/unitbonus3/language-models.mdx",
"repo_id": "deep-rl-class",
"token_count": 1011
} | 98 |
FROM ubuntu:20.04
LABEL maintainer="Hugging Face"
LABEL repository="diffusers"
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa
RUN apt install -y bash \
build-essential \
... | diffusers/docker/diffusers-flax-tpu/Dockerfile/0 | {
"file_path": "diffusers/docker/diffusers-flax-tpu/Dockerfile",
"repo_id": "diffusers",
"token_count": 803
} | 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/internal_classes_overview.md/0 | {
"file_path": "diffusers/docs/source/en/api/internal_classes_overview.md",
"repo_id": "diffusers",
"token_count": 211
} | 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/models/controlnet.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/controlnet.md",
"repo_id": "diffusers",
"token_count": 770
} | 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/api/models/transformer2d.md/0 | {
"file_path": "diffusers/docs/source/en/api/models/transformer2d.md",
"repo_id": "diffusers",
"token_count": 465
} | 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/api/pipelines/aura_flow.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/aura_flow.md",
"repo_id": "diffusers",
"token_count": 385
} | 103 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/pipelines/overview.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/overview.md",
"repo_id": "diffusers",
"token_count": 1935
} | 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/pipelines/text_to_video.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/text_to_video.md",
"repo_id": "diffusers",
"token_count": 2638
} | 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/schedulers/edm_euler.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/edm_euler.md",
"repo_id": "diffusers",
"token_count": 375
} | 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/installation.md/0 | {
"file_path": "diffusers/docs/source/en/installation.md",
"repo_id": "diffusers",
"token_count": 1585
} | 107 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/training/controlnet.md/0 | {
"file_path": "diffusers/docs/source/en/training/controlnet.md",
"repo_id": "diffusers",
"token_count": 4989
} | 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/training/wuerstchen.md/0 | {
"file_path": "diffusers/docs/source/en/training/wuerstchen.md",
"repo_id": "diffusers",
"token_count": 2906
} | 109 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/using-diffusers/inference_with_lcm.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/inference_with_lcm.md",
"repo_id": "diffusers",
"token_count": 9010
} | 110 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/using-diffusers/sdxl.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/sdxl.md",
"repo_id": "diffusers",
"token_count": 7092
} | 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/ja/tutorials/autopipeline.md/0 | {
"file_path": "diffusers/docs/source/ja/tutorials/autopipeline.md",
"repo_id": "diffusers",
"token_count": 4100
} | 112 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ko/optimization/open_vino.md/0 | {
"file_path": "diffusers/docs/source/ko/optimization/open_vino.md",
"repo_id": "diffusers",
"token_count": 921
} | 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 agree... | diffusers/docs/source/ko/training/text_inversion.md/0 | {
"file_path": "diffusers/docs/source/ko/training/text_inversion.md",
"repo_id": "diffusers",
"token_count": 9074
} | 114 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/ko/using-diffusers/schedulers.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/schedulers.md",
"repo_id": "diffusers",
"token_count": 6905
} | 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/zh/quicktour.md/0 | {
"file_path": "diffusers/docs/source/zh/quicktour.md",
"repo_id": "diffusers",
"token_count": 8423
} | 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 applicabl... | diffusers/examples/community/composable_stable_diffusion.py/0 | {
"file_path": "diffusers/examples/community/composable_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 11889
} | 117 |
# Copyright 2024 FABRIC authors and the HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | diffusers/examples/community/pipeline_fabric.py/0 | {
"file_path": "diffusers/examples/community/pipeline_fabric.py",
"repo_id": "diffusers",
"token_count": 16486
} | 118 |
import math
from typing import Dict, Optional
import torch
import torchvision.transforms.functional as FF
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers import StableDiffusionPipeline
from diffusers.models import AutoencoderKL, UNet2DConditionModel
from diffusers.pipelines.st... | diffusers/examples/community/regional_prompting_stable_diffusion.py/0 | {
"file_path": "diffusers/examples/community/regional_prompting_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 13626
} | 119 |
# Inspired by: https://github.com/Mikubill/sd-webui-controlnet/discussions/1236 and https://github.com/Mikubill/sd-webui-controlnet/discussions/1280
import inspect
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import PIL.Image
import torch
from packaging import version
from tr... | diffusers/examples/community/stable_diffusion_reference.py/0 | {
"file_path": "diffusers/examples/community/stable_diffusion_reference.py",
"repo_id": "diffusers",
"token_count": 34434
} | 120 |
# 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/consistency_distillation/test_lcm_lora.py/0 | {
"file_path": "diffusers/examples/consistency_distillation/test_lcm_lora.py",
"repo_id": "diffusers",
"token_count": 2105
} | 121 |
# 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/dreambooth/test_dreambooth_lora_edm.py/0 | {
"file_path": "diffusers/examples/dreambooth/test_dreambooth_lora_edm.py",
"repo_id": "diffusers",
"token_count": 1864
} | 122 |
# InstructPix2Pix SDXL training example
***This is based on the original InstructPix2Pix training example.***
[Stable Diffusion XL](https://huggingface.co/papers/2307.01952) (or SDXL) is the latest image generation model that is tailored towards more photorealistic outputs with more detailed imagery and composition c... | diffusers/examples/instruct_pix2pix/README_sdxl.md/0 | {
"file_path": "diffusers/examples/instruct_pix2pix/README_sdxl.md",
"repo_id": "diffusers",
"token_count": 3478
} | 123 |
import argparse
import itertools
import math
import os
import random
from pathlib import Path
import numpy as np
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from accelerate import Accelerator
from accelerate.logging import get_logger
from accelerate.utils import ProjectConfiguration, set... | diffusers/examples/research_projects/dreambooth_inpaint/train_dreambooth_inpaint.py/0 | {
"file_path": "diffusers/examples/research_projects/dreambooth_inpaint/train_dreambooth_inpaint.py",
"repo_id": "diffusers",
"token_count": 14371
} | 124 |
"""
The main idea for this code is to provide a way for users to not need to bother with the hassle of multiple tokens for a concept by typing
a photo of <concept>_0 <concept>_1 ... and so on
and instead just do
a photo of <concept>
which gets translated to the above. This needs to work for both inference and training.... | diffusers/examples/research_projects/multi_token_textual_inversion/multi_token_clip.py/0 | {
"file_path": "diffusers/examples/research_projects/multi_token_textual_inversion/multi_token_clip.py",
"repo_id": "diffusers",
"token_count": 1828
} | 125 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | diffusers/examples/research_projects/promptdiffusion/convert_original_promptdiffusion_to_diffusers.py/0 | {
"file_path": "diffusers/examples/research_projects/promptdiffusion/convert_original_promptdiffusion_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 40258
} | 126 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | diffusers/examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image_lora_sdxl.py/0 | {
"file_path": "diffusers/examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image_lora_sdxl.py",
"repo_id": "diffusers",
"token_count": 26445
} | 127 |
# 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/test_examples_utils.py/0 | {
"file_path": "diffusers/examples/test_examples_utils.py",
"repo_id": "diffusers",
"token_count": 714
} | 128 |
import argparse
from typing import Any, Dict
import torch
from transformers import T5EncoderModel, T5Tokenizer
from diffusers import AutoencoderKLCogVideoX, CogVideoXDDIMScheduler, CogVideoXPipeline, CogVideoXTransformer3DModel
def reassign_query_key_value_inplace(key: str, state_dict: Dict[str, Any]):
to_q_key... | diffusers/scripts/convert_cogvideox_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_cogvideox_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 4474
} | 129 |
import argparse
import tempfile
import torch
from accelerate import load_checkpoint_and_dispatch
from transformers import CLIPTextModelWithProjection, CLIPTokenizer
from diffusers import UnCLIPPipeline, UNet2DConditionModel, UNet2DModel
from diffusers.models.transformers.prior_transformer import PriorTransformer
from... | diffusers/scripts/convert_kakao_brain_unclip_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_kakao_brain_unclip_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 18242
} | 130 |
import argparse
import os
import torch
from transformers import T5EncoderModel, T5Tokenizer
from diffusers import AutoencoderKL, DPMSolverMultistepScheduler, PixArtAlphaPipeline, Transformer2DModel
ckpt_id = "PixArt-alpha/PixArt-alpha"
# https://github.com/PixArt-alpha/PixArt-alpha/blob/0f55e922376d8b797edd44d25d0e... | diffusers/scripts/convert_pixart_alpha_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_pixart_alpha_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 4082
} | 131 |
# 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/scripts/convert_versatile_diffusion_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_versatile_diffusion_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 14926
} | 132 |
from .rl import ValueGuidedRLPipeline
| diffusers/src/diffusers/experimental/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/experimental/__init__.py",
"repo_id": "diffusers",
"token_count": 12
} | 133 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/loaders/utils.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/utils.py",
"repo_id": "diffusers",
"token_count": 1031
} | 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/autoencoders/vae.py/0 | {
"file_path": "diffusers/src/diffusers/models/autoencoders/vae.py",
"repo_id": "diffusers",
"token_count": 18183
} | 135 |
from dataclasses import dataclass
from ..utils import BaseOutput
@dataclass
class AutoencoderKLOutput(BaseOutput):
"""
Output of AutoencoderKL encoding method.
Args:
latent_dist (`DiagonalGaussianDistribution`):
Encoded outputs of `Encoder` represented as the mean and logvar of `Diag... | diffusers/src/diffusers/models/modeling_outputs.py/0 | {
"file_path": "diffusers/src/diffusers/models/modeling_outputs.py",
"repo_id": "diffusers",
"token_count": 377
} | 136 |
# Copyright 2024 Stability AI and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | diffusers/src/diffusers/models/transformers/stable_audio_transformer.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/stable_audio_transformer.py",
"repo_id": "diffusers",
"token_count": 8398
} | 137 |
# Copyright 2024 Alibaba DAMO-VILAB 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
#
# Unles... | diffusers/src/diffusers/models/unets/unet_i2vgen_xl.py/0 | {
"file_path": "diffusers/src/diffusers/models/unets/unet_i2vgen_xl.py",
"repo_id": "diffusers",
"token_count": 14677
} | 138 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure = {"pipeline_output": ["AnimateDiffPipelineOutput"]}
try... | diffusers/src/diffusers/pipelines/animatediff/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/animatediff/__init__.py",
"repo_id": "diffusers",
"token_count": 805
} | 139 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.