repo_id
stringlengths
15
89
file_path
stringlengths
27
180
content
stringlengths
1
2.23M
__index_level_0__
int64
0
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_gemm_kernel_gptq.cuh
#include "compat.cuh" __forceinline__ __device__ half2 dot22_8(half2(&dq)[4], const half* a_ptr, const half2 g_result) { half2 result = {}; const half2* a2_ptr = (const half2*)a_ptr; #pragma unroll for (int i = 0; i < 4; i++) result = __hfma2(dq[i], *a2_ptr++, result); return __hadd2(result, g_resu...
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/compat_gemm.cuh
#ifndef _compat_gemm_cuh #define _compat_gemm_cuh #if defined(USE_ROCM) // For some reason this include is not present anywhere in exllama_v2 codebase, but it is required // for symbols as hipblasHalf. #include <hipblas/hipblas.h> __host__ __forceinline__ hipblasStatus_t __compat_hipblasHgemm(hipblasHandle_t hand...
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/matrix_view.cuh
#ifndef _matrix_view_cuh #define _matrix_view_cuh #include <cuda_runtime.h> #include <cuda_fp16.h> #include "quant/qdq_util.cuh" class MatrixView_half { public: const half* data; const int height; const int width; __device__ __forceinline__ MatrixView_half(const half* data, const int height, const i...
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_matrix.cu
#include "q_matrix.cuh" #include "matrix_view.cuh" #include "util.cuh" #include "quant/qdq_2.cuh" #include "quant/qdq_3.cuh" #include "quant/qdq_4.cuh" #include "quant/qdq_5.cuh" #include "quant/qdq_6.cuh" #include "quant/qdq_8.cuh" #define BLOCK_KN_SIZE 128 #define THREADS_X 32 #define THREADS_Y 32 // Shuffle quan...
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_gemm.cu
#include "q_gemm.cuh" #include "util.cuh" #include "matrix_view.cuh" #include "../config.h" #include "quant/qdq_2.cuh" #include "quant/qdq_3.cuh" #include "quant/qdq_4.cuh" #include "quant/qdq_5.cuh" #include "quant/qdq_6.cuh" #include "quant/qdq_8.cuh" #define BLOCK_KN_SIZE 128 #define BLOCK_M_SIZE_MAX 8 #define MAX...
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_3.cuh
#ifndef _qdq_3_cuh #define _qdq_3_cuh #include "qdq_util.cuh" #include "../../config.h" #if QMODE_3BIT == 1 // Permutation: // // v9997775 55333111 u8886664 44222000 (u, v lsb) // vjjjhhhf ffdddbbb uiiiggge eecccaaa // vtttrrrp ppnnnlll usssqqqo oommmkkk __forceinline__ __device__ void shuffle_3bit_32 ( uin...
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_2.cuh
#ifndef _qdq_2_cuh #define _qdq_2_cuh #include "qdq_util.cuh" #include "../../config.h" #if QMODE_2BIT == 1 // Permutation: // // ffddbb99 77553311 eeccaa88 66442200 __forceinline__ __device__ void shuffle_2bit_16 ( uint32_t* q, int stride ) { uint32_t qa = q[0]; uint32_t qb = 0; #pragma unrol...
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_5.cuh
#ifndef _qdq_5_cuh #define _qdq_5_cuh #include "qdq_util.cuh" #include "../../config.h" #if QMODE_5BIT == 1 // Permutation: // // v5555533 33311111 u4444422 22200000 (u, v lsb) // vbbbbb99 99977777 uaaaaa88 88866666 // vhhhhhff fffddddd ugggggee eeeccccc // vnnnnnll llljjjjj ummmmmkk kkkiiiii // vtttttrr rrrppp...
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_4.cuh
#ifndef _qdq_4_cuh #define _qdq_4_cuh #include "qdq_util.cuh" #include "../../config.h" #if QMODE_4BIT == 1 // Permutation: // // 77775555 33331111 66664444 22220000 __forceinline__ __device__ void shuffle_4bit_8 ( uint32_t* q, int stride ) { uint32_t qa = q[0]; uint32_t qb = 0; #pragma unroll...
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_6.cuh
#ifndef _qdq_6_cuh #define _qdq_6_cuh #include "qdq_util.cuh" #include "../../config.h" #if QMODE_6BIT == 1 // Not implemented #else __forceinline__ __device__ void shuffle_6bit_16 ( uint32_t* q, int stride ) { } __forceinline__ __device__ void dequant_6bit_16 ( const uint32_t q_0, const uint32_...
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_util.cuh
#ifndef _qdq_util_cuh #define _qdq_util_cuh union half2_uint32 { uint32_t as_uint32; half2 as_half2; __device__ half2_uint32(uint32_t val) : as_uint32(val) {} __device__ half2_uint32(half2 val) : as_half2(val) {} }; union half_uint16 { uint16_t as_uint16; half as_half; __device__ half_uint...
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_8.cuh
#ifndef _qdq_8_cuh #define _qdq_8_cuh #include "qdq_util.cuh" #include "../../config.h" #if QMODE_8BIT == 1 // Not implemented #else __forceinline__ __device__ void shuffle_8bit_4 ( uint32_t* q, int stride ) { } __forceinline__ __device__ void dequant_8bit_8 ( const uint32_t q_0, const uint32_t ...
0
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels
hf_public_repos/text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cpp/util.h
#ifndef _util_h #define _util_h #define DBGS(__x) printf("%s\n", __x) #define DBGI(__x) printf("%s: %i\n", #__x, __x) #define DBGI2(__x, __y) printf("%s, %s: %i, %i\n", #__x, #__y, __x, __y) #define DBGI3(__x, __y, __z) printf("%s, %s, %s: %i, %i, %i\n", #__x, #__y, #__z, __x, __y, __z) #define DBGF(__x) printf("%s: %...
0
hf_public_repos/text-generation-inference
hf_public_repos/text-generation-inference/docs/index.html
<html> <head> <!-- Load the latest Swagger UI code and style from npm using unpkg.com --> <script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"></script> <link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@3/swagger-ui.css"/> <title>Text Ge...
0
hf_public_repos/text-generation-inference
hf_public_repos/text-generation-inference/docs/openapi.json
{ "openapi": "3.0.3", "info": { "title": "Text Generation Inference", "description": "Text Generation Webserver", "contact": { "name": "Olivier Dehaene" }, "license": { "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0" }, "version": "1.2.0" },...
0
hf_public_repos/text-generation-inference/docs
hf_public_repos/text-generation-inference/docs/source/quicktour.md
# Quick Tour The easiest way of getting started is using the official Docker container. Install Docker following [their installation instructions](https://docs.docker.com/get-docker/). Let's say you want to deploy [Falcon-7B Instruct](https://huggingface.co/tiiuae/falcon-7b-instruct) model with TGI. Here is an exampl...
0
hf_public_repos/text-generation-inference/docs
hf_public_repos/text-generation-inference/docs/source/_toctree.yml
- sections: - local: index title: Text Generation Inference - local: quicktour title: Quick Tour - local: installation title: Installation - local: supported_models title: Supported Models and Hardware title: Getting started - sections: - local: basic_tutorials/consuming_tgi title: Consu...
0
hf_public_repos/text-generation-inference/docs
hf_public_repos/text-generation-inference/docs/source/index.md
# Text Generation Inference Text Generation Inference (TGI) is a toolkit for deploying and serving Large Language Models (LLMs). TGI enables high-performance text generation for the most popular open-source LLMs, including Llama, Falcon, StarCoder, BLOOM, GPT-NeoX, and T5. ![Text Generation Inference](https://hugging...
0
hf_public_repos/text-generation-inference/docs
hf_public_repos/text-generation-inference/docs/source/supported_models.md
# Supported Models and Hardware Text Generation Inference enables serving optimized models on specific hardware for the highest performance. The following sections list which models are hardware are supported. ## Supported Models The following models are optimized and can be served with TGI, which uses custom CUDA k...
0
hf_public_repos/text-generation-inference/docs
hf_public_repos/text-generation-inference/docs/source/installation.md
# Installation This section explains how to install the CLI tool as well as installing TGI from source. **The strongly recommended approach is to use Docker, as it does not require much setup. Check [the Quick Tour](./quicktour) to learn how to run TGI with Docker.** ## Install CLI You can use TGI command-line inter...
0
hf_public_repos/text-generation-inference/docs/source
hf_public_repos/text-generation-inference/docs/source/basic_tutorials/launcher.md
# Text-generation-launcher arguments <!-- WRAP CODE BLOCKS --> ```shell Text Generation Launcher Usage: text-generation-launcher [OPTIONS] Options: ``` ## MODEL_ID ```shell --model-id <MODEL_ID> The name of the model to load. Can be a MODEL_ID as listed on <https://hf.co/models> like `gpt2` or `Open...
0
hf_public_repos/text-generation-inference/docs/source
hf_public_repos/text-generation-inference/docs/source/basic_tutorials/consuming_tgi.md
# Consuming Text Generation Inference There are many ways you can consume Text Generation Inference server in your applications. After launching, you can use the `/generate` route and make a `POST` request to get results from the server. You can also use the `/generate_stream` route if you want TGI to return a stream ...
0
hf_public_repos/text-generation-inference/docs/source
hf_public_repos/text-generation-inference/docs/source/basic_tutorials/non_core_models.md
# Non-core Model Serving TGI supports various LLM architectures (see full list [here](../supported_models)). If you wish to serve a model that is not one of the supported models, TGI will fallback to the `transformers` implementation of that model. This means you will be unable to use some of the features introduced b...
0
hf_public_repos/text-generation-inference/docs/source
hf_public_repos/text-generation-inference/docs/source/basic_tutorials/using_cli.md
# Using TGI CLI You can use TGI command-line interface (CLI) to download weights, serve and quantize models, or get information on serving parameters. To install the CLI, please refer to [the installation section](./installation#install-cli). `text-generation-server` lets you download the model with `download-weights...
0
hf_public_repos/text-generation-inference/docs/source
hf_public_repos/text-generation-inference/docs/source/basic_tutorials/preparing_model.md
# Preparing the Model Text Generation Inference improves the model in several aspects. ## Quantization TGI supports [bits-and-bytes](https://github.com/TimDettmers/bitsandbytes#bitsandbytes), [GPT-Q](https://arxiv.org/abs/2210.17323) and [AWQ](https://arxiv.org/abs/2306.00978) quantization. To speed up inference wi...
0
hf_public_repos/text-generation-inference/docs/source
hf_public_repos/text-generation-inference/docs/source/basic_tutorials/gated_model_access.md
# Serving Private & Gated Models If the model you wish to serve is behind gated access or the model repository on Hugging Face Hub is private, and you have access to the model, you can provide your Hugging Face Hub access token. You can generate and copy a read token from [Hugging Face Hub tokens page](https://hugging...
0
hf_public_repos/text-generation-inference/docs/source
hf_public_repos/text-generation-inference/docs/source/conceptual/paged_attention.md
# PagedAttention LLMs struggle with memory limitations during generation. In the decoding part of generation, all the attention keys and values generated for previous tokens are stored in GPU memory for reuse. This is called _KV cache_, and it may take up a large amount of memory for large models and long sequences. ...
0
hf_public_repos/text-generation-inference/docs/source
hf_public_repos/text-generation-inference/docs/source/conceptual/flash_attention.md
# Flash Attention Scaling the transformer architecture is heavily bottlenecked by the self-attention mechanism, which has quadratic time and memory complexity. Recent developments in accelerator hardware mainly focus on enhancing compute capacities and not memory and transferring data between hardware. This results in...
0
hf_public_repos/text-generation-inference/docs/source
hf_public_repos/text-generation-inference/docs/source/conceptual/safetensors.md
# Safetensors Safetensors is a model serialization format for deep learning models. It is [faster](https://huggingface.co/docs/safetensors/speed) and safer compared to other serialization formats like pickle (which is used under the hood in many deep learning libraries). TGI depends on safetensors format mainly to e...
0
hf_public_repos/text-generation-inference/docs/source
hf_public_repos/text-generation-inference/docs/source/conceptual/streaming.md
# Streaming ## What is Streaming? Token streaming is the mode in which the server returns the tokens one by one as the model generates them. This enables showing progressive generations to the user rather than waiting for the whole generation. Streaming is an essential aspect of the end-user experience as it reduces ...
0
hf_public_repos/text-generation-inference/docs/source
hf_public_repos/text-generation-inference/docs/source/conceptual/tensor_parallelism.md
# Tensor Parallelism Tensor parallelism is a technique used to fit a large model in multiple GPUs. For example, when multiplying the input tensors with the first weight tensor, the matrix multiplication is equivalent to splitting the weight tensor column-wise, multiplying each column with the input separately, and the...
0
hf_public_repos/text-generation-inference/docs/source
hf_public_repos/text-generation-inference/docs/source/conceptual/quantization.md
# Quantization TGI offers GPTQ and bits-and-bytes quantization to quantize large language models. ## Quantization with GPTQ GPTQ is a post-training quantization method to make the model smaller. It quantizes the layers by finding a compressed version of that weight, that will yield a minimum mean squared error like ...
0
hf_public_repos/text-generation-inference
hf_public_repos/text-generation-inference/load_tests/starcoder_load.js
import {check} from 'k6'; import http from 'k6/http'; import {Trend} from 'k6/metrics'; const host = __ENV.HOST || '127.0.0.1:3000'; const totalTime = new Trend('total_time', true); const validationTime = new Trend('validation_time', true); const queueTime = new Trend('queue_time', true); const inferenceTime = new Tr...
0
hf_public_repos/text-generation-inference
hf_public_repos/text-generation-inference/load_tests/vllm.js
import { get_options, run } from "./common.js"; const reference_latency_ms = 22; const host = __ENV.HOST || '127.0.0.1:8000'; const max_new_tokens = 50; function generate_payload(gpt){ const input = gpt["conversations"][0]["value"]; return {"prompt": input, "temperature": 0.5, "ignore_eos": true} } export ...
0
hf_public_repos/text-generation-inference
hf_public_repos/text-generation-inference/load_tests/common.js
import { check, randomSeed } from 'k6'; import http from 'k6/http'; import { Trend, Counter } from 'k6/metrics'; import { randomItem } from 'https://jslib.k6.io/k6-utils/1.2.0/index.js'; const seed = 0; const host = __ENV.HOST || '127.0.0.1:8000'; const timePerToken = new Trend('time_per_token', true); const throughp...
0
hf_public_repos/text-generation-inference
hf_public_repos/text-generation-inference/load_tests/tgi.js
import { get_options, run } from "./common.js"; const reference_latency_ms = 30; const host = __ENV.HOST || '127.0.0.1:8000'; const max_new_tokens = 50; function generate_payload(gpt){ const input = gpt["conversations"][0]["value"]; return {"inputs": input, "parameters": {"max_new_tokens": max_new_tokens, "...
0
hf_public_repos/text-generation-inference
hf_public_repos/text-generation-inference/router/Cargo.toml
[package] name = "text-generation-router" description = "Text Generation Webserver" build = "build.rs" version.workspace = true edition.workspace = true authors.workspace = true homepage.workspace = true [lib] path = "src/lib.rs" [[bin]] name = "text-generation-router" path = "src/main.rs" [dependencies] async-strea...
0
hf_public_repos/text-generation-inference
hf_public_repos/text-generation-inference/router/build.rs
use std::error::Error; use vergen::EmitBuilder; fn main() -> Result<(), Box<dyn Error>> { // Try to get the git sha from the local git repository if EmitBuilder::builder() .fail_on_error() .git_sha(false) .emit() .is_err() { // Unable to get the git sha if le...
0
hf_public_repos/text-generation-inference
hf_public_repos/text-generation-inference/router/README.md
# Router Also named `webserver` throughout the docs. This router is handling most of the logic to handle the "batches" tell when to pass new `prefill` requests and pausing `decode` requests, which ones etc... It uses gRPC to communicate with the shards which can therefore be kept much simpler and focus on having the...
0
hf_public_repos/text-generation-inference/router
hf_public_repos/text-generation-inference/router/grpc-metadata/Cargo.toml
[package] name = "grpc-metadata" version = "0.1.0" edition = "2021" [dependencies] opentelemetry = "^0.20" tonic = "^0.10" tracing = "^0.1" tracing-opentelemetry = "^0.21"
0
hf_public_repos/text-generation-inference/router/grpc-metadata
hf_public_repos/text-generation-inference/router/grpc-metadata/src/lib.rs
//! A crate to extract and inject a OpenTelemetry context from and to a gRPC request. //! Inspired by: https://github.com/open-telemetry/opentelemetry-rust gRPC examples use opentelemetry::global; use opentelemetry::propagation::{Extractor, Injector}; use tracing_opentelemetry::OpenTelemetrySpanExt; /// Extract conte...
0
hf_public_repos/text-generation-inference/router
hf_public_repos/text-generation-inference/router/client/Cargo.toml
[package] name = "text-generation-client" version.workspace = true edition.workspace = true authors.workspace = true homepage.workspace = true [dependencies] futures = "^0.3" grpc-metadata = { path = "../grpc-metadata" } prost = "^0.12" thiserror = "^1.0" tokio = { version = "^1.32", features = ["sync"] } tonic = "^0....
0
hf_public_repos/text-generation-inference/router
hf_public_repos/text-generation-inference/router/client/build.rs
use std::fs; fn main() -> Result<(), Box<dyn std::error::Error>> { println!("cargo:rerun-if-changed=../../proto/generate.proto"); fs::create_dir("src/pb").unwrap_or(()); let mut config = prost_build::Config::new(); config.protoc_arg("--experimental_allow_proto3_optional"); tonic_build::configure(...
0
hf_public_repos/text-generation-inference/router/client
hf_public_repos/text-generation-inference/router/client/src/client.rs
/// Single shard Client use crate::pb::generate::v1::text_generation_service_client::TextGenerationServiceClient; use crate::pb::generate::v1::*; use crate::Result; use grpc_metadata::InjectTelemetryContext; use std::cmp::min; use tonic::transport::{Channel, Uri}; use tracing::instrument; /// Text Generation Inference...
0
hf_public_repos/text-generation-inference/router/client
hf_public_repos/text-generation-inference/router/client/src/lib.rs
//! Text Generation gRPC client library mod client; #[allow(clippy::derive_partial_eq_without_eq)] mod pb; mod sharded_client; pub use client::Client; pub use pb::generate::v1::HealthResponse; pub use pb::generate::v1::InfoResponse as ShardInfo; pub use pb::generate::v1::{ Batch, CachedBatch, FinishReason, Genera...
0
hf_public_repos/text-generation-inference/router/client
hf_public_repos/text-generation-inference/router/client/src/sharded_client.rs
/// Multi shard Client use crate::{Batch, CachedBatch, Client, Generation, HealthResponse, ShardInfo}; use crate::{ClientError, Result}; use futures::future::join_all; use tonic::transport::Uri; use tracing::instrument; #[derive(Debug, Clone)] /// Text Generation Inference gRPC multi client pub struct ShardedClient { ...
0
hf_public_repos/text-generation-inference/router
hf_public_repos/text-generation-inference/router/src/health.rs
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use text_generation_client::{ Batch, NextTokenChooserParameters, Request, ShardedClient, StoppingCriteriaParameters, }; // Note: Request ids and batch ids cannot collide. const LIVENESS_ID: u64 = u64::MAX; const BATCH_ID: u64 = u64::MAX; #[derive(...
0
hf_public_repos/text-generation-inference/router
hf_public_repos/text-generation-inference/router/src/lib.rs
mod health; /// Text Generation Inference Webserver mod infer; mod queue; pub mod server; mod validation; use infer::Infer; use queue::{Entry, Queue}; use serde::{Deserialize, Serialize}; use utoipa::ToSchema; use validation::Validation; /// Hub type #[derive(Clone, Debug, Deserialize)] pub struct HubModelInfo { ...
0
hf_public_repos/text-generation-inference/router
hf_public_repos/text-generation-inference/router/src/queue.rs
use crate::infer::InferError; use crate::infer::InferStreamResponse; use crate::validation::ValidGenerateRequest; use nohash_hasher::{BuildNoHashHasher, IntMap}; use std::cmp::min; use std::collections::VecDeque; use text_generation_client::{Batch, Request}; use tokio::sync::{mpsc, oneshot}; use tokio::time::Instant; u...
0
hf_public_repos/text-generation-inference/router
hf_public_repos/text-generation-inference/router/src/server.rs
/// HTTP Server logic use crate::health::Health; use crate::infer::{InferError, InferResponse, InferStreamResponse}; use crate::validation::ValidationError; use crate::{ BestOfSequence, CompatGenerateRequest, Details, ErrorResponse, FinishReason, GenerateParameters, GenerateRequest, GenerateResponse, HubModelIn...
0
hf_public_repos/text-generation-inference/router
hf_public_repos/text-generation-inference/router/src/validation.rs
/// Payload validation logic use crate::validation::ValidationError::{BestOfSampling, BestOfSeed, EmptyInput}; use crate::{GenerateParameters, GenerateRequest}; use rand::{thread_rng, Rng}; use text_generation_client::{NextTokenChooserParameters, StoppingCriteriaParameters}; use thiserror::Error; use tokenizers::tokeni...
0
hf_public_repos/text-generation-inference/router
hf_public_repos/text-generation-inference/router/src/main.rs
/// Text Generation Inference webserver entrypoint use axum::http::HeaderValue; use clap::Parser; use opentelemetry::sdk::propagation::TraceContextPropagator; use opentelemetry::sdk::trace; use opentelemetry::sdk::trace::Sampler; use opentelemetry::sdk::Resource; use opentelemetry::{global, KeyValue}; use opentelemetry...
0
hf_public_repos/text-generation-inference/router
hf_public_repos/text-generation-inference/router/src/infer.rs
/// Batching and inference logic use crate::validation::{Validation, ValidationError}; use crate::{Entry, Queue, Token}; use crate::{GenerateRequest, PrefillToken}; use futures::future::try_join_all; use nohash_hasher::IntMap; use std::sync::{ atomic::{AtomicBool, Ordering}, Arc, }; use text_generation_client::...
0
hf_public_repos
hf_public_repos/transformers/CODE_OF_CONDUCT.md
# Contributor Covenant Code of Conduct ## Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level o...
0
hf_public_repos
hf_public_repos/transformers/conftest.py
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
0
hf_public_repos
hf_public_repos/transformers/README_hd.md
<!--- Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
0
hf_public_repos
hf_public_repos/transformers/README_ja.md
<!--- Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
0
hf_public_repos
hf_public_repos/transformers/LICENSE
Copyright 2018- The Hugging Face team. All rights reserved. Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" ...
0
hf_public_repos
hf_public_repos/transformers/Makefile
.PHONY: deps_table_update modified_only_fixup extra_style_checks quality style fixup fix-copies test test-examples # make sure to test the local checkout in scripts and not the pre-installed one (don't use quotes!) export PYTHONPATH = src check_dirs := examples tests src utils modified_only_fixup: $(eval modified_p...
0
hf_public_repos
hf_public_repos/transformers/README_pt-br.md
<!--- 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 ...
0
hf_public_repos
hf_public_repos/transformers/CITATION.cff
cff-version: "1.2.0" date-released: 2020-10 message: "If you use this software, please cite it using these metadata." title: "Transformers: State-of-the-Art Natural Language Processing" url: "https://github.com/huggingface/transformers" authors: - family-names: Wolf given-names: Thomas - family-names: Debut ...
0
hf_public_repos
hf_public_repos/transformers/README_ru.md
<!--- 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 ...
0
hf_public_repos
hf_public_repos/transformers/pyproject.toml
[tool.ruff] # Never enforce `E501` (line length violations). ignore = ["C901", "E501", "E741", "F402", "F823" ] select = ["C", "E", "F", "I", "W"] line-length = 119 # Ignore import violations in all `__init__.py` files. [tool.ruff.per-file-ignores] "__init__.py" = ["E402", "F401", "F403", "F811"] "src/transformers/fil...
0
hf_public_repos
hf_public_repos/transformers/README_zh-hant.md
<!--- Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
0
hf_public_repos
hf_public_repos/transformers/.coveragerc
[run] source=transformers omit = # skip convertion scripts from testing for now */convert_* */__main__.py [report] exclude_lines = pragma: no cover raise except register_parameter
0
hf_public_repos
hf_public_repos/transformers/README_ko.md
<!--- Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
0
hf_public_repos
hf_public_repos/transformers/README.md
<!--- Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
0
hf_public_repos
hf_public_repos/transformers/README_es.md
<!--- Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
0
hf_public_repos
hf_public_repos/transformers/setup.py
# 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 applicabl...
0
hf_public_repos
hf_public_repos/transformers/README_zh-hans.md
<!--- Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
0
hf_public_repos
hf_public_repos/transformers/CONTRIBUTING.md
<!--- Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
0
hf_public_repos
hf_public_repos/transformers/ISSUES.md
<!--- Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
0
hf_public_repos
hf_public_repos/transformers/awesome-transformers.md
# Awesome projects built with Transformers This page lists awesome projects built on top of Transformers. Transformers is more than a toolkit to use pretrained models: it's a community of projects built around it and the Hugging Face Hub. We want Transformers to enable developers, researchers, students, professors, en...
0
hf_public_repos
hf_public_repos/transformers/hubconf.py
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
0
hf_public_repos
hf_public_repos/transformers/README_te.md
<!--- Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
0
hf_public_repos
hf_public_repos/transformers/SECURITY.md
# Security Policy ## Reporting a Vulnerability 🤗 We have our bug bounty program set up with HackerOne. Please feel free to submit vulnerability reports to our private program at https://hackerone.com/hugging_face. Note that you'll need to be invited to our program, so send us a quick email at security@huggingface.co...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-doc-builder/Dockerfile
FROM python:3.8 LABEL maintainer="Hugging Face" RUN apt update RUN git clone https://github.com/huggingface/transformers RUN python3 -m pip install --no-cache-dir --upgrade pip && python3 -m pip install --no-cache-dir git+https://github.com/huggingface/doc-builder ./transformers[dev] RUN apt-get -y update && apt-get ...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-cpu/Dockerfile
FROM ubuntu:18.04 LABEL maintainer="Hugging Face" LABEL repository="transformers" RUN apt update && \ apt install -y bash \ build-essential \ git \ curl \ ca-certificates \ python3 \ python3-pip && \ ...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-gpu/Dockerfile
FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04 LABEL maintainer="Hugging Face" LABEL repository="transformers" RUN apt update && \ apt install -y bash \ build-essential \ git \ curl \ ca-certificates \ python3 \ ...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-all-latest-gpu/Dockerfile
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive # Use login shell to read variables from `~/.profile` (to pass dynamic created variables between RUN commands) SHELL ["sh", "-lc"] # The following `ARG` are mainly used to specify the versions explicit...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-pytorch-tpu/Dockerfile
FROM google/cloud-sdk:slim # Build args. ARG GITHUB_REF=refs/heads/main # TODO: This Dockerfile installs pytorch/xla 3.6 wheels. There are also 3.7 # wheels available; see below. ENV PYTHON_VERSION=3.6 RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cmake \ ...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-pytorch-tpu/bert-base-cased.jsonnet
local base = import 'templates/base.libsonnet'; local tpus = import 'templates/tpus.libsonnet'; local utils = import "templates/utils.libsonnet"; local volumes = import "templates/volumes.libsonnet"; local bertBaseCased = base.BaseTest { frameworkPrefix: "hf", modelName: "bert-base-cased", mode: "example", con...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-pytorch-tpu/docker-entrypoint.sh
#!/bin/bash source ~/.bashrc echo "running docker-entrypoint.sh" conda activate container echo $KUBE_GOOGLE_CLOUD_TPU_ENDPOINTS echo "printed TPU info" export XRT_TPU_CONFIG="tpu_worker;0;${KUBE_GOOGLE_CLOUD_TPU_ENDPOINTS:7}" exec "$@"#!/bin/bash
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-pytorch-tpu/dataset.yaml
apiVersion: v1 kind: PersistentVolume metadata: name: huggingface-cluster-disk spec: storageClassName: "" capacity: storage: 500Gi accessModes: - ReadOnlyMany claimRef: namespace: default name: huggingface-cluster-disk-claim gcePersistentDisk: pdName: huggingface-cluster-disk fsType:...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-past-gpu/Dockerfile
ARG BASE_DOCKER_IMAGE FROM $BASE_DOCKER_IMAGE LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive # Use login shell to read variables from `~/.profile` (to pass dynamic created variables between RUN commands) SHELL ["sh", "-lc"] RUN apt update RUN apt install -y git libsndfile1-dev tesseract-ocr espea...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-pytorch-amd-gpu/Dockerfile
FROM rocm/dev-ubuntu-20.04:5.6 # rocm/pytorch has no version with 2.1.0 LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive ARG PYTORCH='2.1.0' ARG TORCH_VISION='0.16.0' ARG TORCH_AUDIO='2.1.0' ARG ROCM='5.6' RUN apt update && \ apt install -y --no-install-recommends git libsndfile1-dev tesseract-...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-pytorch-deepspeed-latest-gpu/Dockerfile
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-23-11.html#rel-23-11 FROM nvcr.io/nvidia/pytorch:23.11-py3 LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive ARG PYTORCH='2.1.0' # Example: `cu102`, `cu113`, etc. ARG CUDA='cu121' RUN apt -y update RUN apt install -y libaio-...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-tensorflow-cpu/Dockerfile
FROM ubuntu:18.04 LABEL maintainer="Hugging Face" LABEL repository="transformers" RUN apt update && \ apt install -y bash \ build-essential \ git \ curl \ ca-certificates \ python3 \ python3-pip && \ ...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-tensorflow-gpu/Dockerfile
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive RUN apt update RUN apt install -y git libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg RUN python3 -m pip install --no-cache-dir --upgrade pip ARG REF=main RUN git clone https://githu...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-pytorch-deepspeed-nightly-gpu/Dockerfile
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-23-11.html#rel-23-11 FROM nvcr.io/nvidia/pytorch:23.11-py3 LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive # Example: `cu102`, `cu113`, etc. ARG CUDA='cu121' RUN apt -y update RUN apt install -y libaio-dev RUN python3 -m p...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-pytorch-cpu/Dockerfile
FROM ubuntu:18.04 LABEL maintainer="Hugging Face" LABEL repository="transformers" RUN apt update && \ apt install -y bash \ build-essential \ git \ curl \ ca-certificates \ python3 \ python3-pip && \ ...
0
hf_public_repos/transformers/docker
hf_public_repos/transformers/docker/transformers-pytorch-gpu/Dockerfile
FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu20.04 LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive RUN apt update RUN apt install -y git libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg RUN python3 -m pip install --no-cache-dir --upgrade pip ARG REF=main RUN git clone https://githu...
0
hf_public_repos/transformers
hf_public_repos/transformers/tests/test_tokenization_common.py
# coding=utf-8 # Copyright 2019 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
0
hf_public_repos/transformers
hf_public_repos/transformers/tests/test_modeling_common.py
# coding=utf-8 # Copyright 2019 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
0
hf_public_repos/transformers
hf_public_repos/transformers/tests/test_configuration_common.py
# coding=utf-8 # Copyright 2019 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
0
hf_public_repos/transformers
hf_public_repos/transformers/tests/test_backbone_common.py
# coding=utf-8 # Copyright 2023 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...
0
hf_public_repos/transformers
hf_public_repos/transformers/tests/test_image_processing_common.py
# coding=utf-8 # Copyright 2023 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
0
hf_public_repos/transformers
hf_public_repos/transformers/tests/test_configuration_utils.py
# coding=utf-8 # Copyright 2019 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
0
hf_public_repos/transformers
hf_public_repos/transformers/tests/test_feature_extraction_common.py
# coding=utf-8 # Copyright 2021 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
0
hf_public_repos/transformers
hf_public_repos/transformers/tests/test_modeling_flax_utils.py
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
0