text stringlengths 7 1.24M | id stringlengths 14 166 | metadata dict | __index_level_0__ int64 0 519 |
|---|---|---|---|
- title: Unit 0. Welcome to the RLHF Handbook!
sections:
- local: chapter0/introduction
title: What is this about? | alignment-handbook/chapters/en/_toctree.yml/0 | {
"file_path": "alignment-handbook/chapters/en/_toctree.yml",
"repo_id": "alignment-handbook",
"token_count": 38
} | 13 |
# Model arguments
model_name_or_path: teknium/OpenHermes-2.5-Mistral-7B
torch_dtype: null
# Data training arguments
dataset_mixer:
HuggingFaceH4/orca_dpo_pairs: 1.0
dataset_splits:
- train_prefs
- test_prefs
preprocessing_num_workers: 12
# Training arguments with sensible defaults
bf16: true
beta: 0.01
loss_type: s... | alignment-handbook/recipes/pref_align_scan/dpo/config_openhermes.yaml/0 | {
"file_path": "alignment-handbook/recipes/pref_align_scan/dpo/config_openhermes.yaml",
"repo_id": "alignment-handbook",
"token_count": 376
} | 14 |
# Model arguments
model_name_or_path: HuggingFaceH4/zephyr-7b-gemma-sft-v0.1
torch_dtype: bfloat16
# Data training arguments
# For definitions, see: src/h4/training/config.py
dataset_mixer:
argilla/dpo-mix-7k: 1.0
dataset_splits:
- train
- test
preprocessing_num_workers: 12
# DPOTrainer arguments
bf16: true
beta: 0... | alignment-handbook/recipes/zephyr-7b-gemma/dpo/config_full.yaml/0 | {
"file_path": "alignment-handbook/recipes/zephyr-7b-gemma/dpo/config_full.yaml",
"repo_id": "alignment-handbook",
"token_count": 365
} | 15 |
# Model arguments
model_name_or_path: alignment-handbook/zephyr-7b-sft-full
# Data training arguments
# For definitions, see: src/h4/training/config.py
dataset_mixer:
HuggingFaceH4/ultrafeedback_binarized: 1.0
dataset_splits:
- train_prefs
- test_prefs
preprocessing_num_workers: 12
# DPOTrainer arguments
bf16: true... | alignment-handbook/tests/fixtures/config_dpo_full.yaml/0 | {
"file_path": "alignment-handbook/tests/fixtures/config_dpo_full.yaml",
"repo_id": "alignment-handbook",
"token_count": 328
} | 16 |
# Writing a custom kernel
| candle/candle-book/src/cuda/writing.md/0 | {
"file_path": "candle/candle-book/src/cuda/writing.md",
"repo_id": "candle",
"token_count": 6
} | 17 |
# Training
Training starts with data. We're going to use the huggingface hub and
start with the Hello world dataset of machine learning, MNIST.
Let's start with downloading `MNIST` from [huggingface](https://huggingface.co/datasets/mnist).
This requires [`hf-hub`](https://github.com/huggingface/hf-hub).
```bash
ca... | candle/candle-book/src/training/training.md/0 | {
"file_path": "candle/candle-book/src/training/training.md",
"repo_id": "candle",
"token_count": 361
} | 18 |
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
use anyhow::Result;
use candle_core::{Device, Tensor};
fn main() -> Result<()> {
// This requires the code to be run with MTL_CAPTURE_ENABLED=1
let device = Device::new_metal(0)?;
let metal_dev... | candle/candle-core/examples/metal_basics.rs/0 | {
"file_path": "candle/candle-core/examples/metal_basics.rs",
"repo_id": "candle",
"token_count": 347
} | 19 |
use crate::{DType, Layout};
/// cudarc related errors
#[derive(thiserror::Error, Debug)]
pub enum CudaError {
#[error(transparent)]
Cuda(#[from] cudarc::driver::DriverError),
#[error(transparent)]
Compiler(#[from] cudarc::nvrtc::CompileError),
#[error(transparent)]
Cublas(#[from] cudarc::cubl... | candle/candle-core/src/cuda_backend/error.rs/0 | {
"file_path": "candle/candle-core/src/cuda_backend/error.rs",
"repo_id": "candle",
"token_count": 750
} | 20 |
//! Numpy support for tensors.
//!
//! The spec for the npy format can be found in
//! [npy-format](https://docs.scipy.org/doc/numpy-1.14.2/neps/npy-format.html).
//! The functions from this module can be used to read tensors from npy/npz files
//! or write tensors to these files. A npy file contains a single tensor (u... | candle/candle-core/src/npy.rs/0 | {
"file_path": "candle/candle-core/src/npy.rs",
"repo_id": "candle",
"token_count": 8727
} | 21 |
use crate::{Result, Tensor, WithDType};
pub enum TensorScalar {
Tensor(Tensor),
Scalar(Tensor),
}
pub trait TensorOrScalar {
fn to_tensor_scalar(self) -> Result<TensorScalar>;
}
impl TensorOrScalar for &Tensor {
fn to_tensor_scalar(self) -> Result<TensorScalar> {
Ok(TensorScalar::Tensor(self.... | candle/candle-core/src/scalar.rs/0 | {
"file_path": "candle/candle-core/src/scalar.rs",
"repo_id": "candle",
"token_count": 261
} | 22 |
use anyhow::Result;
use candle_core::{Device, IndexOp, Tensor};
#[test]
fn integer_index() -> Result<()> {
let dev = Device::Cpu;
let tensor = Tensor::arange(0u32, 2 * 3, &dev)?.reshape((2, 3))?;
let result = tensor.i(1)?;
assert_eq!(result.dims(), &[3]);
assert_eq!(result.to_vec1::<u32>()?, &[3, ... | candle/candle-core/tests/indexing_tests.rs/0 | {
"file_path": "candle/candle-core/tests/indexing_tests.rs",
"repo_id": "candle",
"token_count": 1994
} | 23 |
use candle::{Result, Tensor};
pub struct Batcher<I> {
inner: I,
batch_size: usize,
return_last_incomplete_batch: bool,
}
impl<I> Batcher<I> {
fn new(inner: I) -> Self {
Self {
inner,
batch_size: 16,
return_last_incomplete_batch: false,
}
}
p... | candle/candle-datasets/src/batcher.rs/0 | {
"file_path": "candle/candle-datasets/src/batcher.rs",
"repo_id": "candle",
"token_count": 2660
} | 24 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use candle_transformers::models::bert::{BertModel, Config, HiddenAct, DTYPE};
use anyhow::{Error as E, Result};
use candle::Tensor;
use candle_nn::VarBuilder;
use clap::Parser;
use hf_hub::{api::sync::Api, ... | candle/candle-examples/examples/bert/main.rs/0 | {
"file_path": "candle/candle-examples/examples/bert/main.rs",
"repo_id": "candle",
"token_count": 3718
} | 25 |
// This example illustrates how to implement custom operations. These operations can provide their
// own forward pass (CPU and GPU versions) as well as their backward pass.
//
// In this example we add the RMS normalization operation and implement it for f32.
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[rus... | candle/candle-examples/examples/custom-ops/main.rs/0 | {
"file_path": "candle/candle-examples/examples/custom-ops/main.rs",
"repo_id": "candle",
"token_count": 1475
} | 26 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use anyhow::Result;
use candle::{DType, IndexOp, Tensor};
use candle_nn::VarBuilder;
use candle_transformers::models::encodec::{Config, Model};
use clap::{Parser, ValueEnum};
use hf_hub::api::sync::Api;
mo... | candle/candle-examples/examples/encodec/main.rs/0 | {
"file_path": "candle/candle-examples/examples/encodec/main.rs",
"repo_id": "candle",
"token_count": 2395
} | 27 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use anyhow::{Error as E, Result};
use clap::Parser;
use candle_transformers::models::qwen2::{Config, Model};
use candle::{DType, Tensor};
use candle_nn::VarBuilder;
use hf_hub::{api::sync::Api, Repo, Repo... | candle/candle-examples/examples/gte-qwen/main.rs/0 | {
"file_path": "candle/candle-examples/examples/gte-qwen/main.rs",
"repo_id": "candle",
"token_count": 2613
} | 28 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use anyhow::{Error as E, Result};
use clap::{Parser, ValueEnum};
mod model;
use model::{Config, Model};
use candle::{DType, Device, Module, Tensor};
use candle_examples::token_output_stream::TokenOutputSt... | candle/candle-examples/examples/mamba-minimal/main.rs/0 | {
"file_path": "candle/candle-examples/examples/mamba-minimal/main.rs",
"repo_id": "candle",
"token_count": 4087
} | 29 |
# candle-mobilenetv4
[MobileNetV4 - Universal Models for the Mobile Ecosystem](https://arxiv.org/abs/2404.10518)
This candle implementation uses pre-trained MobileNetV4 models from timm for inference.
The classification head has been trained on the ImageNet dataset and returns the probabilities for the top-5 classes.
... | candle/candle-examples/examples/mobilenetv4/README.md/0 | {
"file_path": "candle/candle-examples/examples/mobilenetv4/README.md",
"repo_id": "candle",
"token_count": 248
} | 30 |
# candle-phi: 1.3b and 2.7b LLM with state of the art performance for <10b models.
[Phi-1.5](https://huggingface.co/microsoft/phi-1_5),
[Phi-2](https://huggingface.co/microsoft/phi-2), and
[Phi-3](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct) are language models using
only 1.3, 2.7, and 3.8 billion paramet... | candle/candle-examples/examples/phi/README.md/0 | {
"file_path": "candle/candle-examples/examples/phi/README.md",
"repo_id": "candle",
"token_count": 1048
} | 31 |
use std::collections::VecDeque;
use std::fmt::Display;
use candle::{DType, Device, Error, Module, Result, Tensor, Var};
use candle_nn::{
func, linear, sequential::seq, Activation, AdamW, Optimizer, ParamsAdamW, Sequential,
VarBuilder, VarMap,
};
use rand::{distributions::Uniform, thread_rng, Rng};
use super::... | candle/candle-examples/examples/reinforcement-learning/ddpg.rs/0 | {
"file_path": "candle/candle-examples/examples/reinforcement-learning/ddpg.rs",
"repo_id": "candle",
"token_count": 8524
} | 32 |
[
{
"index": 1,
"color": "#787878",
"label": "wall"
},
{
"index": 2,
"color": "#B47878",
"label": "building;edifice"
},
{
"index": 3,
"color": "#06E6E6",
"label": "sky"
},
{
"index": 4,
"color": "#503232",
"label": "floor;flooring"
},
{
"index": 5,
... | candle/candle-examples/examples/segformer/assets/labels.json/0 | {
"file_path": "candle/candle-examples/examples/segformer/assets/labels.json",
"repo_id": "candle",
"token_count": 6397
} | 33 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use std::io::Write;
use std::path::PathBuf;
use candle_transformers::models::t5;
use anyhow::{Error as E, Result};
use candle::{DType, Device, Tensor};
use candle_nn::VarBuilder;
use candle_transformers::g... | candle/candle-examples/examples/t5/main.rs/0 | {
"file_path": "candle/candle-examples/examples/t5/main.rs",
"repo_id": "candle",
"token_count": 6911
} | 34 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
mod model;
use model::{Multiples, YoloV8, YoloV8Pose};
use candle::{DType, Device, IndexOp, Result, Tensor};
use candle_nn::{Module, VarBuilder};
use candle_transformers::object_detection::{non_maximum_sup... | candle/candle-examples/examples/yolo-v8/main.rs/0 | {
"file_path": "candle/candle-examples/examples/yolo-v8/main.rs",
"repo_id": "candle",
"token_count": 7410
} | 35 |
#pragma once
#define C10_CUDA_CHECK(EXPR) \
do { \
const cudaError_t __err = EXPR; \
} while (0)
#define C10_CUDA_KERNEL_LAUNCH_CHECK() C10_CUDA_CHECK(cudaGetLastError())
| candle/candle-flash-attn/kernels/error.h/0 | {
"file_path": "candle/candle-flash-attn/kernels/error.h",
"repo_id": "candle",
"token_count": 216
} | 36 |
mod ffi;
use candle::backend::BackendStorage;
use candle::cuda_backend::cudarc::driver::DevicePtr;
use candle::cuda_backend::WrapErr;
use candle::{CpuStorage, DType, Layout, Result, Shape, Tensor};
use half::{bf16, f16};
pub struct FlashAttn {
pub softmax_scale: f32,
pub alibi_slopes: Option<Tensor>,
pub ... | candle/candle-flash-attn/src/lib.rs/0 | {
"file_path": "candle/candle-flash-attn/src/lib.rs",
"repo_id": "candle",
"token_count": 15978
} | 37 |
#include "cuda_utils.cuh"
#include <cmath>
#include <stdint.h>
#define WARP_SIZE 32
const int BLOCK_SIZE = 1024;
// TODO: Maybe add some fast_sum_f16_f32 variant that not only accumulate in f32
// but also expect a f32 output so that this can be used for normalization e.g.
// in softmax.
// Fast reduce sum kernel, t... | candle/candle-kernels/src/reduce.cu/0 | {
"file_path": "candle/candle-kernels/src/reduce.cu",
"repo_id": "candle",
"token_count": 12841
} | 38 |
// Imported from https://github.com/ggerganov/llama.cpp/blob/master/ggml-metal.metal
#include <metal_stdlib>
using namespace metal;
#define SWAP(x, y) { auto tmp = (x); (x) = (y); (y) = tmp; }
#define SORT_ASC 1
#define SORT_DESC 0
template<int order, typename T>
METAL_FUNC void argsort(
device const T ... | candle/candle-metal-kernels/src/sort.metal/0 | {
"file_path": "candle/candle-metal-kernels/src/sort.metal",
"repo_id": "candle",
"token_count": 1748
} | 39 |
/// This example contains some simple benchmarks so that it's easy to run them in perf etc.
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use candle::quantized::GgmlType;
use candle::{CpuStorage, Device, Layout, Module, Result, Shape, Tensor, D};
use c... | candle/candle-nn/examples/cpu_benchmarks.rs/0 | {
"file_path": "candle/candle-nn/examples/cpu_benchmarks.rs",
"repo_id": "candle",
"token_count": 5543
} | 40 |
//! Recurrent Neural Networks
use candle::{DType, Device, IndexOp, Result, Tensor};
/// Trait for Recurrent Neural Networks.
#[allow(clippy::upper_case_acronyms)]
pub trait RNN {
type State: Clone;
/// A zero state from which the recurrent network is usually initialized.
fn zero_state(&self, batch_dim: us... | candle/candle-nn/src/rnn.rs/0 | {
"file_path": "candle/candle-nn/src/rnn.rs",
"repo_id": "candle",
"token_count": 4925
} | 41 |
use crate::onnx::attribute_proto::AttributeType;
use crate::onnx::tensor_proto::DataType;
use crate::onnx::{self, GraphProto};
use candle::{bail, DType, Device, Result, Tensor};
use std::{collections::HashMap, usize};
pub type Value = Tensor;
pub fn dtype(dt: DataType) -> Option<DType> {
match dt {
DataTy... | candle/candle-onnx/src/eval.rs/0 | {
"file_path": "candle/candle-onnx/src/eval.rs",
"repo_id": "candle",
"token_count": 42834
} | 42 |
import candle
from typing import Dict, Tuple, Any
from candle import Tensor, QTensor, utils, nn
from candle.nn import Module, ModuleList
def masked_fill(on_false: Tensor, mask: Tensor, on_true: Tensor):
shape = mask.shape
on_true = candle.tensor(on_true).broadcast_as(shape)
return mask.where_cond(on_true,... | candle/candle-pyo3/py_src/candle/models/llama.py/0 | {
"file_path": "candle/candle-pyo3/py_src/candle/models/llama.py",
"repo_id": "candle",
"token_count": 2981
} | 43 |
#![allow(clippy::redundant_closure_call)]
use pyo3::exceptions::{PyTypeError, PyValueError};
use pyo3::prelude::*;
use pyo3::pyclass::CompareOp;
use pyo3::types::{IntoPyDict, PyDict, PyTuple};
use pyo3::ToPyObject;
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
use std::os::raw::c_long;
u... | candle/candle-pyo3/src/lib.rs/0 | {
"file_path": "candle/candle-pyo3/src/lib.rs",
"repo_id": "candle",
"token_count": 29734
} | 44 |
use candle::{DType, Error, Result, Tensor};
use rand::{distributions::Distribution, SeedableRng};
#[derive(Clone, PartialEq, Debug)]
pub enum Sampling {
ArgMax,
All { temperature: f64 },
TopK { k: usize, temperature: f64 },
TopP { p: f64, temperature: f64 },
TopKThenTopP { k: usize, p: f64, tempera... | candle/candle-transformers/src/generation/mod.rs/0 | {
"file_path": "candle/candle-transformers/src/generation/mod.rs",
"repo_id": "candle",
"token_count": 2910
} | 45 |
use candle::D::Minus1;
use candle::{Module, Result, Tensor};
use candle_nn::ops::Identity;
use candle_nn::{
batch_norm, conv2d, conv2d_no_bias, conv_transpose2d, linear, seq, Activation, BatchNorm,
BatchNormConfig, Conv2d, Conv2dConfig, ConvTranspose2dConfig, Sequential, VarBuilder,
};
use crate::models::dinov... | candle/candle-transformers/src/models/depth_anything_v2.rs/0 | {
"file_path": "candle/candle-transformers/src/models/depth_anything_v2.rs",
"repo_id": "candle",
"token_count": 9039
} | 46 |
use candle::{bail, DType, Module, Result, Tensor};
use candle_nn as nn;
pub struct PatchEmbedder {
proj: nn::Conv2d,
}
impl PatchEmbedder {
pub fn new(
patch_size: usize,
in_channels: usize,
embed_dim: usize,
vb: nn::VarBuilder,
) -> Result<Self> {
let proj = nn::co... | candle/candle-transformers/src/models/mmdit/embedding.rs/0 | {
"file_path": "candle/candle-transformers/src/models/mmdit/embedding.rs",
"repo_id": "candle",
"token_count": 2837
} | 47 |
// This implementation is based on:
// https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/blob/main/modeling_phi3.py
use crate::models::with_tracing::{linear_no_bias as linear, Linear, RmsNorm};
use candle::{DType, Device, Module, Result, Tensor, D};
use candle_nn::VarBuilder;
use std::sync::Arc;
// https://huggi... | candle/candle-transformers/src/models/phi3.rs/0 | {
"file_path": "candle/candle-transformers/src/models/phi3.rs",
"repo_id": "candle",
"token_count": 5728
} | 48 |
use candle::{Result, Tensor};
use candle_nn::{layer_norm, LayerNorm, Linear, Module, VarBuilder};
#[derive(Debug)]
struct Attention {
q_proj: Linear,
k_proj: Linear,
v_proj: Linear,
out_proj: Linear,
num_heads: usize,
}
impl Attention {
fn new(
embedding_dim: usize,
num_heads: ... | candle/candle-transformers/src/models/segment_anything/transformer.rs/0 | {
"file_path": "candle/candle-transformers/src/models/segment_anything/transformer.rs",
"repo_id": "candle",
"token_count": 3597
} | 49 |
// T5 Text Model
// https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_t5.py
use crate::models::with_tracing::{linear_no_bias, Embedding, Linear};
use candle::{DType, Device, Module, Result, Tensor, D};
use candle_nn::{Activation, VarBuilder};
use serde::Deserialize;
use std::syn... | candle/candle-transformers/src/models/t5.rs/0 | {
"file_path": "candle/candle-transformers/src/models/t5.rs",
"repo_id": "candle",
"token_count": 15093
} | 50 |
/// https://huggingface.co/01-ai/Yi-6B/blob/main/modeling_yi.py
use crate::models::with_tracing::{linear_no_bias, Linear, RmsNorm};
use candle::{DType, Device, Module, Result, Tensor, D};
use candle_nn::{Activation, VarBuilder};
use std::sync::Arc;
#[derive(Debug, Clone, PartialEq)]
pub struct Config {
pub(crate) ... | candle/candle-transformers/src/models/yi.rs/0 | {
"file_path": "candle/candle-transformers/src/models/yi.rs",
"repo_id": "candle",
"token_count": 6220
} | 51 |
export async function getEmbeddings(
worker,
weightsURL,
tokenizerURL,
configURL,
modelID,
sentences,
updateStatus = null
) {
return new Promise((resolve, reject) => {
worker.postMessage({
weightsURL,
tokenizerURL,
configURL,
modelID,
sentences,
});
function mes... | candle/candle-wasm-examples/bert/utils.js/0 | {
"file_path": "candle/candle-wasm-examples/bert/utils.js",
"repo_id": "candle",
"token_count": 1250
} | 52 |
cargo build --target wasm32-unknown-unknown --release
wasm-bindgen ../../target/wasm32-unknown-unknown/release/m.wasm --out-dir build --target web
wasm-bindgen ../../target/wasm32-unknown-unknown/release/m-quantized.wasm --out-dir build --target web
| candle/candle-wasm-examples/t5/build-lib.sh/0 | {
"file_path": "candle/candle-wasm-examples/t5/build-lib.sh",
"repo_id": "candle",
"token_count": 84
} | 53 |
use yew_agent::PublicWorker;
fn main() {
candle_wasm_example_whisper::Worker::register();
}
| candle/candle-wasm-examples/whisper/src/bin/worker.rs/0 | {
"file_path": "candle/candle-wasm-examples/whisper/src/bin/worker.rs",
"repo_id": "candle",
"token_count": 38
} | 54 |
use candle::{DType, IndexOp, Result, Tensor, D};
use candle_nn::{
batch_norm, conv2d, conv2d_no_bias, BatchNorm, Conv2d, Conv2dConfig, Module, VarBuilder,
};
use image::DynamicImage;
// Model architecture from https://github.com/ultralytics/ultralytics/issues/189
// https://github.com/tinygrad/tinygrad/blob/master... | candle/candle-wasm-examples/yolo/src/model.rs/0 | {
"file_path": "candle/candle-wasm-examples/yolo/src/model.rs",
"repo_id": "candle",
"token_count": 14731
} | 55 |
# Prompt templates
These are the templates used to format the conversation history for different models used in HuggingChat. Set them in your `.env.local` [like so](https://github.com/huggingface/chat-ui#chatprompttemplate).
## Llama 2
```env
<s>[INST] <<SYS>>\n{{preprompt}}\n<</SYS>>\n\n{{#each messages}}{{#ifUser}... | chat-ui/PROMPTS.md/0 | {
"file_path": "chat-ui/PROMPTS.md",
"repo_id": "chat-ui",
"token_count": 1133
} | 56 |
# Text Embedding Models
By default (for backward compatibility), when `TEXT_EMBEDDING_MODELS` environment variable is not defined, [transformers.js](https://huggingface.co/docs/transformers.js) embedding models will be used for embedding tasks, specifically, the [Xenova/gte-small](https://huggingface.co/Xenova/gte-sma... | chat-ui/docs/source/configuration/embeddings.md/0 | {
"file_path": "chat-ui/docs/source/configuration/embeddings.md",
"repo_id": "chat-ui",
"token_count": 1246
} | 57 |
# Configuration Overview
Chat UI handles configuration with environment variables. The default config for Chat UI is stored in the `.env` file, which you may use as a reference. You will need to override some values to get Chat UI to run locally. This can be done in `.env.local` or via your environment. The bare minim... | chat-ui/docs/source/configuration/overview.md/0 | {
"file_path": "chat-ui/docs/source/configuration/overview.md",
"repo_id": "chat-ui",
"token_count": 130
} | 58 |
import fs from "fs";
import yaml from "js-yaml";
const file = fs.readFileSync("chart/env/prod.yaml", "utf8");
// have to do a weird stringify/parse because of some node error
const prod = JSON.parse(JSON.stringify(yaml.load(file)));
const vars = prod.envVars as Record<string, string>;
let PUBLIC_CONFIG = "";
Object.... | chat-ui/scripts/updateLocalEnv.ts/0 | {
"file_path": "chat-ui/scripts/updateLocalEnv.ts",
"repo_id": "chat-ui",
"token_count": 288
} | 59 |
<script lang="ts">
export let label = "";
</script>
<div class="group/tooltip md:relative">
<slot />
<div
class="invisible absolute z-10 w-64 whitespace-normal rounded-md bg-black p-2 text-center text-white group-hover/tooltip:visible group-active/tooltip:visible max-sm:left-1/2 max-sm:-translate-x-1/2"
>
{lab... | chat-ui/src/lib/components/HoverTooltip.svelte/0 | {
"file_path": "chat-ui/src/lib/components/HoverTooltip.svelte",
"repo_id": "chat-ui",
"token_count": 132
} | 60 |
<script lang="ts">
import { fade } from "svelte/transition";
import IconDazzled from "$lib/components/icons/IconDazzled.svelte";
export let message = "";
</script>
<div
transition:fade|global={{ duration: 300 }}
class="pointer-events-none fixed right-0 top-12 z-20 bg-gradient-to-bl from-red-500/20 via-red-500/0... | chat-ui/src/lib/components/Toast.svelte/0 | {
"file_path": "chat-ui/src/lib/components/Toast.svelte",
"repo_id": "chat-ui",
"token_count": 259
} | 61 |
<script lang="ts">
export let classNames = "";
</script>
<svg
width="1em"
height="1em"
viewBox="0 0 15 6"
class={classNames}
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1.67236 1L7.67236 7L13.6724 1"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
... | chat-ui/src/lib/components/icons/IconChevron.svelte/0 | {
"file_path": "chat-ui/src/lib/components/icons/IconChevron.svelte",
"repo_id": "chat-ui",
"token_count": 156
} | 62 |
import type { Migration } from ".";
import { collections } from "$lib/server/database";
import { ObjectId, type AnyBulkWriteOperation } from "mongodb";
import type { Assistant } from "$lib/types/Assistant";
import { generateSearchTokens } from "$lib/utils/searchTokens";
const migration: Migration = {
_id: new ObjectI... | chat-ui/src/lib/migrations/routines/01-update-search-assistants.ts/0 | {
"file_path": "chat-ui/src/lib/migrations/routines/01-update-search-assistants.ts",
"repo_id": "chat-ui",
"token_count": 483
} | 63 |
import { env } from "$env/dynamic/private";
import { z } from "zod";
import { sum } from "$lib/utils/sum";
import {
embeddingEndpoints,
embeddingEndpointSchema,
type EmbeddingEndpoint,
} from "$lib/server/embeddingEndpoints/embeddingEndpoints";
import { embeddingEndpointTransformersJS } from "$lib/server/embeddingE... | chat-ui/src/lib/server/embeddingModels.ts/0 | {
"file_path": "chat-ui/src/lib/server/embeddingModels.ts",
"repo_id": "chat-ui",
"token_count": 1115
} | 64 |
import type { TextGenerationStreamOutput } from "@huggingface/inference";
import type OpenAI from "openai";
import type { Stream } from "openai/streaming";
/**
* Transform a stream of OpenAI.Chat.ChatCompletion into a stream of TextGenerationStreamOutput
*/
export async function* openAIChatToTextGenerationStream(
c... | chat-ui/src/lib/server/endpoints/openai/openAIChatToTextGenerationStream.ts/0 | {
"file_path": "chat-ui/src/lib/server/endpoints/openai/openAIChatToTextGenerationStream.ts",
"repo_id": "chat-ui",
"token_count": 335
} | 65 |
import { runWebSearch } from "$lib/server/websearch/runWebSearch";
import { preprocessMessages } from "../endpoints/preprocessMessages";
import { generateTitleForConversation } from "./title";
import {
assistantHasDynamicPrompt,
assistantHasWebSearch,
getAssistantById,
processPreprompt,
} from "./assistant";
impor... | chat-ui/src/lib/server/textGeneration/index.ts/0 | {
"file_path": "chat-ui/src/lib/server/textGeneration/index.ts",
"repo_id": "chat-ui",
"token_count": 934
} | 66 |
import type { SerializedHTMLElement } from "../scrape/types";
import { htmlElementToMarkdownElements, mergeAdjacentElements } from "./fromHtml";
import type { HeaderElement, MarkdownElement } from "./types";
import { MarkdownElementType } from "./types";
import { chunkElements } from "./utils/chunk";
/**
* Converts H... | chat-ui/src/lib/server/websearch/markdown/tree.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/markdown/tree.ts",
"repo_id": "chat-ui",
"token_count": 613
} | 67 |
import { env } from "$env/dynamic/private";
import type { WebSearchSource } from "$lib/types/WebSearch";
export default async function search(query: string): Promise<WebSearchSource[]> {
const params = {
q: query,
hl: "en",
gl: "us",
};
const response = await fetch("https://google.serper.dev/search", {
met... | chat-ui/src/lib/server/websearch/search/endpoints/serper.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/search/endpoints/serper.ts",
"repo_id": "chat-ui",
"token_count": 282
} | 68 |
import type { ObjectId } from "mongodb";
import type { User } from "./User";
import type { Timestamps } from "./Timestamps";
export interface Assistant extends Timestamps {
_id: ObjectId;
createdById: User["_id"] | string; // user id or session
createdByName?: User["username"];
avatar?: string;
name: string;
des... | chat-ui/src/lib/types/Assistant.ts/0 | {
"file_path": "chat-ui/src/lib/types/Assistant.ts",
"repo_id": "chat-ui",
"token_count": 306
} | 69 |
export interface Timestamps {
createdAt: Date;
updatedAt: Date;
}
| chat-ui/src/lib/types/Timestamps.ts/0 | {
"file_path": "chat-ui/src/lib/types/Timestamps.ts",
"repo_id": "chat-ui",
"token_count": 23
} | 70 |
import type { Conversation } from "$lib/types/Conversation";
import { sha256 } from "./sha256";
export async function hashConv(conv: Conversation) {
// messages contains the conversation message but only the immutable part
const messages = conv.messages.map((message) => {
return (({ from, id, content, webSearchId ... | chat-ui/src/lib/utils/hashConv.ts/0 | {
"file_path": "chat-ui/src/lib/utils/hashConv.ts",
"repo_id": "chat-ui",
"token_count": 132
} | 71 |
import type { Tool } from "$lib/types/Tool";
/**
* Checks if a tool's name equals a value. Replaces all hyphens with underscores before comparison
* since some models return underscores even when hyphens are used in the request.
**/
export function toolHasName(name: string, tool: Pick<Tool, "name">): boolean {
ret... | chat-ui/src/lib/utils/tools.ts/0 | {
"file_path": "chat-ui/src/lib/utils/tools.ts",
"repo_id": "chat-ui",
"token_count": 202
} | 72 |
import { env } from "$env/dynamic/private";
import { collections } from "$lib/server/database";
import type { Message } from "$lib/types/Message";
import { error } from "@sveltejs/kit";
import { pathToFileURL } from "node:url";
import { unlink } from "node:fs/promises";
import { uploadFile } from "@huggingface/hub";
im... | chat-ui/src/routes/admin/export/+server.ts/0 | {
"file_path": "chat-ui/src/routes/admin/export/+server.ts",
"repo_id": "chat-ui",
"token_count": 1661
} | 73 |
import { base } from "$app/paths";
import { env } from "$env/dynamic/private";
import { Database, collections } from "$lib/server/database.js";
import { SortKey, type Assistant } from "$lib/types/Assistant";
import type { User } from "$lib/types/User";
import { generateQueryTokens } from "$lib/utils/searchTokens.js";
i... | chat-ui/src/routes/assistants/+page.server.ts/0 | {
"file_path": "chat-ui/src/routes/assistants/+page.server.ts",
"repo_id": "chat-ui",
"token_count": 934
} | 74 |
import { refreshSessionCookie } from "$lib/server/auth";
import { collections } from "$lib/server/database";
import { ObjectId } from "mongodb";
import { DEFAULT_SETTINGS } from "$lib/types/Settings";
import { z } from "zod";
import type { UserinfoResponse } from "openid-client";
import { error, type Cookies } from "@s... | chat-ui/src/routes/login/callback/updateUser.ts/0 | {
"file_path": "chat-ui/src/routes/login/callback/updateUser.ts",
"repo_id": "chat-ui",
"token_count": 1956
} | 75 |
import { base } from "$app/paths";
import { redirect } from "@sveltejs/kit";
export async function load({ parent, params }) {
const data = await parent();
const assistant = data.settings.assistants.find((id) => id === params.assistantId);
if (!assistant) {
redirect(302, `${base}/assistant/${params.assistantId}`... | chat-ui/src/routes/settings/(nav)/assistants/[assistantId]/+page.ts/0 | {
"file_path": "chat-ui/src/routes/settings/(nav)/assistants/[assistantId]/+page.ts",
"repo_id": "chat-ui",
"token_count": 115
} | 76 |
import { base } from "$app/paths";
import { env } from "$env/dynamic/private";
import { env as envPublic } from "$env/dynamic/public";
import { collections } from "$lib/server/database";
import { logger } from "$lib/server/logger";
import type { Tool } from "$lib/types/Tool";
import { fail, redirect, type Actions } fro... | chat-ui/src/routes/tools/[toolId]/+page.server.ts/0 | {
"file_path": "chat-ui/src/routes/tools/[toolId]/+page.server.ts",
"repo_id": "chat-ui",
"token_count": 1743
} | 77 |
{
"background_color": "#ffffff",
"name": "Chat UI",
"short_name": "Chat UI",
"display": "standalone",
"start_url": "/",
"icons": [
{
"src": "/chatui/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "/chatui/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
... | chat-ui/static/chatui/manifest.json/0 | {
"file_path": "chat-ui/static/chatui/manifest.json",
"repo_id": "chat-ui",
"token_count": 218
} | 78 |
# How to add one new datasets
Add datasets directly to the 🤗 Hugging Face Hub!
You can share your dataset on https://huggingface.co/datasets directly using your account, see the documentation:
* [Create a dataset and upload files on the website](https://huggingface.co/docs/datasets/upload_dataset)
* [Advanced guide... | datasets/ADD_NEW_DATASET.md/0 | {
"file_path": "datasets/ADD_NEW_DATASET.md",
"repo_id": "datasets",
"token_count": 113
} | 79 |
# Differences between Dataset and IterableDataset
There are two types of dataset objects, a [`Dataset`] and an [`IterableDataset`].
Whichever type of dataset you choose to use or create depends on the size of the dataset.
In general, an [`IterableDataset`] is ideal for big datasets (think hundreds of GBs!) due to its ... | datasets/docs/source/about_mapstyle_vs_iterable.mdx/0 | {
"file_path": "datasets/docs/source/about_mapstyle_vs_iterable.mdx",
"repo_id": "datasets",
"token_count": 3730
} | 80 |
# Load image data
Image datasets have [`Image`] type columns, which contain PIL objects.
<Tip>
To work with image datasets, you need to have the `vision` dependency installed. Check out the [installation](./installation#vision) guide to learn how to install it.
</Tip>
When you load an image dataset and call the i... | datasets/docs/source/image_load.mdx/0 | {
"file_path": "datasets/docs/source/image_load.mdx",
"repo_id": "datasets",
"token_count": 1388
} | 81 |
# Process
🤗 Datasets provides many tools for modifying the structure and content of a dataset. These tools are important for tidying up a dataset, creating additional columns, converting between features and formats, and much more.
This guide will show you how to:
- Reorder rows and split the dataset.
- Rename and ... | datasets/docs/source/process.mdx/0 | {
"file_path": "datasets/docs/source/process.mdx",
"repo_id": "datasets",
"token_count": 10961
} | 82 |
<!---
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
} | 83 |
import importlib
import importlib.metadata
import logging
import os
import platform
from pathlib import Path
from typing import Optional
from huggingface_hub import constants
from packaging import version
logger = logging.getLogger(__name__.split(".", 1)[0]) # to avoid circular import from .utils.logging
# Dataset... | datasets/src/datasets/config.py/0 | {
"file_path": "datasets/src/datasets/config.py",
"repo_id": "datasets",
"token_count": 4102
} | 84 |
import inspect
import os
import random
import shutil
import tempfile
import weakref
from functools import wraps
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import xxhash
from . import config
from .naming import INVALID_WINDOWS_CHARACT... | datasets/src/datasets/fingerprint.py/0 | {
"file_path": "datasets/src/datasets/fingerprint.py",
"repo_id": "datasets",
"token_count": 7526
} | 85 |
import os
from typing import BinaryIO, Optional, Union
import fsspec
import numpy as np
import pyarrow.parquet as pq
from .. import Audio, Dataset, Features, Image, NamedSplit, Value, config
from ..features.features import FeatureType, _visit
from ..formatting import query_table
from ..packaged_modules import _PACKAG... | datasets/src/datasets/io/parquet.py/0 | {
"file_path": "datasets/src/datasets/io/parquet.py",
"repo_id": "datasets",
"token_count": 2585
} | 86 |
import itertools
from dataclasses import dataclass
from typing import Any, Callable, Dict, List, Optional, Union
import pandas as pd
import pyarrow as pa
import datasets
import datasets.config
from datasets.features.features import require_storage_cast
from datasets.table import table_cast
from datasets.utils.py_util... | datasets/src/datasets/packaged_modules/csv/csv.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/csv/csv.py",
"repo_id": "datasets",
"token_count": 3889
} | 87 |
import sys
from dataclasses import dataclass
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
import pandas as pd
import pyarrow as pa
import datasets
import datasets.config
from datasets.features.features import require_storage_cast
from datasets.table import table_cast
if TYPE_CHECKING:
im... | datasets/src/datasets/packaged_modules/sql/sql.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/sql/sql.py",
"repo_id": "datasets",
"token_count": 1979
} | 88 |
import enum
import inspect
import warnings
from functools import wraps
from typing import Callable, Optional
from .logging import get_logger
_emitted_deprecation_warnings = set()
logger = get_logger(__name__)
def deprecated(help_message: Optional[str] = None):
"""Decorator to mark a class or a function as depr... | datasets/src/datasets/utils/deprecation_utils.py/0 | {
"file_path": "datasets/src/datasets/utils/deprecation_utils.py",
"repo_id": "datasets",
"token_count": 1426
} | 89 |
name: "" # Filename comes here
allow_empty: false
allow_empty_text: true
subsections:
- name: "Dataset Card for X" # First-level markdown heading
allow_empty: false
allow_empty_text: true
subsections:
- name: "Table of Contents"
allow_empty: false
allow_empty_text: false
subs... | datasets/src/datasets/utils/resources/readme_structure.yaml/0 | {
"file_path": "datasets/src/datasets/utils/resources/readme_structure.yaml",
"repo_id": "datasets",
"token_count": 1924
} | 90 |
import pytest
DATASET_LOADING_SCRIPT_NAME = "__dummy_dataset1__"
DATASET_LOADING_SCRIPT_CODE = """
import json
import os
import datasets
REPO_URL = "https://huggingface.co/datasets/hf-internal-testing/raw_jsonl/resolve/main/"
URLS = {"train": REPO_URL + "wikiann-bn-train.jsonl", "validation": REPO_URL + "wikiann-... | datasets/tests/commands/conftest.py/0 | {
"file_path": "datasets/tests/commands/conftest.py",
"repo_id": "datasets",
"token_count": 1193
} | 91 |
from pathlib import Path
import pytest
from datasets import load_dataset
from datasets.packaged_modules.cache.cache import Cache
SAMPLE_DATASET_SINGLE_CONFIG_IN_METADATA = "hf-internal-testing/audiofolder_single_config_in_metadata"
SAMPLE_DATASET_TWO_CONFIG_IN_METADATA = "hf-internal-testing/audiofolder_two_configs... | datasets/tests/packaged_modules/test_cache.py/0 | {
"file_path": "datasets/tests/packaged_modules/test_cache.py",
"repo_id": "datasets",
"token_count": 2721
} | 92 |
import os
import tempfile
from unittest import TestCase
import numpy as np
import pandas as pd
import pytest
from datasets import load_from_disk
from datasets.arrow_dataset import Dataset
from datasets.dataset_dict import DatasetDict, IterableDatasetDict
from datasets.features import ClassLabel, Features, Sequence, V... | datasets/tests/test_dataset_dict.py/0 | {
"file_path": "datasets/tests/test_dataset_dict.py",
"repo_id": "datasets",
"token_count": 17837
} | 93 |
import pickle
from copy import deepcopy
from itertools import chain, cycle, islice
import numpy as np
import pandas as pd
import pyarrow as pa
import pyarrow.compute as pc
import pytest
from datasets import Dataset, load_dataset
from datasets.combine import concatenate_datasets, interleave_datasets
from datasets.dist... | datasets/tests/test_iterable_dataset.py/0 | {
"file_path": "datasets/tests/test_iterable_dataset.py",
"repo_id": "datasets",
"token_count": 42237
} | 94 |
<jupyter_start><jupyter_text>Unit 8 Part 2: Advanced Deep Reinforcement Learning. Using Sample Factory to play Doom from pixelsIn this notebook, we will learn how to train a Deep Neural Network to collect objects in a 3D environment based on the game of Doom, a video of the resulting policy is shown below. We train thi... | deep-rl-class/notebooks/unit8/unit8_part2.ipynb/0 | {
"file_path": "deep-rl-class/notebooks/unit8/unit8_part2.ipynb",
"repo_id": "deep-rl-class",
"token_count": 4950
} | 95 |
# The Reinforcement Learning Framework [[the-reinforcement-learning-framework]]
## The RL Process [[the-rl-process]]
<figure>
<img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit1/RL_process.jpg" alt="The RL process" width="100%">
<figcaption>The RL Process: a loop o... | deep-rl-class/units/en/unit1/rl-framework.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit1/rl-framework.mdx",
"repo_id": "deep-rl-class",
"token_count": 2504
} | 96 |
# Introducing Q-Learning [[q-learning]]
## What is Q-Learning? [[what-is-q-learning]]
Q-Learning is an **off-policy value-based method that uses a TD approach to train its action-value function:**
- *Off-policy*: we'll talk about that at the end of this unit.
- *Value-based method*: finds the optimal policy indirectl... | deep-rl-class/units/en/unit2/q-learning.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit2/q-learning.mdx",
"repo_id": "deep-rl-class",
"token_count": 2955
} | 97 |
# Glossary
This is a community-created glossary. Contributions are welcome!
- **Deep Q-Learning:** A value-based deep reinforcement learning algorithm that uses a deep neural network to approximate Q-values for actions in a given state. The goal of Deep Q-learning is to find the optimal policy that maximizes the exp... | deep-rl-class/units/en/unit4/glossary.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit4/glossary.mdx",
"repo_id": "deep-rl-class",
"token_count": 421
} | 98 |
# Additional Readings [[additional-readings]]
## Bias-variance tradeoff in Reinforcement Learning
If you want to dive deeper into the question of variance and bias tradeoff in Deep Reinforcement Learning, you can check out these two articles:
- [Making Sense of the Bias / Variance Trade-off in (Deep) Reinforcement L... | deep-rl-class/units/en/unit6/additional-readings.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit6/additional-readings.mdx",
"repo_id": "deep-rl-class",
"token_count": 321
} | 99 |
# Introducing the Clipped Surrogate Objective Function
## Recap: The Policy Objective Function
Let’s remember what the objective is to optimize in Reinforce:
<img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit9/lpg.jpg" alt="Reinforce"/>
The idea was that by taking ... | deep-rl-class/units/en/unit8/clipped-surrogate-objective.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit8/clipped-surrogate-objective.mdx",
"repo_id": "deep-rl-class",
"token_count": 1386
} | 100 |
# Optuna Tutorial [[optuna]]
The content below comes from [Antonin's Raffin ICRA 2022 presentations](https://araffin.github.io/tools-for-robotic-rl-icra2022/), he's one of the founders of Stable-Baselines and RL-Baselines3-Zoo.
## The theory behind Hyperparameter tuning
<Youtube id="AidFTOdGNFQ" />
## Optuna Tuto... | deep-rl-class/units/en/unitbonus2/optuna.mdx/0 | {
"file_path": "deep-rl-class/units/en/unitbonus2/optuna.mdx",
"repo_id": "deep-rl-class",
"token_count": 182
} | 101 |
# Getting started:
To get started, download the project from [here](https://huggingface.co/ivan267/imitation-learning-tutorial-godot-project/tree/main) (click on the download icon next to `GDRL-IL-Project.zip`). The zip file features both the “Starter” and “Complete” projects.
The game code is already implemented in ... | deep-rl-class/units/en/unitbonus5/getting-started.mdx/0 | {
"file_path": "deep-rl-class/units/en/unitbonus5/getting-started.mdx",
"repo_id": "deep-rl-class",
"token_count": 3919
} | 102 |
import argparse
import sys
sys.path.append(".")
from base_classes import LCMLoRATextToImageBenchmark # noqa: E402
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--ckpt",
type=str,
default="stabilityai/stable-diffusion-xl-base-1.0",
)
pars... | diffusers/benchmarks/benchmark_t2i_lcm_lora.py/0 | {
"file_path": "diffusers/benchmarks/benchmark_t2i_lcm_lora.py",
"repo_id": "diffusers",
"token_count": 273
} | 103 |
# docstyle-ignore
INSTALL_CONTENT = """
# Diffusers installation
! pip install diffusers transformers datasets accelerate
# To install from source instead of the last release, comment the command above and uncomment the following one.
# ! pip install git+https://github.com/huggingface/diffusers.git
"""
notebook_first_... | diffusers/docs/source/_config.py/0 | {
"file_path": "diffusers/docs/source/_config.py",
"repo_id": "diffusers",
"token_count": 102
} | 104 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/schedulers/ddim.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/ddim.md",
"repo_id": "diffusers",
"token_count": 1122
} | 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/lms_discrete.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/lms_discrete.md",
"repo_id": "diffusers",
"token_count": 335
} | 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/conceptual/contribution.md/0 | {
"file_path": "diffusers/docs/source/en/conceptual/contribution.md",
"repo_id": "diffusers",
"token_count": 10990
} | 107 |
# T-GATE
[T-GATE](https://github.com/HaozheLiu-ST/T-GATE/tree/main) accelerates inference for [Stable Diffusion](../api/pipelines/stable_diffusion/overview), [PixArt](../api/pipelines/pixart), and [Latency Consistency Model](../api/pipelines/latent_consistency_models.md) pipelines by skipping the cross-attention calcu... | diffusers/docs/source/en/optimization/tgate.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/tgate.md",
"repo_id": "diffusers",
"token_count": 2963
} | 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/lora.md/0 | {
"file_path": "diffusers/docs/source/en/training/lora.md",
"repo_id": "diffusers",
"token_count": 3340
} | 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/controlling_generation.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/controlling_generation.md",
"repo_id": "diffusers",
"token_count": 6311
} | 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/other-formats.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/other-formats.md",
"repo_id": "diffusers",
"token_count": 7966
} | 111 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/using-diffusers/weighted_prompts.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/weighted_prompts.md",
"repo_id": "diffusers",
"token_count": 7819
} | 112 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.