text stringlengths 7 328k | id stringlengths 14 166 | metadata dict | __index_level_0__ int64 0 459 |
|---|---|---|---|
<script lang="ts">
import { createEventDispatcher } from "svelte";
import Modal from "$lib/components/Modal.svelte";
import CarbonClose from "~icons/carbon/close";
import CarbonTrashCan from "~icons/carbon/trash-can";
import CarbonArrowUpRight from "~icons/carbon/arrow-up-right";
import { enhance } from "$app/f... | chat-ui/src/routes/settings/(nav)/+page.svelte/0 | {
"file_path": "chat-ui/src/routes/settings/(nav)/+page.svelte",
"repo_id": "chat-ui",
"token_count": 1373
} | 58 |
@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
} | 59 |
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "ES2018"
}
// Path aliases are handled... | chat-ui/tsconfig.json/0 | {
"file_path": "chat-ui/tsconfig.json",
"repo_id": "chat-ui",
"token_count": 197
} | 60 |
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit # https://github.com/charliermarsh/ruff#usage
rev: 'v0.3.0'
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
| datasets/.pre-commit-config.yaml/0 | {
"file_path": "datasets/.pre-commit-config.yaml",
"repo_id": "datasets",
"token_count": 122
} | 61 |
import json
import os
import tempfile
import transformers
import datasets
from utils import generate_example_dataset, get_duration
SPEED_TEST_N_EXAMPLES = 500_000
RESULTS_BASEPATH, RESULTS_FILENAME = os.path.split(__file__)
RESULTS_FILE_PATH = os.path.join(RESULTS_BASEPATH, "results", RESULTS_FILENAME.replace(".py... | datasets/benchmarks/benchmark_map_filter.py/0 | {
"file_path": "datasets/benchmarks/benchmark_map_filter.py",
"repo_id": "datasets",
"token_count": 996
} | 62 |
# Build and load
Nearly every deep learning workflow begins with loading a dataset, which makes it one of the most important steps. With 🤗 Datasets, there are more than 900 datasets available to help you get started with your NLP task. All you have to do is call: [`load_dataset`] to take your first step. This functio... | datasets/docs/source/about_dataset_load.mdx/0 | {
"file_path": "datasets/docs/source/about_dataset_load.mdx",
"repo_id": "datasets",
"token_count": 2537
} | 63 |
# Overview
The how-to guides offer a more comprehensive overview of all the tools 🤗 Datasets offers and how to use them. This will help you tackle messier real-world datasets where you may need to manipulate the dataset structure or content to get it ready for training.
The guides assume you are familiar and comfort... | datasets/docs/source/how_to.md/0 | {
"file_path": "datasets/docs/source/how_to.md",
"repo_id": "datasets",
"token_count": 469
} | 64 |
# Builder classes
## Builders
🤗 Datasets relies on two main classes during the dataset building process: [`DatasetBuilder`] and [`BuilderConfig`].
[[autodoc]] datasets.DatasetBuilder
[[autodoc]] datasets.GeneratorBasedBuilder
[[autodoc]] datasets.BeamBasedBuilder
[[autodoc]] datasets.ArrowBasedBuilder
[[autodoc... | datasets/docs/source/package_reference/builder_classes.mdx/0 | {
"file_path": "datasets/docs/source/package_reference/builder_classes.mdx",
"repo_id": "datasets",
"token_count": 253
} | 65 |
# Preprocess
In addition to loading datasets, 🤗 Datasets other main goal is to offer a diverse set of preprocessing functions to get a dataset into an appropriate format for training with your machine learning framework.
There are many possible ways to preprocess a dataset, and it all depends on your specific datas... | datasets/docs/source/use_dataset.mdx/0 | {
"file_path": "datasets/docs/source/use_dataset.mdx",
"repo_id": "datasets",
"token_count": 3367
} | 66 |
# Metric Card for chrF(++)
## Metric Description
ChrF and ChrF++ are two MT evaluation metrics that use the F-score statistic for character n-gram matches. ChrF++ additionally includes word n-grams, which correlate more strongly with direct assessment. We use the implementation that is already present in sacrebleu.
... | datasets/metrics/chrf/README.md/0 | {
"file_path": "datasets/metrics/chrf/README.md",
"repo_id": "datasets",
"token_count": 2254
} | 67 |
# Metric Card for F1
## Metric Description
The F1 score is the harmonic mean of the precision and recall. It can be computed with the equation:
F1 = 2 * (precision * recall) / (precision + recall)
## How to Use
At minimum, this metric requires predictions and references as input
```python
>>> f1_metric = dataset... | datasets/metrics/f1/README.md/0 | {
"file_path": "datasets/metrics/f1/README.md",
"repo_id": "datasets",
"token_count": 1624
} | 68 |
# Metric Card for MAUVE
## Metric description
MAUVE is a library built on PyTorch and HuggingFace Transformers to measure the gap between neural text and human text with the eponymous MAUVE measure. It summarizes both Type I and Type II errors measured softly using [Kullback–Leibler (KL) divergences](https://en.wikip... | datasets/metrics/mauve/README.md/0 | {
"file_path": "datasets/metrics/mauve/README.md",
"repo_id": "datasets",
"token_count": 1650
} | 69 |
# Metric Card for ROC AUC
## Metric Description
This metric computes the area under the curve (AUC) for the Receiver Operating Characteristic Curve (ROC). The return values represent how well the model used is predicting the correct classes, based on the input data. A score of `0.5` means that the model is predicting... | datasets/metrics/roc_auc/README.md/0 | {
"file_path": "datasets/metrics/roc_auc/README.md",
"repo_id": "datasets",
"token_count": 3273
} | 70 |
"""Official evaluation script for SQuAD version 2.0.
In addition to basic functionality, we also compute additional statistics and
plot precision-recall curves if an additional na_prob.json file is provided.
This file is expected to map question ID's to the model's predicted probability
that a question is unanswerable... | datasets/metrics/squad_v2/evaluate.py/0 | {
"file_path": "datasets/metrics/squad_v2/evaluate.py",
"repo_id": "datasets",
"token_count": 5444
} | 71 |
<!---
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 ... | datasets/notebooks/README.md/0 | {
"file_path": "datasets/notebooks/README.md",
"repo_id": "datasets",
"token_count": 534
} | 72 |
import importlib
import importlib.metadata
import logging
import os
import platform
from pathlib import Path
from typing import Optional
from packaging import version
logger = logging.getLogger(__name__.split(".", 1)[0]) # to avoid circular import from .utils.logging
# Datasets
S3_DATASETS_BUCKET_PREFIX = "https:/... | datasets/src/datasets/config.py/0 | {
"file_path": "datasets/src/datasets/config.py",
"repo_id": "datasets",
"token_count": 4439
} | 73 |
import os
from typing import Optional
import fsspec
from fsspec.archive import AbstractArchiveFileSystem
from fsspec.utils import DEFAULT_BLOCK_SIZE
class BaseCompressedFileFileSystem(AbstractArchiveFileSystem):
"""Read contents of compressed file as a filesystem with one file inside."""
root_marker = ""
... | datasets/src/datasets/filesystems/compression.py/0 | {
"file_path": "datasets/src/datasets/filesystems/compression.py",
"repo_id": "datasets",
"token_count": 2608
} | 74 |
import multiprocessing
import os
from typing import BinaryIO, Optional, Union
import fsspec
from .. import Dataset, Features, NamedSplit, config
from ..formatting import query_table
from ..packaged_modules.json.json import Json
from ..utils import tqdm as hf_tqdm
from ..utils.typing import NestedDataStructureLike, Pa... | datasets/src/datasets/io/json.py/0 | {
"file_path": "datasets/src/datasets/io/json.py",
"repo_id": "datasets",
"token_count": 3086
} | 75 |
import glob
import os
import shutil
import time
import warnings
from pathlib import Path
from typing import List, Optional, Tuple, Union
import pyarrow as pa
import datasets
import datasets.config
import datasets.data_files
from datasets.naming import filenames_for_dataset_split
logger = datasets.utils.logging.get_... | datasets/src/datasets/packaged_modules/cache/cache.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/cache/cache.py",
"repo_id": "datasets",
"token_count": 3777
} | 76 |
import os
import posixpath
import uuid
from dataclasses import dataclass
from typing import TYPE_CHECKING, Iterable, List, Optional, Tuple, Union
import numpy as np
import pyarrow as pa
import datasets
from datasets.arrow_writer import ArrowWriter, ParquetWriter
from datasets.config import MAX_SHARD_SIZE
from dataset... | datasets/src/datasets/packaged_modules/spark/spark.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/spark/spark.py",
"repo_id": "datasets",
"token_count": 6664
} | 77 |
import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict
from ..features import Audio, Features, Value
from .base import TaskTemplate
@dataclass(frozen=True)
class AutomaticSpeechRecognition(TaskTemplate):
task: str = field(default="automatic-speech-recognition", metadata={"include_... | datasets/src/datasets/tasks/automatic_speech_recognition.py/0 | {
"file_path": "datasets/src/datasets/tasks/automatic_speech_recognition.py",
"repo_id": "datasets",
"token_count": 459
} | 78 |
import bz2
import gzip
import lzma
import os
import shutil
import struct
import tarfile
import warnings
import zipfile
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Dict, List, Optional, Type, Union
from .. import config
from ._filelock import FileLock
from .logging import get_logger
... | datasets/src/datasets/utils/extract.py/0 | {
"file_path": "datasets/src/datasets/utils/extract.py",
"repo_id": "datasets",
"token_count": 6394
} | 79 |
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
} | 80 |
import os
from collections import namedtuple
import pytest
from datasets import ClassLabel, Features, Sequence, Value
from datasets.commands.test import TestCommand
from datasets.info import DatasetInfo, DatasetInfosDict
_TestCommandArgs = namedtuple(
"_TestCommandArgs",
[
"dataset",
"name",... | datasets/tests/commands/test_test.py/0 | {
"file_path": "datasets/tests/commands/test_test.py",
"repo_id": "datasets",
"token_count": 1511
} | 81 |
import contextlib
import csv
import json
import os
import sqlite3
import tarfile
import textwrap
import zipfile
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
import pytest
import datasets
import datasets.config
# dataset + arrow_file
@pytest.fixture(scope="session")
def dataset():
n = ... | datasets/tests/fixtures/files.py/0 | {
"file_path": "datasets/tests/fixtures/files.py",
"repo_id": "datasets",
"token_count": 8208
} | 82 |
import importlib
import shutil
import textwrap
import pytest
from datasets import ClassLabel, DownloadManager, Features, Value
from datasets.data_files import DataFilesDict, get_data_patterns
from datasets.download.streaming_download_manager import StreamingDownloadManager
from datasets.packaged_modules.folder_based_... | 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": 8915
} | 83 |
import unittest
import warnings
from datasets.utils import experimental
@experimental
def dummy_function():
return "success"
class TestExperimentalFlag(unittest.TestCase):
def test_experimental_warning(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always"... | datasets/tests/test_experimental.py/0 | {
"file_path": "datasets/tests/test_experimental.py",
"repo_id": "datasets",
"token_count": 152
} | 84 |
# Copyright 2020 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 agreed to in writ... | datasets/tests/test_metric_common.py/0 | {
"file_path": "datasets/tests/test_metric_common.py",
"repo_id": "datasets",
"token_count": 3144
} | 85 |
import asyncio
import importlib.metadata
import os
import re
import sys
import tempfile
import unittest
from contextlib import contextmanager
from copy import deepcopy
from distutils.util import strtobool
from enum import Enum
from importlib.util import find_spec
from pathlib import Path
from unittest.mock import patch... | datasets/tests/utils.py/0 | {
"file_path": "datasets/tests/utils.py",
"repo_id": "datasets",
"token_count": 6422
} | 86 |
<jupyter_start><jupyter_text>Unit 8: Proximal Policy Gradient (PPO) with PyTorch 🤖In this notebook, you'll learn to **code your PPO agent from scratch with PyTorch using CleanRL implementation as model**.To test its robustness, we're going to train it in:- [LunarLander-v2 🚀](https://www.gymlibrary.dev/environments/bo... | deep-rl-class/notebooks/unit8/unit8_part1.ipynb/0 | {
"file_path": "deep-rl-class/notebooks/unit8/unit8_part1.ipynb",
"repo_id": "deep-rl-class",
"token_count": 15492
} | 87 |
# Quiz [[quiz]]
The best way to learn and [to avoid the illusion of competence](https://www.coursera.org/lecture/learning-how-to-learn/illusions-of-competence-BuFzf) **is to test yourself.** This will help you to find **where you need to reinforce your knowledge**.
### Q1: What is Reinforcement Learning?
<details>
<... | deep-rl-class/units/en/unit1/quiz.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit1/quiz.mdx",
"repo_id": "deep-rl-class",
"token_count": 1866
} | 88 |
# Q-Learning Recap [[q-learning-recap]]
*Q-Learning* **is the RL algorithm that** :
- Trains a *Q-function*, an **action-value function** encoded, in internal memory, by a *Q-table* **containing all the state-action pair values.**
- Given a state and action, our Q-function **will search its Q-table for the correspo... | deep-rl-class/units/en/unit2/q-learning-recap.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit2/q-learning-recap.mdx",
"repo_id": "deep-rl-class",
"token_count": 505
} | 89 |
# Conclusion
**Congrats on finishing this unit**! There was a lot of information.
And congrats on finishing the tutorial. You've just coded your first Deep Reinforcement Learning agent from scratch using PyTorch and shared it on the Hub 🥳.
Don't hesitate to iterate on this unit **by improving the implementation for... | deep-rl-class/units/en/unit4/conclusion.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit4/conclusion.mdx",
"repo_id": "deep-rl-class",
"token_count": 250
} | 90 |
# The SnowballTarget Environment
<img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/snowballtarget.gif" alt="SnowballTarget"/>
SnowballTarget is an environment we created at Hugging Face using assets from [Kay Lousberg](https://kaylousberg.com/). We have an option... | deep-rl-class/units/en/unit5/snowball-target.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit5/snowball-target.mdx",
"repo_id": "deep-rl-class",
"token_count": 1019
} | 91 |
# Additional Readings [[additional-readings]]
These are **optional readings** if you want to go deeper.
## PPO Explained
- [Towards Delivering a Coherent Self-Contained Explanation of Proximal Policy Optimization by Daniel Bick](https://fse.studenttheses.ub.rug.nl/25709/1/mAI_2021_BickD.pdf)
- [What is the way to un... | deep-rl-class/units/en/unit8/additional-readings.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit8/additional-readings.mdx",
"repo_id": "deep-rl-class",
"token_count": 418
} | 92 |
# Introduction [[introduction]]
One of the most critical tasks in Deep Reinforcement Learning is to **find a good set of training hyperparameters**.
<img src="https://raw.githubusercontent.com/optuna/optuna/master/docs/image/optuna-logo.png" alt="Optuna Logo"/>
[Optuna](https://optuna.org/) is a library that helps y... | deep-rl-class/units/en/unitbonus2/introduction.mdx/0 | {
"file_path": "deep-rl-class/units/en/unitbonus2/introduction.mdx",
"repo_id": "deep-rl-class",
"token_count": 156
} | 93 |
import argparse
import sys
sys.path.append(".")
from base_classes import IPAdapterTextToImageBenchmark # noqa: E402
IP_ADAPTER_CKPTS = {
"runwayml/stable-diffusion-v1-5": ("h94/IP-Adapter", "ip-adapter_sd15.bin"),
"stabilityai/stable-diffusion-xl-base-1.0": ("h94/IP-Adapter", "ip-adapter_sdxl.bin"),
}
if... | diffusers/benchmarks/benchmark_ip_adapters.py/0 | {
"file_path": "diffusers/benchmarks/benchmark_ip_adapters.py",
"repo_id": "diffusers",
"token_count": 434
} | 94 |
<!--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/logging.md/0 | {
"file_path": "diffusers/docs/source/en/api/logging.md",
"repo_id": "diffusers",
"token_count": 1351
} | 95 |
<!--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/deepfloyd_if.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/deepfloyd_if.md",
"repo_id": "diffusers",
"token_count": 6743
} | 96 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/pipelines/stable_diffusion/stable_diffusion_2.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/stable_diffusion/stable_diffusion_2.md",
"repo_id": "diffusers",
"token_count": 2283
} | 97 |
<!--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/stable_diffusion.md/0 | {
"file_path": "diffusers/docs/source/en/stable_diffusion.md",
"repo_id": "diffusers",
"token_count": 3962
} | 98 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agree... | diffusers/docs/source/en/training/text_inversion.md/0 | {
"file_path": "diffusers/docs/source/en/training/text_inversion.md",
"repo_id": "diffusers",
"token_count": 4383
} | 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/using-diffusers/depth2img.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/depth2img.md",
"repo_id": "diffusers",
"token_count": 878
} | 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/using-diffusers/other-modalities.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/other-modalities.md",
"repo_id": "diffusers",
"token_count": 333
} | 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/using-diffusers/write_own_pipeline.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/write_own_pipeline.md",
"repo_id": "diffusers",
"token_count": 4145
} | 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/ko/optimization/mps.md/0 | {
"file_path": "diffusers/docs/source/ko/optimization/mps.md",
"repo_id": "diffusers",
"token_count": 2532
} | 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/ko/training/lora.md/0 | {
"file_path": "diffusers/docs/source/ko/training/lora.md",
"repo_id": "diffusers",
"token_count": 4733
} | 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/ko/using-diffusers/loading.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/loading.md",
"repo_id": "diffusers",
"token_count": 14650
} | 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/pt/quicktour.md/0 | {
"file_path": "diffusers/docs/source/pt/quicktour.md",
"repo_id": "diffusers",
"token_count": 6766
} | 106 |
# -*- coding: utf-8 -*-
import inspect
from typing import Optional, Union
import numpy as np
import PIL.Image
import torch
from torch.nn import functional as F
from torchvision import transforms
from transformers import CLIPFeatureExtractor, CLIPModel, CLIPTextModel, CLIPTokenizer
from diffusers import (
Autoenco... | diffusers/examples/community/clip_guided_images_mixing_stable_diffusion.py/0 | {
"file_path": "diffusers/examples/community/clip_guided_images_mixing_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 8767
} | 107 |
import inspect
import os
import numpy as np
import torch
import torch.nn.functional as nnf
from PIL import Image
from torch.optim.adam import Adam
from tqdm import tqdm
from diffusers import StableDiffusionPipeline
from diffusers.pipelines.stable_diffusion import StableDiffusionPipelineOutput
def retrieve_timesteps... | diffusers/examples/community/pipeline_null_text_inversion.py/0 | {
"file_path": "diffusers/examples/community/pipeline_null_text_inversion.py",
"repo_id": "diffusers",
"token_count": 5423
} | 108 |
from typing import Callable, List, Optional, Union
import PIL.Image
import torch
from transformers import (
CLIPImageProcessor,
CLIPSegForImageSegmentation,
CLIPSegProcessor,
CLIPTextModel,
CLIPTokenizer,
)
from diffusers import DiffusionPipeline
from diffusers.configuration_utils import FrozenDic... | diffusers/examples/community/text_inpainting.py/0 | {
"file_path": "diffusers/examples/community/text_inpainting.py",
"repo_id": "diffusers",
"token_count": 5469
} | 109 |
# ControlNet training example for Stable Diffusion XL (SDXL)
The `train_controlnet_sdxl.py` script shows how to implement the ControlNet training procedure and adapt it for [Stable Diffusion XL](https://huggingface.co/papers/2307.01952).
## Running locally with PyTorch
### Installing the dependencies
Before running... | diffusers/examples/controlnet/README_sdxl.md/0 | {
"file_path": "diffusers/examples/controlnet/README_sdxl.md",
"repo_id": "diffusers",
"token_count": 1700
} | 110 |
#!/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/instruct_pix2pix/train_instruct_pix2pix.py/0 | {
"file_path": "diffusers/examples/instruct_pix2pix/train_instruct_pix2pix.py",
"repo_id": "diffusers",
"token_count": 19582
} | 111 |
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": 14370
} | 112 |
# Multi Subject DreamBooth training
[DreamBooth](https://arxiv.org/abs/2208.12242) is a method to personalize text2image models like stable diffusion given just a few(3~5) images of a subject.
This `train_multi_subject_dreambooth.py` script shows how to implement the training procedure for one or more subjects and ada... | diffusers/examples/research_projects/multi_subject_dreambooth/README.md/0 | {
"file_path": "diffusers/examples/research_projects/multi_subject_dreambooth/README.md",
"repo_id": "diffusers",
"token_count": 4807
} | 113 |
## Textual Inversion fine-tuning example
[Textual inversion](https://arxiv.org/abs/2208.01618) is a method to personalize text2image models like stable diffusion on your own images using just 3-5 examples.
The `textual_inversion.py` script shows how to implement the training procedure and adapt it for stable diffusion... | diffusers/examples/research_projects/onnxruntime/textual_inversion/README.md/0 | {
"file_path": "diffusers/examples/research_projects/onnxruntime/textual_inversion/README.md",
"repo_id": "diffusers",
"token_count": 1117
} | 114 |
import argparse
import copy
import itertools
import logging
import math
import os
import random
import shutil
from pathlib import Path
import numpy as np
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
import torchvision.transforms.v2 as transforms_v2
import transformers
from accelerate impo... | diffusers/examples/research_projects/realfill/train_realfill.py/0 | {
"file_path": "diffusers/examples/research_projects/realfill/train_realfill.py",
"repo_id": "diffusers",
"token_count": 16396
} | 115 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | diffusers/examples/text_to_image/test_text_to_image_lora.py/0 | {
"file_path": "diffusers/examples/text_to_image/test_text_to_image_lora.py",
"repo_id": "diffusers",
"token_count": 6179
} | 116 |
import argparse
import time
from pathlib import Path
from typing import Any, Dict, Literal
import torch
from diffusers import AsymmetricAutoencoderKL
ASYMMETRIC_AUTOENCODER_KL_x_1_5_CONFIG = {
"in_channels": 3,
"out_channels": 3,
"down_block_types": [
"DownEncoderBlock2D",
"DownEncoderBl... | diffusers/scripts/convert_asymmetric_vqgan_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_asymmetric_vqgan_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 3351
} | 117 |
import argparse
import os
import tempfile
import torch
from accelerate import load_checkpoint_and_dispatch
from diffusers import UNet2DConditionModel
from diffusers.models.transformers.prior_transformer import PriorTransformer
from diffusers.models.vq_model import VQModel
"""
Example - From the diffusers root direc... | diffusers/scripts/convert_kandinsky_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_kandinsky_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 23602
} | 118 |
# Run this script to convert the Stable Cascade model weights to a diffusers pipeline.
import argparse
from contextlib import nullcontext
import torch
from safetensors.torch import load_file
from transformers import (
AutoTokenizer,
CLIPConfig,
CLIPImageProcessor,
CLIPTextModelWithProjection,
CLIPV... | diffusers/scripts/convert_stable_cascade_lite.py/0 | {
"file_path": "diffusers/scripts/convert_stable_cascade_lite.py",
"repo_id": "diffusers",
"token_count": 3645
} | 119 |
# 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/setup.py/0 | {
"file_path": "diffusers/setup.py",
"repo_id": "diffusers",
"token_count": 3764
} | 120 |
# 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/controlnet.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/controlnet.py",
"repo_id": "diffusers",
"token_count": 2891
} | 121 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/models/attention_processor.py/0 | {
"file_path": "diffusers/src/diffusers/models/attention_processor.py",
"repo_id": "diffusers",
"token_count": 48583
} | 122 |
# 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/src/diffusers/models/modeling_flax_utils.py/0 | {
"file_path": "diffusers/src/diffusers/models/modeling_flax_utils.py",
"repo_id": "diffusers",
"token_count": 11975
} | 123 |
# 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/transformers/transformer_temporal.py/0 | {
"file_path": "diffusers/src/diffusers/models/transformers/transformer_temporal.py",
"repo_id": "diffusers",
"token_count": 7286
} | 124 |
# 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": 14630
} | 125 |
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": 612
} | 126 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/pipelines/consistency_models/pipeline_consistency_models.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/consistency_models/pipeline_consistency_models.py",
"repo_id": "diffusers",
"token_count": 5192
} | 127 |
# Copyright 2022 The Music Spectrogram Diffusion Authors.
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | diffusers/src/diffusers/pipelines/deprecated/spectrogram_diffusion/midi_utils.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/spectrogram_diffusion/midi_utils.py",
"repo_id": "diffusers",
"token_count": 10185
} | 128 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_available() and is... | diffusers/src/diffusers/pipelines/kandinsky2_2/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/kandinsky2_2/__init__.py",
"repo_id": "diffusers",
"token_count": 1190
} | 129 |
# 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/src/diffusers/pipelines/pipeline_loading_utils.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/pipeline_loading_utils.py",
"repo_id": "diffusers",
"token_count": 8199
} | 130 |
# Stable Diffusion
## Overview
Stable Diffusion was proposed in [Stable Diffusion Announcement](https://stability.ai/blog/stable-diffusion-announcement) by Patrick Esser and Robin Rombach and the Stability AI team.
The summary of the model is the following:
*Stable Diffusion is a text-to-image model that will empow... | diffusers/src/diffusers/pipelines/stable_diffusion/README.md/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/README.md",
"repo_id": "diffusers",
"token_count": 2465
} | 131 |
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
} | 132 |
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
} | 133 |
# Copyright (c) 2022 Pablo Pernías MIT License
# 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://... | diffusers/src/diffusers/schedulers/scheduling_ddpm_wuerstchen.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_ddpm_wuerstchen.py",
"repo_id": "diffusers",
"token_count": 3659
} | 134 |
# Copyright 2024 NVIDIA 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 b... | diffusers/src/diffusers/schedulers/scheduling_karras_ve_flax.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_karras_ve_flax.py",
"repo_id": "diffusers",
"token_count": 3954
} | 135 |
import contextlib
import copy
import random
from typing import Any, Dict, Iterable, List, Optional, Union
import numpy as np
import torch
from .models import UNet2DConditionModel
from .utils import (
convert_state_dict_to_diffusers,
convert_state_dict_to_peft,
deprecate,
is_peft_available,
is_torc... | diffusers/src/diffusers/training_utils.py/0 | {
"file_path": "diffusers/src/diffusers/training_utils.py",
"repo_id": "diffusers",
"token_count": 8024
} | 136 |
# This file is autogenerated by the command `make fix-copies`, do not edit.
from ..utils import DummyObject, requires_backends
class AltDiffusionImg2ImgPipeline(metaclass=DummyObject):
_backends = ["torch", "transformers"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch", "transf... | diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py/0 | {
"file_path": "diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py",
"repo_id": "diffusers",
"token_count": 19514
} | 137 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/models/test_modeling_common.py/0 | {
"file_path": "diffusers/tests/models/test_modeling_common.py",
"repo_id": "diffusers",
"token_count": 13953
} | 138 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/tests/others/test_check_dummies.py/0 | {
"file_path": "diffusers/tests/others/test_check_dummies.py",
"repo_id": "diffusers",
"token_count": 1872
} | 139 |
import unittest
import numpy as np
import torch
from PIL import Image
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer
import diffusers
from diffusers import (
AnimateDiffVideoToVideoPipeline,
AutoencoderKL,
DDIMScheduler,
MotionAdapter,
UNet2DConditionModel,
UNetMotionMod... | diffusers/tests/pipelines/animatediff/test_animatediff_video2video.py/0 | {
"file_path": "diffusers/tests/pipelines/animatediff/test_animatediff_video2video.py",
"repo_id": "diffusers",
"token_count": 5211
} | 140 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/controlnet/test_controlnet_sdxl_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/controlnet/test_controlnet_sdxl_img2img.py",
"repo_id": "diffusers",
"token_count": 6012
} | 141 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/dit/test_dit.py/0 | {
"file_path": "diffusers/tests/pipelines/dit/test_dit.py",
"repo_id": "diffusers",
"token_count": 2337
} | 142 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/musicldm/test_musicldm.py/0 | {
"file_path": "diffusers/tests/pipelines/musicldm/test_musicldm.py",
"repo_id": "diffusers",
"token_count": 7995
} | 143 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/stable_cascade/test_stable_cascade_combined.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_cascade/test_stable_cascade_combined.py",
"repo_id": "diffusers",
"token_count": 4525
} | 144 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_diffedit.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_diffedit.py",
"repo_id": "diffusers",
"token_count": 7240
} | 145 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/stable_diffusion_k_diffusion/test_stable_diffusion_k_diffusion.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_k_diffusion/test_stable_diffusion_k_diffusion.py",
"repo_id": "diffusers",
"token_count": 2113
} | 146 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/text_to_video_synthesis/test_video_to_video.py/0 | {
"file_path": "diffusers/tests/pipelines/text_to_video_synthesis/test_video_to_video.py",
"repo_id": "diffusers",
"token_count": 3465
} | 147 |
# Copyright 2024 ParaDiGMS authors and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | diffusers/tests/schedulers/test_scheduler_ddpm_parallel.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_ddpm_parallel.py",
"repo_id": "diffusers",
"token_count": 4271
} | 148 |
import torch
from diffusers import LMSDiscreteScheduler
from diffusers.utils.testing_utils import torch_device
from .test_schedulers import SchedulerCommonTest
class LMSDiscreteSchedulerTest(SchedulerCommonTest):
scheduler_classes = (LMSDiscreteScheduler,)
num_inference_steps = 10
def get_scheduler_con... | diffusers/tests/schedulers/test_scheduler_lms.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_lms.py",
"repo_id": "diffusers",
"token_count": 2696
} | 149 |
# JAX/Diffusers community sprint
Welcome to the JAX/Diffusers community sprint! The goal of this sprint is to work on fun and creative diffusion models using JAX and Diffusers.
In this event, we will create various applications with diffusion models in JAX/Flax and Diffusers using free TPU hours generously provided b... | diffusion-models-class/units/en/events/4.mdx/0 | {
"file_path": "diffusion-models-class/units/en/events/4.mdx",
"repo_id": "diffusion-models-class",
"token_count": 11592
} | 150 |
import wandb
import numpy as np
import torch, torchvision
import torch.nn.functional as F
from PIL import Image
from tqdm.auto import tqdm
from fastcore.script import call_parse
from torchvision import transforms
from diffusers import DDPMPipeline
from diffusers import DDIMScheduler
from datasets import load_dataset
fr... | diffusion-models-class/units/fr/unit2/finetune_model.py/0 | {
"file_path": "diffusion-models-class/units/fr/unit2/finetune_model.py",
"repo_id": "diffusion-models-class",
"token_count": 2153
} | 151 |
<jupyter_start><jupyter_text>Diffusion pour l'audio Dans ce *notebook*, nous allons jeter un bref coup d'œil à la génération d'audio avec des modèles de diffusion.Ce que vous allez apprendre :- Comment l'audio est représenté dans un ordinateur- Les méthodes de conversion entre les données audio brutes et les spectrogra... | diffusion-models-class/units/fr/unit4/diffusion_for_audio.ipynb/0 | {
"file_path": "diffusion-models-class/units/fr/unit4/diffusion_for_audio.ipynb",
"repo_id": "diffusion-models-class",
"token_count": 5905
} | 152 |
<jupyter_start><jupyter_text>Manipulation de plusieurs séquences (TensorFlow) Installez la bibliothèque 🤗 *Transformers* pour exécuter ce *notebook*.<jupyter_code>!pip install transformers[sentencepiece]
import tensorflow as tf
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
checkpoint = ... | notebooks/course/fr/chapter2/section5_tf.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter2/section5_tf.ipynb",
"repo_id": "notebooks",
"token_count": 810
} | 153 |
<jupyter_start><jupyter_text>Données massives ? 🤗 Datasets à la rescousse ! Installez les bibliothèques 🤗 Transformers et 🤗 Datasets pour exécuter ce *notebook*.<jupyter_code>!pip install datasets evaluate transformers[sentencepiece]
!pip install zstandard
from datasets import load_dataset
# Cela prend quelques min... | notebooks/course/fr/chapter5/section4.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter5/section4.ipynb",
"repo_id": "notebooks",
"token_count": 1168
} | 154 |
<jupyter_start><jupyter_text>Classification de token (TensorFlow) Installez les bibliothèques 🤗 *Datasets*, 🤗 *Transformers* et 🤗 *Accelerate* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece]
!apt install git-lfs<jupyter_output><empty_output><jupyter_text>Vous aurez besoin... | notebooks/course/fr/chapter7/section2_tf.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter7/section2_tf.ipynb",
"repo_id": "notebooks",
"token_count": 2616
} | 155 |
<jupyter_start><jupyter_text>You will need an authentication token with your Hugging Face credentials to use the `push_to_hub` method. Execute `huggingface-cli login` in your terminal or by uncommenting the following cell:<jupyter_code># !huggingface-cli login
import numpy as np
from datasets import load_dataset, load... | notebooks/course/videos/push_to_hub_new.ipynb/0 | {
"file_path": "notebooks/course/videos/push_to_hub_new.ipynb",
"repo_id": "notebooks",
"token_count": 1284
} | 156 |
<jupyter_start><jupyter_text>Image2Image Pipeline for Stable Diffusion using 🧨 Diffusers This notebook shows how to create a custom `diffusers` pipeline for text-guided image-to-image generation with Stable Diffusion model using 🤗 Hugging Face [🧨 Diffusers library](https://github.com/huggingface/diffusers). For a ... | notebooks/diffusers/image_2_image_using_diffusers.ipynb/0 | {
"file_path": "notebooks/diffusers/image_2_image_using_diffusers.ipynb",
"repo_id": "notebooks",
"token_count": 1520
} | 157 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.