text stringlengths 7 1.24M | id stringlengths 14 166 | metadata dict | __index_level_0__ int64 0 519 |
|---|---|---|---|
FROM nvcr.io/nvidia/pytorch:24.07-py3
RUN pip install transformers evaluate datasets
RUN git clone https://github.com/huggingface/accelerate.git
RUN cd accelerate && \
pip install -e . && \
cd benchmarks/fp8
RUN /bin/bash
| accelerate/benchmarks/fp8/Dockerfile/0 | {
"file_path": "accelerate/benchmarks/fp8/Dockerfile",
"repo_id": "accelerate",
"token_count": 90
} | 0 |
<!--Copyright 2022 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... | accelerate/docs/source/basic_tutorials/launch.md/0 | {
"file_path": "accelerate/docs/source/basic_tutorials/launch.md",
"repo_id": "accelerate",
"token_count": 2702
} | 1 |
<!--Copyright 2021 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... | accelerate/docs/source/package_reference/utilities.md/0 | {
"file_path": "accelerate/docs/source/package_reference/utilities.md",
"repo_id": "accelerate",
"token_count": 1999
} | 2 |
<!--
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... | accelerate/docs/source/usage_guides/profiler.md/0 | {
"file_path": "accelerate/docs/source/usage_guides/profiler.md",
"repo_id": "accelerate",
"token_count": 5124
} | 3 |
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | accelerate/examples/cv_example.py/0 | {
"file_path": "accelerate/examples/cv_example.py",
"repo_id": "accelerate",
"token_count": 3215
} | 4 |
# 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... | accelerate/manim_animations/dataloaders/stage_4.py/0 | {
"file_path": "accelerate/manim_animations/dataloaders/stage_4.py",
"repo_id": "accelerate",
"token_count": 914
} | 5 |
#!/usr/bin/env python
# Copyright 2021 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... | accelerate/src/accelerate/commands/config/config_utils.py/0 | {
"file_path": "accelerate/src/accelerate/commands/config/config_utils.py",
"repo_id": "accelerate",
"token_count": 1219
} | 6 |
# 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... | accelerate/src/accelerate/commands/utils.py/0 | {
"file_path": "accelerate/src/accelerate/commands/utils.py",
"repo_id": "accelerate",
"token_count": 1619
} | 7 |
# Copyright 2022 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... | accelerate/src/accelerate/test_utils/scripts/external_deps/test_metrics.py/0 | {
"file_path": "accelerate/src/accelerate/test_utils/scripts/external_deps/test_metrics.py",
"repo_id": "accelerate",
"token_count": 4714
} | 8 |
# Copyright 2022 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... | accelerate/src/accelerate/utils/__init__.py/0 | {
"file_path": "accelerate/src/accelerate/utils/__init__.py",
"repo_id": "accelerate",
"token_count": 2864
} | 9 |
compute_environment: LOCAL_MACHINE
debug: false
distributed_type: MULTI_GPU
downcast_bf16: 'no'
enable_cpu_affinity: false
fp8_config:
amax_compute_algorithm: max
amax_history_length: 1024
backend: TE
fp8_format: E4M3
interval: 1
margin: 0
override_linear_precision: false
use_autocast_during_eval: false... | accelerate/tests/test_configs/0_34_0_fp8.yaml/0 | {
"file_path": "accelerate/tests/test_configs/0_34_0_fp8.yaml",
"repo_id": "accelerate",
"token_count": 216
} | 10 |
# Copyright 2022 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... | accelerate/tests/test_offload.py/0 | {
"file_path": "accelerate/tests/test_offload.py",
"repo_id": "accelerate",
"token_count": 1981
} | 11 |
# Model arguments
model_name_or_path: BramVanroy/gpt2-sft-dutch
model_revision: main
torch_dtype: bfloat16
# Data training arguments
# For definitions, see: src/h4/training/config.py
dataset_mixer:
BramVanroy/ultra_feedback_dutch: 1.0
dataset_splits:
- train_prefs
- test_prefs
preprocessing_num_workers: 12
# DPOTra... | alignment-handbook/recipes/gpt2-nl/dpo/config_full.yaml/0 | {
"file_path": "alignment-handbook/recipes/gpt2-nl/dpo/config_full.yaml",
"repo_id": "alignment-handbook",
"token_count": 374
} | 12 |
# Model arguments
model_name_or_path: alignment-handbook/zephyr-7b-sft-qlora
torch_dtype: bfloat16
attn_implementation: flash_attention_2
# LoRA arguments
use_peft: true
load_in_4bit: true
lora_r: 128
lora_alpha: 128
lora_dropout: 0.05
lora_target_modules:
- q_proj
- k_proj
- v_proj
- o_proj
- gate_proj
- up_proj
- do... | alignment-handbook/recipes/zephyr-7b-beta/dpo/config_qlora.yaml/0 | {
"file_path": "alignment-handbook/recipes/zephyr-7b-beta/dpo/config_qlora.yaml",
"repo_id": "alignment-handbook",
"token_count": 490
} | 13 |
# coding=utf-8
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | alignment-handbook/src/alignment/decontaminate.py/0 | {
"file_path": "alignment-handbook/src/alignment/decontaminate.py",
"repo_id": "alignment-handbook",
"token_count": 1160
} | 14 |
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none",
"python.testing.pytestArgs": [
"candle-pyo3"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
} | candle/.vscode/settings.json/0 | {
"file_path": "candle/.vscode/settings.json",
"repo_id": "candle",
"token_count": 123
} | 15 |
# Creating a WASM app
| candle/candle-book/src/apps/wasm.md/0 | {
"file_path": "candle/candle-book/src/apps/wasm.md",
"repo_id": "candle",
"token_count": 7
} | 16 |
# Fine-tuning
| candle/candle-book/src/training/finetuning.md/0 | {
"file_path": "candle/candle-book/src/training/finetuning.md",
"repo_id": "candle",
"token_count": 6
} | 17 |
use crate::benchmarks::{BenchDevice, BenchDeviceHandler};
use candle_core::{DType, Device, Tensor};
use criterion::{black_box, criterion_group, Criterion, Throughput};
use std::time::Instant;
fn run(a: &Tensor, b: &Tensor, c: &Tensor) {
a.where_cond(b, c).unwrap();
}
const fn create_cond_arr<const N: usize>() -> ... | candle/candle-core/benches/benchmarks/where_cond.rs/0 | {
"file_path": "candle/candle-core/benches/benchmarks/where_cond.rs",
"repo_id": "candle",
"token_count": 939
} | 18 |
use crate::backend::{BackendDevice, BackendStorage};
use crate::op::{BinaryOpT, CmpOp, ReduceOp, UnaryOpT};
use crate::{DType, Error, IntDType, Layout, Result, Shape, WithDType};
use half::{bf16, f16};
use rayon::prelude::*;
mod utils;
pub use utils::{
binary_map, binary_map_vec, unary_map, unary_map_vec, Map1, Ma... | candle/candle-core/src/cpu_backend/mod.rs/0 | {
"file_path": "candle/candle-core/src/cpu_backend/mod.rs",
"repo_id": "candle",
"token_count": 64123
} | 19 |
//! ML framework for Rust
//!
//! ```rust
//! use candle_core::{Tensor, DType, Device};
//! # use candle_core::Error;
//! # fn main() -> Result<(), Error>{
//!
//! let a = Tensor::arange(0f32, 6f32, &Device::Cpu)?.reshape((2, 3))?;
//! let b = Tensor::arange(0f32, 12f32, &Device::Cpu)?.reshape((3, 4))?;
//!
//! let c =... | candle/candle-core/src/lib.rs/0 | {
"file_path": "candle/candle-core/src/lib.rs",
"repo_id": "candle",
"token_count": 1598
} | 20 |
use super::k_quants::{
BlockQ2K, BlockQ3K, BlockQ4K, BlockQ4_0, BlockQ5K, BlockQ6K, BlockQ8K, BlockQ8_0, QK8_0, QK_K,
};
use crate::Result;
use byteorder::{ByteOrder, LittleEndian};
#[allow(unused_imports)]
#[cfg(target_arch = "arm")]
use core::arch::arm::*;
#[allow(unused_imports)]
#[cfg(target_arch = "aarch64")... | candle/candle-core/src/quantized/neon.rs/0 | {
"file_path": "candle/candle-core/src/quantized/neon.rs",
"repo_id": "candle",
"token_count": 15290
} | 21 |
use candle_core::backend::BackendStorage;
use candle_core::cpu_backend;
use candle_core::test_utils::to_vec1_round;
use candle_core::{CpuStorage, CustomOp1, DType, Device, Error, Layout, Result, Shape, Tensor};
fn fwd<T: num_traits::Float>(v: T, alpha: f64) -> T {
if v.is_sign_positive() {
v
} else {
... | candle/candle-core/tests/custom_op_tests.rs/0 | {
"file_path": "candle/candle-core/tests/custom_op_tests.rs",
"repo_id": "candle",
"token_count": 2102
} | 22 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use clap::{Parser, ValueEnum};
use candle::{DType, IndexOp, D};
use candle_nn::{Module, VarBuilder};
use candle_transformers::models::convnext;
#[derive(Clone, Copy, Debug, ValueEnum)]
enum Which {
At... | candle/candle-examples/examples/convnext/main.rs/0 | {
"file_path": "candle/candle-examples/examples/convnext/main.rs",
"repo_id": "candle",
"token_count": 1926
} | 23 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use clap::{Parser, ValueEnum};
use candle::{DType, IndexOp, D};
use candle_nn::{Module, VarBuilder};
use candle_transformers::models::efficientvit;
#[derive(Clone, Copy, Debug, ValueEnum)]
enum Which {
... | candle/candle-examples/examples/efficientvit/main.rs/0 | {
"file_path": "candle/candle-examples/examples/efficientvit/main.rs",
"repo_id": "candle",
"token_count": 1278
} | 24 |
#[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::gemma::{Config as Config1, Model as Model1};
use candle_transformers::models::gemma2::{Config as Config2, Model as Model... | candle/candle-examples/examples/gemma/main.rs/0 | {
"file_path": "candle/candle-examples/examples/gemma/main.rs",
"repo_id": "candle",
"token_count": 5150
} | 25 |
use std::cmp::min;
use candle::{bail, DType, Device, Result, Tensor};
use candle_transformers::models::llava::{
config::{HFPreProcessorConfig, LLaVAConfig},
utils::select_best_resolution,
};
use hf_hub::api::sync::Api;
use image::{imageops::overlay, DynamicImage, GenericImageView, Rgb, RgbImage};
use serde::{D... | candle/candle-examples/examples/llava/image_processor.rs/0 | {
"file_path": "candle/candle-examples/examples/llava/image_processor.rs",
"repo_id": "candle",
"token_count": 4904
} | 26 |
use anyhow::Result;
use candle::{Device, Tensor};
use clap::{Parser, Subcommand};
#[derive(Subcommand, Debug, Clone)]
enum Command {
Print {
#[arg(long)]
file: String,
},
SimpleEval {
#[arg(long)]
file: String,
},
}
#[derive(Parser, Debug)]
#[command(author, version, a... | candle/candle-examples/examples/onnx_basics.rs/0 | {
"file_path": "candle/candle-examples/examples/onnx_basics.rs",
"repo_id": "candle",
"token_count": 2016
} | 27 |
# candle-recurrent-gemma
This model card corresponds to the 2B base version of the RecurrentGemma model
[huggingface model card](https://huggingface.co/google/recurrentgemma-2b).
```bash
cargo run --features cuda -r --example recurrent-gemma -- \
--prompt "Write me a poem about Machine Learning."
```
| candle/candle-examples/examples/recurrent-gemma/README.md/0 | {
"file_path": "candle/candle-examples/examples/recurrent-gemma/README.md",
"repo_id": "candle",
"token_count": 101
} | 28 |
# candle-stable-lm
StableLM-3B-4E1T is a 3 billion parameter decoder-only language model
pre-trained on 1 trillion tokens of diverse English and code datasets for 4
epochs. See the [HuggingFace Hub Model
Card](https://huggingface.co/stabilityai/stablelm-3b-4e1t).
Note that this model is gated so you will have to requ... | candle/candle-examples/examples/stable-lm/README.md/0 | {
"file_path": "candle/candle-examples/examples/stable-lm/README.md",
"repo_id": "candle",
"token_count": 432
} | 29 |
# candle-whisper: speech recognition
An implementation of [OpenAI Whisper](https://github.com/openai/whisper) using
candle. Whisper is a general purpose speech recognition model, it can be used to
convert audio files (in the `.wav` format) to text. Supported features include
language detection as well as multilingual ... | candle/candle-examples/examples/whisper/README.md/0 | {
"file_path": "candle/candle-examples/examples/whisper/README.md",
"repo_id": "candle",
"token_count": 620
} | 30 |
// Build script to run nvcc and generate the C glue code for launching the flash-attention kernel.
// The cuda build time is very long so one can set the CANDLE_FLASH_ATTN_BUILD_DIR environment
// variable in order to cache the compiled artifacts and avoid recompiling too often.
use anyhow::{Context, Result};
use std::... | candle/candle-flash-attn/build.rs/0 | {
"file_path": "candle/candle-flash-attn/build.rs",
"repo_id": "candle",
"token_count": 2052
} | 31 |
/******************************************************************************
* Copyright (c) 2024, Tri Dao.
******************************************************************************/
#pragma once
#include <cmath>
#include <cute/tensor.hpp>
#include <cutlass/numeric_types.h>
#include "philox.cuh"
#include... | candle/candle-flash-attn/kernels/softmax.h/0 | {
"file_path": "candle/candle-flash-attn/kernels/softmax.h",
"repo_id": "candle",
"token_count": 4008
} | 32 |
#include<stdint.h>
#include "cuda_fp16.h"
template<typename T>
__device__ void fill_with(T *buf, T value, const size_t numel) {
for (unsigned int i = blockIdx.x * blockDim.x + threadIdx.x; i < numel; i += blockDim.x * gridDim.x) {
buf[i] = value;
}
}
extern "C" __global__ void fill_u8(uint8_t *buf, uin... | candle/candle-kernels/src/fill.cu/0 | {
"file_path": "candle/candle-kernels/src/fill.cu",
"repo_id": "candle",
"token_count": 919
} | 33 |
use crate::benchmarks::{BenchDevice, BenchDeviceHandler};
use candle::{DType, Device, Module, Tensor};
use candle_nn::{Conv2d, Conv2dConfig};
use criterion::{black_box, criterion_group, Criterion};
use std::time::Instant;
const B: usize = 1;
const C: usize = 1;
const M: usize = 128;
const K: usize = 128;
const K_SIZE:... | candle/candle-nn/benches/benchmarks/conv.rs/0 | {
"file_path": "candle/candle-nn/benches/benchmarks/conv.rs",
"repo_id": "candle",
"token_count": 808
} | 34 |
//! Linear layer
//!
//! This layer applies a linear transformation to the incoming data, `y = x@w.t() + b`.
//! The bias is optional. The `forward` method can be used to apply the layer, it supports input
//! with a batch dimension (so of shape `(b_sz, in_c)`) or without (of shape `(in_c,)`), the
//! output has shape ... | candle/candle-nn/src/linear.rs/0 | {
"file_path": "candle/candle-nn/src/linear.rs",
"repo_id": "candle",
"token_count": 1252
} | 35 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use candle::{test_utils::to_vec2_round, DType, Device, Result, Tensor};
use candle_nn::RNN;
/* The following test can be verified against PyTorch using the following snippet.
import torch
from torch import... | candle/candle-nn/tests/rnn.rs/0 | {
"file_path": "candle/candle-nn/tests/rnn.rs",
"repo_id": "candle",
"token_count": 2010
} | 36 |
# Generated content DO NOT EDIT
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Sequence
from os import PathLike
from candle.typing import _ArrayLike, Device, Scalar, Index, Shape
class bf16(DType):
pass
@staticmethod
def cat(tensors: List[Tensor], dim: int) -> Tensor:
"""
Concatenat... | candle/candle-pyo3/py_src/candle/__init__.pyi/0 | {
"file_path": "candle/candle-pyo3/py_src/candle/__init__.pyi",
"repo_id": "candle",
"token_count": 5844
} | 37 |
# Generated content DO NOT EDIT
from .. import utils
cuda_is_available = utils.cuda_is_available
get_num_threads = utils.get_num_threads
has_accelerate = utils.has_accelerate
has_mkl = utils.has_mkl
load_ggml = utils.load_ggml
load_gguf = utils.load_gguf
load_safetensors = utils.load_safetensors
save_gguf = utils.save... | candle/candle-pyo3/py_src/candle/utils/__init__.py/0 | {
"file_path": "candle/candle-pyo3/py_src/candle/utils/__init__.py",
"repo_id": "candle",
"token_count": 150
} | 38 |
import candle
from candle import Tensor
from candle.utils import cuda_is_available
from candle.testing import assert_equal
import pytest
def test_tensor_can_be_constructed():
t = Tensor(42.0)
assert t.values() == 42.0
def test_tensor_can_be_constructed_from_list():
t = Tensor([3.0, 1, 4, 1, 5, 9, 2, 6])... | candle/candle-pyo3/tests/native/test_tensor.py/0 | {
"file_path": "candle/candle-pyo3/tests/native/test_tensor.py",
"repo_id": "candle",
"token_count": 4688
} | 39 |
use candle::{DType, IndexOp, Result, Tensor, D};
use candle_nn::{LayerNorm, Linear, RmsNorm, VarBuilder};
// https://github.com/black-forest-labs/flux/blob/727e3a71faf37390f318cf9434f0939653302b60/src/flux/model.py#L12
#[derive(Debug, Clone)]
pub struct Config {
pub in_channels: usize,
pub vec_in_dim: usize,
... | candle/candle-transformers/src/models/flux/model.rs/0 | {
"file_path": "candle/candle-transformers/src/models/flux/model.rs",
"repo_id": "candle",
"token_count": 10717
} | 40 |
use crate::models::with_tracing::{linear_no_bias, Linear, RmsNorm};
/// Mistral LLM, https://github.com/mistralai/mistral-src
use candle::{DType, Device, Module, Result, Tensor, D};
use candle_nn::{Activation, VarBuilder};
use std::sync::Arc;
fn default_use_flash_attn() -> bool {
false
}
#[derive(Debug, Clone, Pa... | candle/candle-transformers/src/models/mistral.rs/0 | {
"file_path": "candle/candle-transformers/src/models/mistral.rs",
"repo_id": "candle",
"token_count": 7523
} | 41 |
//! Text encoder as used in most OpenCLIP pretrained models
//! https://github.com/mlfoundations/open_clip
use candle::{DType, IndexOp, Result, Tensor, D};
use candle_nn::{
embedding, layer_norm, linear, ops::softmax_last_dim, Embedding, LayerNorm, Linear, Module,
VarBuilder,
};
#[derive(Debug, Clone)]
pub st... | candle/candle-transformers/src/models/openclip/text_model.rs/0 | {
"file_path": "candle/candle-transformers/src/models/openclip/text_model.rs",
"repo_id": "candle",
"token_count": 3955
} | 42 |
use crate::{quantized_nn::RmsNorm, utils::repeat_kv};
use candle::{
quantized::{gguf_file, QMatMul},
DType, Device, IndexOp, Result, Tensor,
};
use candle_nn::{Embedding, Module};
use std::collections::HashMap;
#[derive(Debug, Clone)]
struct Mlp {
feed_forward_w1: QMatMul,
feed_forward_w2: QMatMul,
... | candle/candle-transformers/src/models/quantized_qwen2.rs/0 | {
"file_path": "candle/candle-transformers/src/models/quantized_qwen2.rs",
"repo_id": "candle",
"token_count": 6259
} | 43 |
pub use crate::models::with_tracing::Linear;
use candle::{Result, Tensor};
use candle_nn::{Module, VarBuilder};
pub mod image_encoder;
pub mod mask_decoder;
pub mod prompt_encoder;
pub mod sam;
pub mod tiny_vit;
pub mod transformer;
pub fn linear(vb: VarBuilder, in_dim: usize, out_dim: usize, bias: bool) -> Result<Li... | candle/candle-transformers/src/models/segment_anything/mod.rs/0 | {
"file_path": "candle/candle-transformers/src/models/segment_anything/mod.rs",
"repo_id": "candle",
"token_count": 1119
} | 44 |
use candle::{Device, Result, Tensor};
pub fn linspace(start: f64, stop: f64, steps: usize) -> Result<Tensor> {
if steps == 0 {
Tensor::from_vec(Vec::<f64>::new(), steps, &Device::Cpu)
} else if steps == 1 {
Tensor::from_vec(vec![start], steps, &Device::Cpu)
} else {
let delta = (sto... | candle/candle-transformers/src/models/stable_diffusion/utils.rs/0 | {
"file_path": "candle/candle-transformers/src/models/stable_diffusion/utils.rs",
"repo_id": "candle",
"token_count": 979
} | 45 |
use super::common::{AttnBlock, GlobalResponseNorm, LayerNormNoWeights, TimestepBlock, WLayerNorm};
use candle::{DType, Module, Result, Tensor, D};
use candle_nn::VarBuilder;
#[derive(Debug)]
pub struct ResBlockStageB {
depthwise: candle_nn::Conv2d,
norm: WLayerNorm,
channelwise_lin1: candle_nn::Linear,
... | candle/candle-transformers/src/models/wuerstchen/diffnext.rs/0 | {
"file_path": "candle/candle-transformers/src/models/wuerstchen/diffnext.rs",
"repo_id": "candle",
"token_count": 8148
} | 46 |
use candle::{DType, Device, Tensor};
use candle_nn::VarBuilder;
use candle_transformers::{
generation::LogitsProcessor,
models::{moondream, quantized_moondream},
};
use candle_wasm_example_moondream::console_log;
use js_sys::Date;
use serde::{Deserialize, Serialize};
use tokenizers::Tokenizer;
use wasm_bindgen:... | candle/candle-wasm-examples/moondream/src/bin/m.rs/0 | {
"file_path": "candle/candle-wasm-examples/moondream/src/bin/m.rs",
"repo_id": "candle",
"token_count": 4976
} | 47 |
use crate::console_log;
use crate::worker::{ModelData, Segment, Worker, WorkerInput, WorkerOutput};
use js_sys::Date;
use wasm_bindgen::prelude::*;
use wasm_bindgen_futures::JsFuture;
use yew::{html, Component, Context, Html};
use yew_agent::{Bridge, Bridged};
const SAMPLE_NAMES: [&str; 6] = [
"audios/samples_jfk.... | candle/candle-wasm-examples/whisper/src/app.rs/0 | {
"file_path": "candle/candle-wasm-examples/whisper/src/app.rs",
"repo_id": "candle",
"token_count": 5669
} | 48 |
use candle_wasm_example_yolo::coco_classes;
use candle_wasm_example_yolo::model::Bbox;
use candle_wasm_example_yolo::worker::Model as M;
use candle_wasm_example_yolo::worker::ModelPose as P;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub struct Model {
inner: M,
}
#[wasm_bindgen]
impl Model {
#[wasm_bindge... | candle/candle-wasm-examples/yolo/src/bin/m.rs/0 | {
"file_path": "candle/candle-wasm-examples/yolo/src/bin/m.rs",
"repo_id": "candle",
"token_count": 840
} | 49 |
# Use .env.local to change these variables
# DO NOT EDIT THIS FILE WITH SENSITIVE DATA
MONGODB_URL=#your mongodb URL here
MONGODB_DB_NAME=chat-ui
MONGODB_DIRECT_CONNECTION=false
COOKIE_NAME=hf-chat
TRUSTED_EMAIL_HEADER= # only set this if you understand the implications
HF_TOKEN=#hf_<token> from https://huggingface.... | chat-ui/.env/0 | {
"file_path": "chat-ui/.env",
"repo_id": "chat-ui",
"token_count": 2715
} | 50 |
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"eslint.validate": ["javascript", "svelte"]
}
| chat-ui/.vscode/settings.json/0 | {
"file_path": "chat-ui/.vscode/settings.json",
"repo_id": "chat-ui",
"token_count": 83
} | 51 |
apiVersion: v1
kind: Service
metadata:
name: "{{ include "name" . }}"
annotations: {{ toYaml .Values.service.annotations | nindent 4 }}
namespace: {{ .Release.Namespace }}
labels: {{ include "labels.standard" . | nindent 4 }}
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: http
{{... | chat-ui/chart/templates/service.yaml/0 | {
"file_path": "chat-ui/chart/templates/service.yaml",
"repo_id": "chat-ui",
"token_count": 192
} | 52 |
# OpenAI
| Feature | Available |
| --------------------------- | --------- |
| [Tools](../tools) | No |
| [Multimodal](../multimodal) | No |
Chat UI can be used with any API server that supports OpenAI API compatibility, for example [text-generation-webui](https://github.co... | chat-ui/docs/source/configuration/models/providers/openai.md/0 | {
"file_path": "chat-ui/docs/source/configuration/models/providers/openai.md",
"repo_id": "chat-ui",
"token_count": 1747
} | 53 |
{
"name": "chat-ui",
"version": "0.9.2",
"private": true,
"packageManager": "npm@9.5.0",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./ts... | chat-ui/package.json/0 | {
"file_path": "chat-ui/package.json",
"repo_id": "chat-ui",
"token_count": 2019
} | 54 |
<script lang="ts">
import CarbonContinue from "~icons/carbon/continue";
export let classNames = "";
</script>
<button
type="button"
on:click
class="btn flex h-8 rounded-lg border bg-white px-3 py-1 text-gray-500 shadow-sm transition-all hover:bg-gray-100 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-300 d... | chat-ui/src/lib/components/ContinueBtn.svelte/0 | {
"file_path": "chat-ui/src/lib/components/ContinueBtn.svelte",
"repo_id": "chat-ui",
"token_count": 149
} | 55 |
<script lang="ts">
import { fade } from "svelte/transition";
import { onDestroy } from "svelte";
import IconChevron from "./icons/IconChevron.svelte";
export let scrollNode: HTMLElement;
export { className as class };
let visible = false;
let className = "";
let observer: ResizeObserver | null = null;
$: if... | chat-ui/src/lib/components/ScrollToBottomBtn.svelte/0 | {
"file_path": "chat-ui/src/lib/components/ScrollToBottomBtn.svelte",
"repo_id": "chat-ui",
"token_count": 460
} | 56 |
<script lang="ts">
import type { Message, MessageFile } from "$lib/types/Message";
import { createEventDispatcher, onDestroy, tick } from "svelte";
import CarbonSendAltFilled from "~icons/carbon/send-alt-filled";
import CarbonExport from "~icons/carbon/export";
import CarbonStopFilledAlt from "~icons/carbon/stop-... | chat-ui/src/lib/components/chat/ChatWindow.svelte/0 | {
"file_path": "chat-ui/src/lib/components/chat/ChatWindow.svelte",
"repo_id": "chat-ui",
"token_count": 6773
} | 57 |
import type { ConversationStats } from "$lib/types/ConversationStats";
import { CONVERSATION_STATS_COLLECTION, collections } from "$lib/server/database";
import { logger } from "$lib/server/logger";
import type { ObjectId } from "mongodb";
import { acquireLock, refreshLock } from "$lib/migrations/lock";
export async f... | chat-ui/src/lib/jobs/refresh-conversation-stats.ts/0 | {
"file_path": "chat-ui/src/lib/jobs/refresh-conversation-stats.ts",
"repo_id": "chat-ui",
"token_count": 2646
} | 58 |
import { z } from "zod";
import type { EmbeddingEndpoint, Embedding } from "../embeddingEndpoints";
import { chunk } from "$lib/utils/chunk";
import { env } from "$env/dynamic/private";
import { logger } from "$lib/server/logger";
export const embeddingEndpointHfApiSchema = z.object({
weight: z.number().int().positiv... | chat-ui/src/lib/server/embeddingEndpoints/hfApi/embeddingHfApi.ts/0 | {
"file_path": "chat-ui/src/lib/server/embeddingEndpoints/hfApi/embeddingHfApi.ts",
"repo_id": "chat-ui",
"token_count": 674
} | 59 |
import { buildPrompt } from "$lib/buildPrompt";
import { z } from "zod";
import type { Endpoint } from "../endpoints";
import type { TextGenerationStreamOutput } from "@huggingface/inference";
import { logger } from "$lib/server/logger";
export const endpointLangserveParametersSchema = z.object({
weight: z.number().i... | chat-ui/src/lib/server/endpoints/langserve/endpointLangserve.ts/0 | {
"file_path": "chat-ui/src/lib/server/endpoints/langserve/endpointLangserve.ts",
"repo_id": "chat-ui",
"token_count": 1394
} | 60 |
import { env } from "$env/dynamic/private";
import type { ChatTemplateInput } from "$lib/types/Template";
import { compileTemplate } from "$lib/utils/template";
import { z } from "zod";
import endpoints, { endpointSchema, type Endpoint } from "./endpoints/endpoints";
import { endpointTgi } from "./endpoints/tgi/endpoin... | chat-ui/src/lib/server/models.ts/0 | {
"file_path": "chat-ui/src/lib/server/models.ts",
"repo_id": "chat-ui",
"token_count": 4204
} | 61 |
import type { EmbeddingBackendModel } from "$lib/server/embeddingModels";
import { getSentenceSimilarity } from "$lib/server/sentenceSimilarity";
/**
* Combines sentences together to reach the maximum character limit of the embedding model
* Improves performance considerably when using CPU embedding
*/
export async... | chat-ui/src/lib/server/websearch/embed/combine.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/embed/combine.ts",
"repo_id": "chat-ui",
"token_count": 420
} | 62 |
import { env } from "$env/dynamic/private";
import type { WebSearchSource } from "$lib/types/WebSearch";
export default async function search(query: string): Promise<WebSearchSource[]> {
const response = await fetch(
`https://www.searchapi.io/api/v1/search?engine=google&hl=en&gl=us&q=${query}`,
{
method: "GET"... | chat-ui/src/lib/server/websearch/search/endpoints/searchApi.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/search/endpoints/searchApi.ts",
"repo_id": "chat-ui",
"token_count": 274
} | 63 |
import { writable } from "svelte/store";
export interface TitleUpdate {
convId: string;
title: string;
}
export default writable<TitleUpdate | null>(null);
| chat-ui/src/lib/stores/titleUpdate.ts/0 | {
"file_path": "chat-ui/src/lib/stores/titleUpdate.ts",
"repo_id": "chat-ui",
"token_count": 50
} | 64 |
import type { ObjectId } from "bson";
import type { Timestamps } from "./Timestamps";
import type { User } from "./User";
export interface Session extends Timestamps {
_id: ObjectId;
sessionId: string;
userId: User["_id"];
userAgent?: string;
ip?: string;
expiresAt: Date;
}
| chat-ui/src/lib/types/Session.ts/0 | {
"file_path": "chat-ui/src/lib/types/Session.ts",
"repo_id": "chat-ui",
"token_count": 97
} | 65 |
import { base } from "$app/paths";
import type { Client } from "@gradio/client";
export type ApiReturnType = Awaited<ReturnType<typeof Client.prototype.view_api>>;
export async function getGradioApi(space: string) {
const api: ApiReturnType = await fetch(`${base}/api/spaces-config?space=${space}`).then(
async (res... | chat-ui/src/lib/utils/getGradioApi.ts/0 | {
"file_path": "chat-ui/src/lib/utils/getGradioApi.ts",
"repo_id": "chat-ui",
"token_count": 166
} | 66 |
/** Takes an unknown error and attempts to convert it to a string */
export function stringifyError(error: unknown): string {
if (error instanceof Error) return error.message;
if (typeof error === "string") return error;
if (typeof error === "object" && error !== null) {
// try a few common properties
if ("messa... | chat-ui/src/lib/utils/stringifyError.ts/0 | {
"file_path": "chat-ui/src/lib/utils/stringifyError.ts",
"repo_id": "chat-ui",
"token_count": 167
} | 67 |
<script lang="ts">
import { page } from "$app/stores";
</script>
<div
class="flex items-center justify-center bg-gradient-to-t from-gray-200 text-gray-800 dark:from-gray-700 dark:text-gray-300"
>
<div
class="align-center -mt-24 flex flex-col justify-center rounded-xl border bg-white px-8 pb-2 pt-4 text-center dar... | chat-ui/src/routes/+error.svelte/0 | {
"file_path": "chat-ui/src/routes/+error.svelte",
"repo_id": "chat-ui",
"token_count": 344
} | 68 |
import { base } from "$app/paths";
import { collections } from "$lib/server/database";
import { redirect } from "@sveltejs/kit";
import { ObjectId } from "mongodb";
export const load = async ({ params }) => {
try {
const assistant = await collections.assistants.findOne({
_id: new ObjectId(params.assistantId),
... | chat-ui/src/routes/assistant/[assistantId]/+page.server.ts/0 | {
"file_path": "chat-ui/src/routes/assistant/[assistantId]/+page.server.ts",
"repo_id": "chat-ui",
"token_count": 176
} | 69 |
export async function GET() {
return new Response("OK", { status: 200 });
}
| chat-ui/src/routes/healthcheck/+server.ts/0 | {
"file_path": "chat-ui/src/routes/healthcheck/+server.ts",
"repo_id": "chat-ui",
"token_count": 22
} | 70 |
<script lang="ts">
import { page } from "$app/stores";
import { base } from "$app/paths";
import { env as envPublic } from "$env/dynamic/public";
import type { BackendModel } from "$lib/server/models";
import { useSettingsStore } from "$lib/stores/settings";
import CopyToClipBoardBtn from "$lib/components/CopyToC... | chat-ui/src/routes/settings/(nav)/[...model]/+page.svelte/0 | {
"file_path": "chat-ui/src/routes/settings/(nav)/[...model]/+page.svelte",
"repo_id": "chat-ui",
"token_count": 1678
} | 71 |
<script lang="ts">
import type { PageData } from "./$types";
import { env as envPublic } from "$env/dynamic/public";
import { isHuggingChat } from "$lib/utils/isHuggingChat";
import { goto } from "$app/navigation";
import { base } from "$app/paths";
import { page } from "$app/stores";
import CarbonAdd from "~... | chat-ui/src/routes/tools/+page.svelte/0 | {
"file_path": "chat-ui/src/routes/tools/+page.svelte",
"repo_id": "chat-ui",
"token_count": 4314
} | 72 |
const defaultTheme = require("tailwindcss/defaultTheme");
const colors = require("tailwindcss/colors");
/** @type {import('tailwindcss').Config} */
export default {
darkMode: "class",
mode: "jit",
content: ["./src/**/*.{html,js,svelte,ts}"],
theme: {
extend: {
colors: {
primary: colors[process.env.PUBLIC_... | chat-ui/tailwind.config.cjs/0 | {
"file_path": "chat-ui/tailwind.config.cjs",
"repo_id": "chat-ui",
"token_count": 220
} | 73 |
import json
import os
import tempfile
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", ".json"))
@get_d... | datasets/benchmarks/benchmark_indices_mapping.py/0 | {
"file_path": "datasets/benchmarks/benchmark_indices_mapping.py",
"repo_id": "datasets",
"token_count": 677
} | 74 |
# The cache
The cache is one of the reasons why 🤗 Datasets is so efficient. It stores previously downloaded and processed datasets so when you need to use them again, they are reloaded directly from the cache. This avoids having to download a dataset all over again, or reapplying processing functions. Even after you ... | datasets/docs/source/about_cache.mdx/0 | {
"file_path": "datasets/docs/source/about_cache.mdx",
"repo_id": "datasets",
"token_count": 909
} | 75 |
# Cloud storage
🤗 Datasets supports access to cloud storage providers through a `fsspec` FileSystem implementations.
You can save and load datasets from any cloud storage in a Pythonic way.
Take a look at the following table for some example of supported cloud storage providers:
| Storage provider | Filesystem i... | datasets/docs/source/filesystems.mdx/0 | {
"file_path": "datasets/docs/source/filesystems.mdx",
"repo_id": "datasets",
"token_count": 2525
} | 76 |
# Loading methods
Methods for listing and loading datasets:
## Datasets
[[autodoc]] datasets.load_dataset
[[autodoc]] datasets.load_from_disk
[[autodoc]] datasets.load_dataset_builder
[[autodoc]] datasets.get_dataset_config_names
[[autodoc]] datasets.get_dataset_infos
[[autodoc]] datasets.get_dataset_split_name... | datasets/docs/source/package_reference/loading_methods.mdx/0 | {
"file_path": "datasets/docs/source/package_reference/loading_methods.mdx",
"repo_id": "datasets",
"token_count": 651
} | 77 |
# Use with PyTorch
This document is a quick introduction to using `datasets` with PyTorch, with a particular focus on how to get
`torch.Tensor` objects out of our datasets, and how to use a PyTorch `DataLoader` and a Hugging Face `Dataset`
with the best performance.
## Dataset format
By default, datasets return regu... | datasets/docs/source/use_with_pytorch.mdx/0 | {
"file_path": "datasets/docs/source/use_with_pytorch.mdx",
"repo_id": "datasets",
"token_count": 3446
} | 78 |
#!/usr/bin/env python
from argparse import ArgumentParser
from datasets.commands.convert import ConvertCommand
from datasets.commands.convert_to_parquet import ConvertToParquetCommand
from datasets.commands.delete_from_hub import DeleteFromHubCommand
from datasets.commands.env import EnvironmentCommand
from datasets.c... | datasets/src/datasets/commands/datasets_cli.py/0 | {
"file_path": "datasets/src/datasets/commands/datasets_cli.py",
"repo_id": "datasets",
"token_count": 480
} | 79 |
import os
import sys
import warnings
from dataclasses import dataclass, field
from io import BytesIO
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Union
import numpy as np
import pyarrow as pa
from .. import config
from ..download.download_config import DownloadConfig
from ..table import arra... | datasets/src/datasets/features/image.py/0 | {
"file_path": "datasets/src/datasets/features/image.py",
"repo_id": "datasets",
"token_count": 6979
} | 80 |
from abc import ABC, abstractmethod
from typing import Optional, Union
from .. import Dataset, DatasetDict, Features, IterableDataset, IterableDatasetDict, NamedSplit
from ..utils.typing import NestedDataStructureLike, PathLike
class AbstractDatasetReader(ABC):
def __init__(
self,
path_or_paths: ... | datasets/src/datasets/io/abc.py/0 | {
"file_path": "datasets/src/datasets/io/abc.py",
"repo_id": "datasets",
"token_count": 721
} | 81 |
from typing import List
import datasets
from ..folder_based_builder import folder_based_builder
logger = datasets.utils.logging.get_logger(__name__)
class AudioFolderConfig(folder_based_builder.FolderBasedBuilderConfig):
"""Builder Config for AudioFolder."""
drop_labels: bool = None
drop_metadata: bo... | datasets/src/datasets/packaged_modules/audiofolder/audiofolder.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/audiofolder/audiofolder.py",
"repo_id": "datasets",
"token_count": 588
} | 82 |
import itertools
from dataclasses import dataclass
from typing import List, Optional
import pyarrow as pa
import pyarrow.parquet as pq
import datasets
from datasets.table import table_cast
logger = datasets.utils.logging.get_logger(__name__)
@dataclass
class ParquetConfig(datasets.BuilderConfig):
"""BuilderCo... | datasets/src/datasets/packaged_modules/parquet/parquet.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/parquet/parquet.py",
"repo_id": "datasets",
"token_count": 2061
} | 83 |
# Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | datasets/src/datasets/utils/__init__.py/0 | {
"file_path": "datasets/src/datasets/utils/__init__.py",
"repo_id": "datasets",
"token_count": 284
} | 84 |
## Add Dummy data test
**Important** In order to pass the `load_dataset_<dataset_name>` test, dummy data is required for all possible config names.
First we distinguish between datasets scripts that
- A) have no config class and
- B) have a config class
For A) the dummy data folder structure, will always look as fol... | datasets/tests/README.md/0 | {
"file_path": "datasets/tests/README.md",
"repo_id": "datasets",
"token_count": 928
} | 85 |
import os
import random
import tempfile
import unittest
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
from absl.testing import parameterized
import datasets
from datasets.arrow_writer import ArrowWriter
from datasets.features import Array2D, Array3D, Array4D, Array5D, Value
from datasets.f... | datasets/tests/features/test_array_xd.py/0 | {
"file_path": "datasets/tests/features/test_array_xd.py",
"repo_id": "datasets",
"token_count": 9827
} | 86 |
import pytest
from datasets import Dataset, DatasetDict, Features, NamedSplit, Value
from datasets.io.text import TextDatasetReader
from ..utils import assert_arrow_memory_doesnt_increase, assert_arrow_memory_increases
def _check_text_dataset(dataset, expected_features):
assert isinstance(dataset, Dataset)
... | datasets/tests/io/test_text.py/0 | {
"file_path": "datasets/tests/io/test_text.py",
"repo_id": "datasets",
"token_count": 1833
} | 87 |
import os
import tempfile
from pathlib import Path
from unittest import TestCase
import pyarrow as pa
import pytest
from datasets.arrow_dataset import Dataset
from datasets.arrow_reader import ArrowReader, BaseReader, FileInstructions, ReadInstruction, make_file_instructions
from datasets.info import DatasetInfo
from... | datasets/tests/test_arrow_reader.py/0 | {
"file_path": "datasets/tests/test_arrow_reader.py",
"repo_id": "datasets",
"token_count": 5688
} | 88 |
from textwrap import dedent
from types import SimpleNamespace
from unittest.mock import patch
from urllib.parse import quote
import pytest
from huggingface_hub import CommitOperationAdd, CommitOperationDelete
import datasets
from datasets.config import METADATA_CONFIGS_FIELD
from datasets.hub import convert_to_parque... | datasets/tests/test_hub.py/0 | {
"file_path": "datasets/tests/test_hub.py",
"repo_id": "datasets",
"token_count": 3524
} | 89 |
import unittest
from unittest.mock import patch
import pytest
from pytest import CaptureFixture
from datasets.utils import (
are_progress_bars_disabled,
disable_progress_bars,
enable_progress_bars,
tqdm,
)
class TestTqdmUtils(unittest.TestCase):
@pytest.fixture(autouse=True)
def capsys(self,... | datasets/tests/test_tqdm.py/0 | {
"file_path": "datasets/tests/test_tqdm.py",
"repo_id": "datasets",
"token_count": 1804
} | 90 |
<jupyter_start><jupyter_text>Unit 5: An Introduction to ML-Agents In this notebook, you'll learn about ML-Agents and train two agents.- The first one will learn to **shoot snowballs onto spawning targets**.- The second need to press a button to spawn a pyramid, then navigate to the pyramid, knock it over, **and move to... | deep-rl-class/notebooks/unit5/unit5.ipynb/0 | {
"file_path": "deep-rl-class/notebooks/unit5/unit5.ipynb",
"repo_id": "deep-rl-class",
"token_count": 3901
} | 91 |
# Glossary [[glossary]]
This is a community-created glossary. Contributions are welcome!
### Agent
An agent learns to **make decisions by trial and error, with rewards and punishments from the surroundings**.
### Environment
An environment is a simulated world **where an agent can learn by interacting with it**.
... | deep-rl-class/units/en/unit1/glossary.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit1/glossary.mdx",
"repo_id": "deep-rl-class",
"token_count": 775
} | 92 |
# Mid-way Quiz [[mid-way-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 are the two main appro... | deep-rl-class/units/en/unit2/mid-way-quiz.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit2/mid-way-quiz.mdx",
"repo_id": "deep-rl-class",
"token_count": 1100
} | 93 |
# 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: We mentioned Q Learning is a tabular method.... | deep-rl-class/units/en/unit3/quiz.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit3/quiz.mdx",
"repo_id": "deep-rl-class",
"token_count": 1099
} | 94 |
# An Introduction to Unity ML-Agents [[introduction-to-ml-agents]]
<img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/thumbnail.png" alt="thumbnail"/>
One of the challenges in Reinforcement Learning is **creating environments**. Fortunately for us, we can use game... | deep-rl-class/units/en/unit5/introduction.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit5/introduction.mdx",
"repo_id": "deep-rl-class",
"token_count": 696
} | 95 |
# Designing Multi-Agents systems
For this section, you're going to watch this excellent introduction to multi-agents made by <a href="https://www.youtube.com/channel/UCq0imsn84ShAe9PBOFnoIrg"> Brian Douglas </a>.
<Youtube id="qgb0gyrpiGk" />
In this video, Brian talked about how to design multi-agent systems. He sp... | deep-rl-class/units/en/unit7/multi-agent-setting.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit7/multi-agent-setting.mdx",
"repo_id": "deep-rl-class",
"token_count": 847
} | 96 |
# Play with Huggy [[play]]
Now that you've trained Huggy and pushed it to the Hub. **You will be able to play with him ❤️**
For this step it’s simple:
- Open the Huggy game in your browser: https://huggingface.co/spaces/ThomasSimonini/Huggy
- Click on Play with my Huggy model
<img src="https://huggingface.co/datase... | deep-rl-class/units/en/unitbonus1/play.mdx/0 | {
"file_path": "deep-rl-class/units/en/unitbonus1/play.mdx",
"repo_id": "deep-rl-class",
"token_count": 271
} | 97 |
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
} | 98 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/loaders/textual_inversion.md/0 | {
"file_path": "diffusers/docs/source/en/api/loaders/textual_inversion.md",
"repo_id": "diffusers",
"token_count": 340
} | 99 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.