text stringlengths 5 409k | id stringlengths 14 178 | metadata dict | __index_level_0__ int64 0 572 |
|---|---|---|---|
<!--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... | smolagents/docs/source/zh/tutorials/building_good_agents.mdx/0 | {
"file_path": "smolagents/docs/source/zh/tutorials/building_good_agents.mdx",
"repo_id": "smolagents",
"token_count": 6726
} | 210 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... | smolagents/src/smolagents/agents.py/0 | {
"file_path": "smolagents/src/smolagents/agents.py",
"repo_id": "smolagents",
"token_count": 25012
} | 211 |
from unittest.mock import patch
import pytest
from smolagents.agents import MultiStepAgent
from smolagents.monitoring import LogLevel
original_multi_step_agent_init = MultiStepAgent.__init__
@pytest.fixture(autouse=True)
def patch_multi_step_agent_with_suppressed_logging():
with patch.object(MultiStepAgent, "... | smolagents/tests/conftest.py/0 | {
"file_path": "smolagents/tests/conftest.py",
"repo_id": "smolagents",
"token_count": 230
} | 212 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | smolagents/tests/test_tools.py/0 | {
"file_path": "smolagents/tests/test_tools.py",
"repo_id": "smolagents",
"token_count": 8483
} | 213 |
ARG cuda_arch_list="75-real;80-real;86-real;89-real;90-real;100-real;120-real"
ARG cuda_base=12.8.0
ARG build_type=release
ARG ompi_version=4.1.7
ARG sccache_gha_enabled=off
ARG actions_cache_url=""
ARG actions_runtime_token=""
# CUDA dependent dependencies resolver stage
FROM nvidia/cuda:${cuda_base}-cudnn-devel-ubu... | text-generation-inference/Dockerfile_trtllm/0 | {
"file_path": "text-generation-inference/Dockerfile_trtllm",
"repo_id": "text-generation-inference",
"token_count": 2414
} | 214 |
import sys
from typing import Optional
import typer
from loguru import logger
app = typer.Typer()
@app.command()
def serve(
model_id: str,
revision: Optional[str] = None,
sharded: bool = False,
trust_remote_code: bool = None,
uds_path: str = "/tmp/text-generation-server",
logger_level: str ... | text-generation-inference/backends/neuron/server/text_generation_server/cli.py/0 | {
"file_path": "text-generation-inference/backends/neuron/server/text_generation_server/cli.py",
"repo_id": "text-generation-inference",
"token_count": 1437
} | 215 |
#!/bin/bash
set -e -o pipefail -u
export ENV_FILEPATH=$(mktemp)
trap "rm -f ${ENV_FILEPATH}" EXIT
touch $ENV_FILEPATH
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
${SCRIPT_DIR}/tgi_env.py $@
source $ENV_FILEPATH
exec text-generation-launcher $@
| text-generation-inference/backends/neuron/tgi-entrypoint.sh/0 | {
"file_path": "text-generation-inference/backends/neuron/tgi-entrypoint.sh",
"repo_id": "text-generation-inference",
"token_count": 128
} | 216 |
use std::path::PathBuf;
use thiserror::Error;
use text_generation_router::server;
#[derive(Debug, Error)]
pub enum TensorRtLlmBackendError {
#[error("Provided engine folder {0} doesn't exist")]
EngineFolderDoesntExists(PathBuf),
#[error("Provided executorWorker binary path {0} doesn't exist")]
Executo... | text-generation-inference/backends/trtllm/src/errors.rs/0 | {
"file_path": "text-generation-inference/backends/trtllm/src/errors.rs",
"repo_id": "text-generation-inference",
"token_count": 285
} | 217 |
use std::time::{Duration, Instant};
use text_generation_client::v3::{
Batch, CachedBatch, NextTokenChooserParameters, Request, ShardedClient,
StoppingCriteriaParameters,
};
use text_generation_client::{Chunk, ClientError, Input};
use tokenizers::{Tokenizer, TruncationDirection};
use tokio::sync::{broadcast, mps... | text-generation-inference/benchmark/src/generation.rs/0 | {
"file_path": "text-generation-inference/benchmark/src/generation.rs",
"repo_id": "text-generation-inference",
"token_count": 3420
} | 218 |
import json
import requests
import warnings
from aiohttp import ClientSession, ClientTimeout
from pydantic import ValidationError
from typing import Dict, Optional, List, AsyncIterator, Iterator, Union
from text_generation import DEPRECATION_WARNING
from text_generation.types import (
StreamResponse,
Response... | text-generation-inference/clients/python/text_generation/client.py/0 | {
"file_path": "text-generation-inference/clients/python/text_generation/client.py",
"repo_id": "text-generation-inference",
"token_count": 19243
} | 219 |
# 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... | text-generation-inference/docs/source/basic_tutorials/non_core_models.md/0 | {
"file_path": "text-generation-inference/docs/source/basic_tutorials/non_core_models.md",
"repo_id": "text-generation-inference",
"token_count": 472
} | 220 |
# 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... | text-generation-inference/docs/source/conceptual/streaming.md/0 | {
"file_path": "text-generation-inference/docs/source/conceptual/streaming.md",
"repo_id": "text-generation-inference",
"token_count": 1890
} | 221 |
# Collection of Usage Statistics
Text Generation Inference collects anonymous usage statistics to help us improve the service. The collected data is used to improve TGI and to understand what causes failures. The data is collected transparently and any sensitive information is omitted.
Usage statistics are collected... | text-generation-inference/docs/source/usage_statistics.md/0 | {
"file_path": "text-generation-inference/docs/source/usage_statistics.md",
"repo_id": "text-generation-inference",
"token_count": 966
} | 222 |
[
{
"choices": [
{
"finish_reason": "",
"index": 0,
"logprobs": null,
"text": " A"
}
],
"created": 1725883643,
"id": "",
"model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"object": "text_completion",
"system_fingerprint": "2.2.1-dev0-native"
},... | text-generation-inference/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_many_prompts_stream.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_many_prompts_stream.json",
"repo_id": "text-generation-inference",
"token_count": 7100
} | 223 |
[
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [],
"seed": null,
"tokens": [
{
"id": 1736,
"logprob": -2.09375,
"special": false,
"text": " form"
},
{
... | text-generation-inference/integration-tests/models/__snapshots__/test_flash_gemma/test_flash_gemma_load.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_gemma/test_flash_gemma_load.json",
"repo_id": "text-generation-inference",
"token_count": 4072
} | 224 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [],
"seed": null,
"tokens": [
{
"id": 5229,
"logprob": -2.7988281,
"special": false,
"text": " failed"
},
{
"id": 29901,
"lo... | text-generation-inference/integration-tests/models/__snapshots__/test_flash_llama_marlin_24/test_flash_llama_marlin.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_llama_marlin_24/test_flash_llama_marlin.json",
"repo_id": "text-generation-inference",
"token_count": 869
} | 225 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [],
"seed": 0,
"tokens": [
{
"id": 288,
"logprob": -0.2854004,
"special": false,
"text": "ing"
},
{
"id": 264,
"logprob": -0... | text-generation-inference/integration-tests/models/__snapshots__/test_idefics2/test_flash_idefics2_next_all_params.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_idefics2/test_flash_idefics2_next_all_params.json",
"repo_id": "text-generation-inference",
"token_count": 860
} | 226 |
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": null,
"name": null,
"role": "assistant",
"tool_calls": [
{
"function": {
"arguments": {
"format": "celsius",
... | text-generation-inference/integration-tests/models/__snapshots__/test_tools_llama/test_flash_llama_grammar_tools.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_tools_llama/test_flash_llama_grammar_tools.json",
"repo_id": "text-generation-inference",
"token_count": 492
} | 227 |
import pytest
@pytest.fixture(scope="module")
def compressed_tensors_w8a8_int_dynamic_weight_handle(launcher):
with launcher(
"danieldk/Qwen2.5-1.5B-Instruct-w8a8-int-dynamic-weight",
num_shard=2,
quantize="compressed-tensors",
) as handle:
yield handle
@pytest.fixture(scope=... | text-generation-inference/integration-tests/models/test_compressed_tensors_w8a8_int_dynamic_weight.py/0 | {
"file_path": "text-generation-inference/integration-tests/models/test_compressed_tensors_w8a8_int_dynamic_weight.py",
"repo_id": "text-generation-inference",
"token_count": 1234
} | 228 |
import pytest
@pytest.fixture(scope="module")
def flash_llama_fp8_handle(launcher):
with launcher("meta-llama/Meta-Llama-3-8B", num_shard=2, quantize="fp8") as handle:
yield handle
@pytest.fixture(scope="module")
async def flash_llama_fp8(flash_llama_fp8_handle):
await flash_llama_fp8_handle.health(... | text-generation-inference/integration-tests/models/test_flash_llama_fp8.py/0 | {
"file_path": "text-generation-inference/integration-tests/models/test_flash_llama_fp8.py",
"repo_id": "text-generation-inference",
"token_count": 802
} | 229 |
import pytest
@pytest.fixture(scope="module")
def flash_phi_handle(launcher):
with launcher("microsoft/phi-2", num_shard=1) as handle:
yield handle
@pytest.fixture(scope="module")
async def flash_phi(flash_phi_handle):
await flash_phi_handle.health(300)
return flash_phi_handle.client
@pytest.m... | text-generation-inference/integration-tests/models/test_flash_phi.py/0 | {
"file_path": "text-generation-inference/integration-tests/models/test_flash_phi.py",
"repo_id": "text-generation-inference",
"token_count": 749
} | 230 |
import pytest
import requests
@pytest.fixture(scope="module")
def lora_mistral_handle(launcher):
with launcher(
"mistralai/Mistral-7B-v0.1",
lora_adapters=[
"predibase/dbpedia",
"predibase/customer_support",
],
cuda_graphs=[0],
) as handle:
yield... | text-generation-inference/integration-tests/models/test_lora_mistral.py/0 | {
"file_path": "text-generation-inference/integration-tests/models/test_lora_mistral.py",
"repo_id": "text-generation-inference",
"token_count": 1873
} | 231 |
{
buildPythonPackage,
poetry-core,
huggingface-hub,
pydantic,
}:
buildPythonPackage {
name = "text-generation";
src = ../clients/python;
pyproject = true;
build-system = [ poetry-core ];
dependencies = [
huggingface-hub
pydantic
];
}
| text-generation-inference/nix/client.nix/0 | {
"file_path": "text-generation-inference/nix/client.nix",
"repo_id": "text-generation-inference",
"token_count": 98
} | 232 |
/// Text Generation Inference Webserver
pub mod config;
pub mod infer;
pub mod server;
pub mod validation;
#[cfg(feature = "kserve")]
mod kserve;
pub mod logging;
mod sagemaker;
pub mod usage_stats;
mod vertex;
use crate::infer::tool_grammar::ToolGrammar;
use crate::infer::{Infer, InferError};
use pyo3::prelude::*;
... | text-generation-inference/router/src/lib.rs/0 | {
"file_path": "text-generation-inference/router/src/lib.rs",
"repo_id": "text-generation-inference",
"token_count": 26055
} | 233 |
install-flashinfer:
# We need fsspec as an additional dependency, but
# `pip install flashinfer` cannot resolve it.
uv pip install fsspec sympy==1.13.1 numpy
uv pip install -U setuptools
TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6;8.9;9.0+PTX" FLASHINFER_ENABLE_AOT=1 pip install git+https://github.com/flashinfer-ai/flashinf... | text-generation-inference/server/Makefile-flashinfer/0 | {
"file_path": "text-generation-inference/server/Makefile-flashinfer",
"repo_id": "text-generation-inference",
"token_count": 158
} | 234 |
// Adapted from turboderp exllama: https://github.com/turboderp/exllama
#include <ATen/cuda/CUDAContext.h>
#include "q4_matrix.cuh"
#include <vector>
#include "../util.cuh"
#include "../matrix.cuh"
using namespace std;
const int UNSHUF_BLOCKSIZE_X = 64;
const int RECONS_THREADS_X = 64; // Block size and thread... | text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/q4_matrix.cu/0 | {
"file_path": "text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/q4_matrix.cu",
"repo_id": "text-generation-inference",
"token_count": 2592
} | 235 |
#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... | text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_matrix.cu/0 | {
"file_path": "text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_matrix.cu",
"repo_id": "text-generation-inference",
"token_count": 10524
} | 236 |
import os
from typing import Optional
import torch
from text_generation_server.layers.attention.kv_cache import KVCache, KVScales
from text_generation_server.utils.import_utils import SYSTEM
from text_generation_server.layers.attention import Seqlen
from text_generation_server.utils.log import log_master
from text_gene... | text-generation-inference/server/text_generation_server/layers/attention/rocm.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/layers/attention/rocm.py",
"repo_id": "text-generation-inference",
"token_count": 5501
} | 237 |
import os
from dataclasses import dataclass
from typing import List, Optional, Union
import torch
from loguru import logger
from text_generation_server.utils.import_utils import SYSTEM
from text_generation_server.utils.log import log_once
from text_generation_server.utils.weights import Weight, Weights, WeightsLoader
... | text-generation-inference/server/text_generation_server/layers/gptq/__init__.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/layers/gptq/__init__.py",
"repo_id": "text-generation-inference",
"token_count": 8349
} | 238 |
import torch
from torch import nn
from typing import Tuple, Optional
from text_generation_server.utils.speculate import get_speculate
from text_generation_server.layers.linear import FastLinear
from text_generation_server.layers.tensor_parallel import (
TensorParallelHead,
TensorParallelColumnLinear,
)
class ... | text-generation-inference/server/text_generation_server/layers/medusa.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/layers/medusa.py",
"repo_id": "text-generation-inference",
"token_count": 2975
} | 239 |
# coding=utf-8
# Copyright 2024 Cohere team. All rights reserved.
#
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
# and OPT implementations in this library. It has been modified from its
# original forms to accommodate minor architectural differences compared
# to GPT-NeoX and OPT used by the M... | text-generation-inference/server/text_generation_server/models/custom_modeling/flash_cohere_modeling.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/flash_cohere_modeling.py",
"repo_id": "text-generation-inference",
"token_count": 8966
} | 240 |
from typing import List, Optional, Tuple
import torch
import torch.distributed
from torch import nn
from transformers.configuration_utils import PretrainedConfig
from transformers.modeling_utils import PreTrainedModel
from text_generation_server.layers import (
SpeculativeHead,
TensorParallelColumnLinear,
... | text-generation-inference/server/text_generation_server/models/custom_modeling/flash_rw_modeling.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/flash_rw_modeling.py",
"repo_id": "text-generation-inference",
"token_count": 11278
} | 241 |
# coding=utf-8
# Copyright 2022 The Fairseq Authors and 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/... | text-generation-inference/server/text_generation_server/models/custom_modeling/opt_modeling.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/opt_modeling.py",
"repo_id": "text-generation-inference",
"token_count": 15911
} | 242 |
import torch
import torch.distributed
import time
from dataclasses import dataclass
from opentelemetry import trace
from transformers import (
AutoTokenizer,
AutoModelForSeq2SeqLM,
PreTrainedTokenizerBase,
AutoConfig,
)
from typing import Optional, Tuple, List, Type, Dict
from text_generation_server.uti... | text-generation-inference/server/text_generation_server/models/seq2seq_lm.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/seq2seq_lm.py",
"repo_id": "text-generation-inference",
"token_count": 17976
} | 243 |
from functools import lru_cache
import math
import time
import torch
from typing import List, Optional, DefaultDict
from loguru import logger
from typing import Dict
from text_generation_server.pb.generate_pb2 import GrammarType
from outlines.fsm.guide import RegexGuide
from transformers import (
LogitsProcessor... | text-generation-inference/server/text_generation_server/utils/logits_process.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/utils/logits_process.py",
"repo_id": "text-generation-inference",
"token_count": 9944
} | 244 |
<p align="center">
<br>
<img src="https://huggingface.co/landing/assets/tokenizers/tokenizers-logo.png" width="600"/>
<br>
<p>
<p align="center">
<img alt="Build" src="https://github.com/huggingface/tokenizers/workflows/Rust/badge.svg">
<a href="https://github.com/huggingface/tokenizers/blob/main/LI... | tokenizers/README.md/0 | {
"file_path": "tokenizers/README.md",
"repo_id": "tokenizers",
"token_count": 1127
} | 245 |
/* eslint-disable */
var globRequire = require;
describe("pipelineExample", () => {
// This is a hack to let us require using path similar to what the user has to use
function require(mod: string) {
if (mod.startsWith("tokenizers")) {
// let path = mod.slice("tokenizers".length);
... | tokenizers/bindings/node/examples/documentation/pipeline.test.ts/0 | {
"file_path": "tokenizers/bindings/node/examples/documentation/pipeline.test.ts",
"repo_id": "tokenizers",
"token_count": 2710
} | 246 |
# `tokenizers-android-arm-eabi`
This is the **armv7-linux-androideabi** binary for `tokenizers`
| tokenizers/bindings/node/npm/android-arm-eabi/README.md/0 | {
"file_path": "tokenizers/bindings/node/npm/android-arm-eabi/README.md",
"repo_id": "tokenizers",
"token_count": 35
} | 247 |
# `tokenizers-linux-x64-gnu`
This is the **x86_64-unknown-linux-gnu** binary for `tokenizers`
| tokenizers/bindings/node/npm/linux-x64-gnu/README.md/0 | {
"file_path": "tokenizers/bindings/node/npm/linux-x64-gnu/README.md",
"repo_id": "tokenizers",
"token_count": 36
} | 248 |
use crate::arc_rwlock_serde;
use crate::tasks::models::{BPEFromFilesTask, WordLevelFromFilesTask, WordPieceFromFilesTask};
use crate::trainers::Trainer;
use napi::bindgen_prelude::*;
use napi_derive::napi;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::sync:... | tokenizers/bindings/node/src/models.rs/0 | {
"file_path": "tokenizers/bindings/node/src/models.rs",
"repo_id": "tokenizers",
"token_count": 3681
} | 249 |
[package]
name = "tokenizers-python"
version = "0.21.0-dev.0"
authors = ["Anthony MOI <m.anthony.moi@gmail.com>"]
edition = "2021"
[lib]
name = "tokenizers"
crate-type = ["cdylib"]
[dependencies]
rayon = "1.10"
serde = { version = "1.0", features = ["rc", "derive"] }
serde_json = "1.0"
libc = "0.2"
env_logger = "0.11... | tokenizers/bindings/python/Cargo.toml/0 | {
"file_path": "tokenizers/bindings/python/Cargo.toml",
"repo_id": "tokenizers",
"token_count": 282
} | 250 |
from .base_tokenizer import BaseTokenizer
from .bert_wordpiece import BertWordPieceTokenizer
from .byte_level_bpe import ByteLevelBPETokenizer
from .char_level_bpe import CharBPETokenizer
from .sentencepiece_bpe import SentencePieceBPETokenizer
from .sentencepiece_unigram import SentencePieceUnigramTokenizer
| tokenizers/bindings/python/py_src/tokenizers/implementations/__init__.py/0 | {
"file_path": "tokenizers/bindings/python/py_src/tokenizers/implementations/__init__.py",
"repo_id": "tokenizers",
"token_count": 94
} | 251 |
.tokenized-text {
width:100%;
padding:2rem;
max-height: 400px;
overflow-y: auto;
box-sizing:border-box;
line-height:4rem; /* Lots of space between lines */
font-family: "Roboto Light", "Ubuntu Light", "Ubuntu", monospace;
box-shadow: 2px 2px 2px rgba(0,0,0,0.2);
background-color: rgb... | tokenizers/bindings/python/py_src/tokenizers/tools/visualizer-styles.css/0 | {
"file_path": "tokenizers/bindings/python/py_src/tokenizers/tools/visualizer-styles.css",
"repo_id": "tokenizers",
"token_count": 1806
} | 252 |
use std::sync::{Arc, RwLock};
use pyo3::exceptions;
use pyo3::exceptions::PyException;
use pyo3::prelude::*;
use pyo3::types::*;
use serde::ser::SerializeStruct;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use tk::normalizer::SplitDelimiterBehavior;
use tk::pre_tokenizers::bert::BertPreTokenizer;
u... | tokenizers/bindings/python/src/pre_tokenizers.rs/0 | {
"file_path": "tokenizers/bindings/python/src/pre_tokenizers.rs",
"repo_id": "tokenizers",
"token_count": 17184
} | 253 |
import pytest
from tokenizers import BertWordPieceTokenizer
from ..utils import bert_files, data_dir
class TestEncoding:
@pytest.fixture(scope="class")
def encodings(self, bert_files):
tokenizer = BertWordPieceTokenizer.from_file(bert_files["vocab"])
single_encoding = tokenizer.encode("I lov... | tokenizers/bindings/python/tests/bindings/test_encoding.py/0 | {
"file_path": "tokenizers/bindings/python/tests/bindings/test_encoding.py",
"repo_id": "tokenizers",
"token_count": 1991
} | 254 |
import pytest
from tokenizers import SentencePieceBPETokenizer, SentencePieceUnigramTokenizer
class TestSentencePieceBPE:
def test_train_from_iterator(self):
text = ["A first sentence", "Another sentence", "And a last one"]
tokenizer = SentencePieceBPETokenizer()
tokenizer.train_from_iter... | tokenizers/bindings/python/tests/implementations/test_sentencepiece.py/0 | {
"file_path": "tokenizers/bindings/python/tests/implementations/test_sentencepiece.py",
"repo_id": "tokenizers",
"token_count": 1118
} | 255 |
/* Our DOM objects */
/* Version control */
.selectors {
margin-bottom: 10px;
}
.dropdown-button {
display: inline-block;
width: 50%;
background-color: #6670FF;
color: white;
border: none;
padding: 5px;
font-size: 15px;
cursor: pointer;
}
.dropdown-button:hover, .dropdown-button:... | tokenizers/docs/source/_static/css/huggingface.css/0 | {
"file_path": "tokenizers/docs/source/_static/css/huggingface.css",
"repo_id": "tokenizers",
"token_count": 2708
} | 256 |
Training from memory
----------------------------------------------------------------------------------------------------
In the `Quicktour <quicktour>`__, we saw how to build and train a tokenizer using text files,
but we can actually use any Python Iterator. In this section we'll see a few different ways of
training... | tokenizers/docs/source/tutorials/python/training_from_memory.rst/0 | {
"file_path": "tokenizers/docs/source/tutorials/python/training_from_memory.rst",
"repo_id": "tokenizers",
"token_count": 1149
} | 257 |
[package]
name = "unstable_wasm"
version = "0.1.0"
authors = ["Nicolas Patry"]
edition = "2018"
[lib]
crate-type = ["cdylib", "rlib"]
[features]
default = ["console_error_panic_hook"]
[dependencies]
wasm-bindgen = "0.2.63"
# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them ... | tokenizers/tokenizers/examples/unstable_wasm/Cargo.toml/0 | {
"file_path": "tokenizers/tokenizers/examples/unstable_wasm/Cargo.toml",
"repo_id": "tokenizers",
"token_count": 364
} | 258 |
const CopyWebpackPlugin = require("copy-webpack-plugin");
const path = require('path');
module.exports = {
entry: "./bootstrap.js",
output: {
path: path.resolve(__dirname, "dist"),
filename: "bootstrap.js",
},
mode: "development",
plugins: [
new CopyWebpackPlugin(['index.html'])
],
};
| tokenizers/tokenizers/examples/unstable_wasm/www/webpack.config.js/0 | {
"file_path": "tokenizers/tokenizers/examples/unstable_wasm/www/webpack.config.js",
"repo_id": "tokenizers",
"token_count": 114
} | 259 |
//! Popular tokenizer models.
pub mod bpe;
pub mod unigram;
pub mod wordlevel;
pub mod wordpiece;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use crate::models::bpe::{BpeTrainer, BPE};
use crate::models::unigram::{Unigram, UnigramTrai... | tokenizers/tokenizers/src/models/mod.rs/0 | {
"file_path": "tokenizers/tokenizers/src/models/mod.rs",
"repo_id": "tokenizers",
"token_count": 6331
} | 260 |
use crate::tokenizer::{NormalizedString, Normalizer, Result};
pub use spm_precompiled::Precompiled;
use std::cmp::Ordering;
use unicode_segmentation::UnicodeSegmentation;
fn replace(transformations: &mut Vec<(char, isize)>, old_part: &str, new_part: &str) {
let old_count = old_part.chars().count() as isize;
le... | tokenizers/tokenizers/src/normalizers/precompiled.rs/0 | {
"file_path": "tokenizers/tokenizers/src/normalizers/precompiled.rs",
"repo_id": "tokenizers",
"token_count": 1432
} | 261 |
use crate::pre_tokenizers::unicode_scripts::scripts::{get_script, Script};
use crate::tokenizer::{normalizer::Range, PreTokenizedString, PreTokenizer, Result};
use crate::utils::macro_rules_attribute;
#[derive(Clone, Debug, PartialEq, Eq)]
#[macro_rules_attribute(impl_serde_type!)]
pub struct UnicodeScripts;
impl Uni... | tokenizers/tokenizers/src/pre_tokenizers/unicode_scripts/pre_tokenizer.rs/0 | {
"file_path": "tokenizers/tokenizers/src/pre_tokenizers/unicode_scripts/pre_tokenizer.rs",
"repo_id": "tokenizers",
"token_count": 2584
} | 262 |
use crate::tokenizer::pattern::Pattern;
use crate::Offsets;
use fancy_regex::Regex;
use std::error::Error;
#[derive(Debug)]
pub struct SysRegex {
regex: Regex,
}
impl SysRegex {
pub fn find_iter<'r, 't>(&'r self, inside: &'t str) -> Matches<'r, 't> {
Matches(self.regex.find_iter(inside))
}
pu... | tokenizers/tokenizers/src/utils/fancy.rs/0 | {
"file_path": "tokenizers/tokenizers/src/utils/fancy.rs",
"repo_id": "tokenizers",
"token_count": 823
} | 263 |
use tokenizers::models::bpe::BPE;
use tokenizers::pre_tokenizers::whitespace::Whitespace;
use tokenizers::{DecoderWrapper, NormalizerWrapper, PostProcessorWrapper, PreTokenizerWrapper};
use tokenizers::{Model, Tokenizer, TokenizerBuilder};
#[test]
fn bpe_values_after_training() {
let mut tokenizer = TokenizerBuild... | tokenizers/tokenizers/tests/training.rs/0 | {
"file_path": "tokenizers/tokenizers/tests/training.rs",
"repo_id": "tokenizers",
"token_count": 851
} | 264 |
import re
README_TEMPLATE = """
<p align="center">
<br/>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/transformersjs-dark.svg" width="500" style="max-width: 100%;">
<source media="(prefers-color-scheme:... | transformers.js/docs/scripts/build_readme.py/0 | {
"file_path": "transformers.js/docs/scripts/build_readme.py",
"repo_id": "transformers.js",
"token_count": 1756
} | 265 |
# Transformers.js
<include>
{
"path": "../snippets/0_introduction.snippet"
}
</include>
## Quick tour
<include>
{
"path": "../snippets/1_quick-tour.snippet"
}
</include>
## Contents
The documentation is organized into 4 sections:
1. **GET STARTED** provides a quick tour of the library and installation ins... | transformers.js/docs/source/index.md/0 | {
"file_path": "transformers.js/docs/source/index.md",
"repo_id": "transformers.js",
"token_count": 495
} | 266 |
import { useState, useRef, useEffect, useCallback } from 'react'
import './App.css'
const PLACEHOLDER_TEXTS = [
"A panda is a large black-and-white bear native to China.",
"The typical life span of a panda is 20 years in the wild.",
"A panda's diet consists almost entirely of bamboo.",
"Ailuropoda melanoleuca ... | transformers.js/examples/adaptive-retrieval/src/App.jsx/0 | {
"file_path": "transformers.js/examples/adaptive-retrieval/src/App.jsx",
"repo_id": "transformers.js",
"token_count": 2829
} | 267 |
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
font-synthesis: none;
text-rendering: opti... | transformers.js/examples/code-completion/src/index.css/0 | {
"file_path": "transformers.js/examples/code-completion/src/index.css",
"repo_id": "transformers.js",
"token_count": 514
} | 268 |
{
"manifest_version": 3,
"name": "extension",
"description": "Transformers.js | Sample browser extension",
"version": "0.0.1",
"permissions": [
"activeTab",
"scripting",
"contextMenus",
"storage",
"unlimitedStorage"
],
"background": {
"service_worker": "background.js",
"type": ... | transformers.js/examples/extension/public/manifest.json/0 | {
"file_path": "transformers.js/examples/extension/public/manifest.json",
"repo_id": "transformers.js",
"token_count": 421
} | 269 |
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer utilities {
.scrollbar-thin::-webkit-scrollbar {
@apply w-2;
}
.scrollbar-thin::-webkit-scrollbar-track {
@apply rounded-full bg-gray-100 dark:bg-gray-700;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
@apply rounded-full bg-gray-... | transformers.js/examples/florence2-webgpu/src/index.css/0 | {
"file_path": "transformers.js/examples/florence2-webgpu/src/index.css",
"repo_id": "transformers.js",
"token_count": 173
} | 270 |
import { pipeline } from "@huggingface/transformers";
// Use the Singleton pattern to enable lazy construction of the pipeline.
class PipelineSingleton {
static task = 'text-classification';
static model = 'Xenova/distilbert-base-uncased-finetuned-sst-2-english';
static instance = null;
static async g... | transformers.js/examples/next-client/src/app/worker.js/0 | {
"file_path": "transformers.js/examples/next-client/src/app/worker.js",
"repo_id": "transformers.js",
"token_count": 369
} | 271 |
// The full list of languages in FLORES-200 is available here:
// https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200
const LANGUAGES = {
"Acehnese (Arabic script)": "ace_Arab",
"Acehnese (Latin script)": "ace_Latn",
"Afrikaans": "afr_Latn",
"Akan": "aka_Latn",
"... | transformers.js/examples/react-translator/src/components/LanguageSelector.jsx/0 | {
"file_path": "transformers.js/examples/react-translator/src/components/LanguageSelector.jsx",
"repo_id": "transformers.js",
"token_count": 3102
} | 272 |
// Reference the elements we will use
const statusLabel = document.getElementById('status');
const fileUpload = document.getElementById('upload');
const imageContainer = document.getElementById('container');
const example = document.getElementById('example');
const maskCanvas = document.getElementById('mask-output');
... | transformers.js/examples/segment-anything-client/index.js/0 | {
"file_path": "transformers.js/examples/segment-anything-client/index.js",
"repo_id": "transformers.js",
"token_count": 3452
} | 273 |
SUPABASE_URL=your-project-url
SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SECRET_KEY=your-secret-key
| transformers.js/examples/semantic-image-search/.env.local.example/0 | {
"file_path": "transformers.js/examples/semantic-image-search/.env.local.example",
"repo_id": "transformers.js",
"token_count": 45
} | 274 |
export default function Progress({ text, percentage }) {
percentage ??= 0;
return (
<div className="relative text-black bg-white rounded-lg text-left overflow-hidden">
<div className='px-2 w-[1%] h-full bg-blue-500 whitespace-nowrap' style={{ width: `${percentage}%` }}>
{text} ({`${percentage.toF... | transformers.js/examples/text-to-speech-client/src/components/Progress.jsx/0 | {
"file_path": "transformers.js/examples/text-to-speech-client/src/components/Progress.jsx",
"repo_id": "transformers.js",
"token_count": 144
} | 275 |
import { useCallback, useEffect, useRef, useState } from 'react'
import { Token } from './components/Token'
import './App.css'
// Define list of tokenizers and their corresponding human-readable names
const TOKENIZER_OPTIONS = Object.freeze({
'Xenova/gpt-4': 'gpt-4 / gpt-3.5-turbo / text-embedding-ada-002',
'Xenov... | transformers.js/examples/tokenizer-playground/src/App.jsx/0 | {
"file_path": "transformers.js/examples/tokenizer-playground/src/App.jsx",
"repo_id": "transformers.js",
"token_count": 3075
} | 276 |
* {
box-sizing: border-box;
padding: 0;
margin: 0;
font-family: sans-serif;
}
html,
body {
height: 100%;
}
body {
padding: 16px 32px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
h1 {
text-align: center;
}
#status {
min-height: 16px;
margin: 8px 0;... | transformers.js/examples/webgpu-embedding-benchmark/style.css/0 | {
"file_path": "transformers.js/examples/webgpu-embedding-benchmark/style.css",
"repo_id": "transformers.js",
"token_count": 518
} | 277 |
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer utilities {
.scrollbar-thin::-webkit-scrollbar {
@apply w-2;
}
.scrollbar-thin::-webkit-scrollbar-track {
@apply rounded-full bg-gray-100 dark:bg-gray-700;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
@apply rounded-full bg-gray-... | transformers.js/examples/webgpu-vlm/src/index.css/0 | {
"file_path": "transformers.js/examples/webgpu-vlm/src/index.css",
"repo_id": "transformers.js",
"token_count": 245
} | 278 |
import { useMemo } from "react";
const Chunk = ({ chunk, currentTime, onClick, ...props }) => {
const { text, timestamp } = chunk;
const [start, end] = timestamp;
const bolded = start <= currentTime && currentTime < end;
return (
<span {...props}>
{text.startsWith(' ') ? " " : ""}... | transformers.js/examples/whisper-word-timestamps/src/components/Transcript.jsx/0 | {
"file_path": "transformers.js/examples/whisper-word-timestamps/src/components/Transcript.jsx",
"repo_id": "transformers.js",
"token_count": 1253
} | 279 |
import { env, pipeline } from '@xenova/transformers';
// Skip local model check since we are downloading the model from the Hugging Face Hub.
env.allowLocalModels = false;
class MyZeroShotClassificationPipeline {
static task = 'zero-shot-classification';
static model = 'MoritzLaurer/deberta-v3-xsmall-zeroshot... | transformers.js/examples/zero-shot-classification/src/worker.js/0 | {
"file_path": "transformers.js/examples/zero-shot-classification/src/worker.js",
"repo_id": "transformers.js",
"token_count": 584
} | 280 |
from optimum.exporters.onnx.model_configs import WhisperOnnxConfig
from optimum.exporters.onnx.base import ConfigBehavior
from typing import Dict
# List of [layer, head] pairs that select the cross-attention heads that are highly correlated to word-level timing.
# Source: https://gist.github.com/hollance/42e32852f242... | transformers.js/scripts/extra/whisper.py/0 | {
"file_path": "transformers.js/scripts/extra/whisper.py",
"repo_id": "transformers.js",
"token_count": 1700
} | 281 |
import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';
import { Tensor } from '../../utils/tensor.js';
import { mel_filter_bank, spectrogram, window_function } from '../../utils/audio.js';
export class ASTFeatureExtractor extends FeatureExtractor {
constructor(config) {... | transformers.js/src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js/0 | {
"file_path": "transformers.js/src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js",
"repo_id": "transformers.js",
"token_count": 1476
} | 282 |
import { Processor } from "../../base/processing_utils.js";
import { AutoImageProcessor } from "../auto/image_processing_auto.js";
import { AutoTokenizer } from "../../tokenizers.js";
export class Florence2Processor extends Processor {
static tokenizer_class = AutoTokenizer
static image_processor_class = AutoI... | transformers.js/src/models/florence2/processing_florence2.js/0 | {
"file_path": "transformers.js/src/models/florence2/processing_florence2.js",
"repo_id": "transformers.js",
"token_count": 2334
} | 283 |
import { Processor } from '../../base/processing_utils.js';
import { PyAnnoteFeatureExtractor } from './feature_extraction_pyannote.js';
export class PyAnnoteProcessor extends Processor {
static feature_extractor_class = PyAnnoteFeatureExtractor
/**
* Calls the feature_extractor function with the given a... | transformers.js/src/models/pyannote/processing_pyannote.js/0 | {
"file_path": "transformers.js/src/models/pyannote/processing_pyannote.js",
"repo_id": "transformers.js",
"token_count": 316
} | 284 |
import { FeatureExtractor, validate_audio_inputs } from "../../base/feature_extraction_utils.js";
import { Tensor } from "../../utils/tensor.js";
export class Wav2Vec2FeatureExtractor extends FeatureExtractor {
/**
* @param {Float32Array} input_values
* @returns {Float32Array}
*/
_zero_mean_u... | transformers.js/src/models/wav2vec2/feature_extraction_wav2vec2.js/0 | {
"file_path": "transformers.js/src/models/wav2vec2/feature_extraction_wav2vec2.js",
"repo_id": "transformers.js",
"token_count": 700
} | 285 |
/**
* @file Custom data structures.
*
* These are only used internally, meaning an end-user shouldn't
* need to access anything here.
*
* @module utils/data-structures
*/
/**
* Efficient Heap-based Implementation of a Priority Queue.
* It uses an array-based binary heap, where the root is at index `0`, an... | transformers.js/src/utils/data-structures.js/0 | {
"file_path": "transformers.js/src/utils/data-structures.js",
"repo_id": "transformers.js",
"token_count": 5931
} | 286 |
import { AutoFeatureExtractor, ASTFeatureExtractor } from "../../../src/transformers.js";
import { load_cached_audio } from "../../asset_cache.js";
import { MAX_FEATURE_EXTRACTOR_LOAD_TIME, MAX_TEST_EXECUTION_TIME } from "../../init.js";
export default () => {
// ASTFeatureExtractor
describe("ASTFeatureExtractor"... | transformers.js/tests/models/audio_spectrogram_transformer/test_feature_extraction_audio_spectrogram_transformer.js/0 | {
"file_path": "transformers.js/tests/models/audio_spectrogram_transformer/test_feature_extraction_audio_spectrogram_transformer.js",
"repo_id": "transformers.js",
"token_count": 926
} | 287 |
import { GPT2Tokenizer } from "../../../src/tokenizers.js";
import { BASE_TEST_STRINGS, SENTENCEPIECE_TEST_STRINGS } from "../test_strings.js";
export const TOKENIZER_CLASS = GPT2Tokenizer;
export const TEST_CONFIG = {
// - clean_up_tokenization_spaces=true
// - default pretokenization regex
"Xenova/gpt2": {
... | transformers.js/tests/models/gpt2/test_tokenization_gpt2.js/0 | {
"file_path": "transformers.js/tests/models/gpt2/test_tokenization_gpt2.js",
"repo_id": "transformers.js",
"token_count": 12344
} | 288 |
import { GPT2Tokenizer, Olmo2ForCausalLM } from "../../../src/transformers.js";
import { MAX_MODEL_LOAD_TIME, MAX_TEST_EXECUTION_TIME, MAX_MODEL_DISPOSE_TIME, DEFAULT_MODEL_OPTIONS } from "../../init.js";
export default () => {
describe("Olmo2ForCausalLM", () => {
const model_id = "hf-internal-testing/tiny-rand... | transformers.js/tests/models/olmo2/test_modeling_olmo2.js/0 | {
"file_path": "transformers.js/tests/models/olmo2/test_modeling_olmo2.js",
"repo_id": "transformers.js",
"token_count": 810
} | 289 |
import { SamProcessor, SamModel } from "../../../src/transformers.js";
import { load_cached_image } from "../../asset_cache.js";
import { MAX_MODEL_LOAD_TIME, MAX_TEST_EXECUTION_TIME, MAX_MODEL_DISPOSE_TIME, DEFAULT_MODEL_OPTIONS } from "../../init.js";
export default () => {
describe("SamModel", () => {
const ... | transformers.js/tests/models/sam/test_modeling_sam.js/0 | {
"file_path": "transformers.js/tests/models/sam/test_modeling_sam.js",
"repo_id": "transformers.js",
"token_count": 770
} | 290 |
import { pipeline, SummarizationPipeline } from "../../src/transformers.js";
import { MAX_MODEL_LOAD_TIME, MAX_TEST_EXECUTION_TIME, MAX_MODEL_DISPOSE_TIME, DEFAULT_MODEL_OPTIONS } from "../init.js";
const PIPELINE_ID = "summarization";
export default () => {
describe("Summarization", () => {
const model_id = "... | transformers.js/tests/pipelines/test_pipelines_summarization.js/0 | {
"file_path": "transformers.js/tests/pipelines/test_pipelines_summarization.js",
"repo_id": "transformers.js",
"token_count": 509
} | 291 |
import { AutoModel, PreTrainedModel } from "../../src/models.js";
import { MAX_TEST_EXECUTION_TIME, DEFAULT_MODEL_OPTIONS } from "../init.js";
// TODO: Set cache folder to a temp directory
describe("Hub", () => {
describe("Loading models", () => {
it(
"should load a model from the local cache",
asy... | transformers.js/tests/utils/hub.test.js/0 | {
"file_path": "transformers.js/tests/utils/hub.test.js",
"repo_id": "transformers.js",
"token_count": 576
} | 292 |
# 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... | transformers/awesome-transformers.md/0 | {
"file_path": "transformers/awesome-transformers.md",
"repo_id": "transformers",
"token_count": 10234
} | 293 |
FROM python:3.9-slim
ENV PYTHONDONTWRITEBYTECODE=1
USER root
RUN apt-get update && apt-get install -y libsndfile1-dev espeak-ng time git cmake wget xz-utils build-essential g++5 libprotobuf-dev protobuf-compiler
ENV UV_PYTHON=/usr/local/bin/python
RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cach... | transformers/docker/custom-tokenizers.dockerfile/0 | {
"file_path": "transformers/docker/custom-tokenizers.dockerfile",
"repo_id": "transformers",
"token_count": 548
} | 294 |
FROM rocm/dev-ubuntu-22.04:6.2.4
LABEL maintainer="Hugging Face"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt install -y --no-install-recommends git libsndfile1-dev tesseract-ocr espeak-ng python3 python3-dev python3-pip python3-dev ffmpeg git-lfs && \
apt clean && \
rm -rf /var/lib/apt/list... | transformers/docker/transformers-pytorch-amd-gpu/Dockerfile/0 | {
"file_path": "transformers/docker/transformers-pytorch-amd-gpu/Dockerfile",
"repo_id": "transformers",
"token_count": 503
} | 295 |
# ุงูุชุฏุฑูุจ ุงูู
ูุฒุน ุจุงุณุชุฎุฏุงู
๐ค Accelerate
ู
ุน ุชุฒุงูุฏ ุญุฌู
ุงููู
ุงุฐุฌ ุงููุบููุฉุ ุจุฑุฒ ุงูุชูุงุฒู ูุฃุญุฏ ุงูุงุณุชุฑุงุชูุฌูุงุช ูุชุฏุฑูุจ ูู
ุงุฐุฌ ุฃูุจุฑ ุนูู ุฃุฌูุฒุฉ ู
ุญุฏูุฏุฉ ูุชุณุฑูุน ุนู
ููุฉ ุงูุชุฏุฑูุจ ุจู
ูุฏุงุฑ ูุจูุฑ. ุฃูุดุฃูุง ูู Hugging Faceุ ูู
ูุง ุจุฅูุดุงุก ู
ูุชุจุฉ [ Accelerate](https://huggingface.co/docs/accelerate) ูู
ุณุงุนุฏุฉ ุงูู
ุณุชุฎุฏู
ูู ุนูู ุชุฏุฑูุจ ุฃู ูู
ูุฐุฌ ู
ู Transfor... | transformers/docs/source/ar/accelerate.md/0 | {
"file_path": "transformers/docs/source/ar/accelerate.md",
"repo_id": "transformers",
"token_count": 2534
} | 296 |
# ุงูุชูููุฏ ุจุงุณุชุฎุฏุงู
ูู
ุงุฐุฌ ุงููุบุงุช ุงููุจูุฑุฉ (LLMs)
[[open-in-colab]]
ุชุนุฏ LLMsุ ุฃู ูู
ุงุฐุฌ ุงููุบุฉ ุงููุจูุฑุฉุ ุงูู
ููู ุงูุฑุฆูุณู ูุฑุงุก ุชูููุฏ ุงููุตูุต. ูุจุงุฎุชุตุงุฑุ ุชุชููู ู
ู ูู
ุงุฐุฌ ู
ุญูู ูุจูุฑุฉ ู
ุณุจูุฉ ุงูุชุฏุฑูุจ ุชู
ุชุฏุฑูุจูุง ููุชูุจุค ุจุงูููู
ุฉ ุงูุชุงููุฉ (ุฃูุ ุจุดูู ุฃูุซุฑ ุฏูุฉุ ุงูุฑู
ุฒ ุงููุบูู) ุจุงููุธุฑ ุฅูู ูุต ู
ุนูู. ูุธุฑูุง ูุฃููุง ุชุชูุจุฃ ุจุฑู
ุฒ ูุงุญุฏ ูู ูู ู
ุฑุฉุ ูุฌุจ ุนููู... | transformers/docs/source/ar/llm_tutorial.md/0 | {
"file_path": "transformers/docs/source/ar/llm_tutorial.md",
"repo_id": "transformers",
"token_count": 9367
} | 297 |
# ุงูุชุฏุฑูุจ ุจุงุณุชุฎุฏุงู
ูุต ุจุฑู
ุฌู
ุจุงูุฅุถุงูุฉ ุฅูู ุฏูุงุชุฑ ุงูู
ูุงุญุธุงุช [notebooks](./notebooks) ุงูุฎุงุตุฉ ุจู ๐ค Transformersุ ููุงู ุฃูุถูุง ูุตูุต ุจุฑู
ุฌูุฉ ุชูุถูุญูุฉ ุชูุธูุฑ ููููุฉ ุชุฏุฑูุจ ูู
ูุฐุฌ ูู
ูู
ุฉ ุจุงุณุชุฎุฏุงู
[PyTorch](https://github.com/huggingface/transformers/tree/main/examples/pytorch) ุฃู [TensorFlow](https://github.com/huggingface/transformer... | transformers/docs/source/ar/run_scripts.md/0 | {
"file_path": "transformers/docs/source/ar/run_scripts.md",
"repo_id": "transformers",
"token_count": 10161
} | 298 |
# ุงูุชุตุฏูุฑ ุฅูู TorchScript
<Tip>
ูุฐู ูู ุจุฏุงูุฉ ุชุฌุงุฑุจูุง ู
ุน TorchScript ููุง ุฒููุง ูุณุชูุดู ูุฏุฑุงุชู ู
ุน ูู
ุงุฐุฌ ุงูู
ุฏุฎูุงุช ุงูู
ุชุบูุฑุฉ ุงูุญุฌู
. ุฅูู ู
ุฌุงู ุงูุชู
ุงู
ูุง ูุณูุนู
ู ุชุญููููุง ูู ุงูุฅุตุฏุงุฑุงุช ุงููุงุฏู
ุฉุ ู
ุน ุงูู
ุฒูุฏ ู
ู ุงูุฃู
ุซูุฉ ุงูุจุฑู
ุฌูุฉุ ูุชูููุฐ ุฃูุซุฑ ู
ุฑููุฉุ ูู
ูุงููุณ ู
ูุงุฑูุฉ ุจูู ุงูุฃููุงุฏ ุงููุงุฆู
ุฉ ุนูู Python ู
ุน ุฃููุงุฏ TorchScript ุงูู
ูุฌู
ูุนุฉ.
</Tip>
... | transformers/docs/source/ar/torchscript.md/0 | {
"file_path": "transformers/docs/source/ar/torchscript.md",
"repo_id": "transformers",
"token_count": 5475
} | 299 |
<!--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... | transformers/docs/source/de/pipeline_tutorial.md/0 | {
"file_path": "transformers/docs/source/de/pipeline_tutorial.md",
"repo_id": "transformers",
"token_count": 3003
} | 300 |
<!--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 agreed... | transformers/docs/source/en/attention.md/0 | {
"file_path": "transformers/docs/source/en/attention.md",
"repo_id": "transformers",
"token_count": 958
} | 301 |
<!--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 agreed... | transformers/docs/source/en/fsdp.md/0 | {
"file_path": "transformers/docs/source/en/fsdp.md",
"repo_id": "transformers",
"token_count": 2238
} | 302 |
<!--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 agreed... | transformers/docs/source/en/main_classes/model.md/0 | {
"file_path": "transformers/docs/source/en/main_classes/model.md",
"repo_id": "transformers",
"token_count": 745
} | 303 |
<!--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 agreed... | transformers/docs/source/en/model_doc/blenderbot.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/blenderbot.md",
"repo_id": "transformers",
"token_count": 1405
} | 304 |
<!--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... | transformers/docs/source/en/model_doc/dbrx.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/dbrx.md",
"repo_id": "transformers",
"token_count": 1794
} | 305 |
<!--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 to... | transformers/docs/source/en/model_doc/dinov2_with_registers.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/dinov2_with_registers.md",
"repo_id": "transformers",
"token_count": 875
} | 306 |
<!--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... | transformers/docs/source/en/model_doc/falcon3.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/falcon3.md",
"repo_id": "transformers",
"token_count": 564
} | 307 |
<!--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... | transformers/docs/source/en/model_doc/jukebox.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/jukebox.md",
"repo_id": "transformers",
"token_count": 1309
} | 308 |
<!--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 agreed... | transformers/docs/source/en/model_doc/longformer.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/longformer.md",
"repo_id": "transformers",
"token_count": 2395
} | 309 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.