text stringlengths 5 631k | id stringlengths 14 178 | metadata dict | __index_level_0__ int64 0 647 |
|---|---|---|---|
""" Pyramid Vision Transformer v2
@misc{wang2021pvtv2,
title={PVTv2: Improved Baselines with Pyramid Vision Transformer},
author={Wenhai Wang and Enze Xie and Xiang Li and Deng-Ping Fan and Kaitao Song and Ding Liang and
Tong Lu and Ping Luo and Ling Shao},
year={2021},
eprint={2106.137... | pytorch-image-models/timm/models/pvt_v2.py/0 | {
"file_path": "pytorch-image-models/timm/models/pvt_v2.py",
"repo_id": "pytorch-image-models",
"token_count": 10012
} | 251 |
"""
Implementation of Prof-of-Concept Network: StarNet.
We make StarNet as simple as possible [to show the key contribution of element-wise multiplication]:
- like NO layer-scale in network design,
- and NO EMA during training,
- which would improve the performance further.
Created by: Xu Ma (Email: ma.xu... | pytorch-image-models/timm/models/starnet.py/0 | {
"file_path": "pytorch-image-models/timm/models/starnet.py",
"repo_id": "pytorch-image-models",
"token_count": 6109
} | 252 |
""" Vision OutLOoker (VOLO) implementation
Paper: `VOLO: Vision Outlooker for Visual Recognition` - https://arxiv.org/abs/2106.13112
Code adapted from official impl at https://github.com/sail-sg/volo, original copyright in comment below
Modifications and additions for timm by / Copyright 2022, Ross Wightman
"""
# Co... | pytorch-image-models/timm/models/volo.py/0 | {
"file_path": "pytorch-image-models/timm/models/volo.py",
"repo_id": "pytorch-image-models",
"token_count": 23354
} | 253 |
""" ADOPT PyTorch Optimizer
ADOPT: Modified Adam Can Converge with Any β2 with the Optimal Rate: https://arxiv.org/abs/2411.02853
Modified for reduced dependencies on PyTorch internals from original at: https://github.com/iShohei220/adopt
@inproceedings{taniguchi2024adopt,
author={Taniguchi, Shohei and Harada, Keno... | pytorch-image-models/timm/optim/adopt.py/0 | {
"file_path": "pytorch-image-models/timm/optim/adopt.py",
"repo_id": "pytorch-image-models",
"token_count": 9337
} | 254 |
""" SGD with decoupled weight-decay.
References for added functionality:
Cautious Optimizers: https://arxiv.org/abs/2411.16085
Why Gradients Rapidly Increase Near the End of Training: https://arxiv.org/abs/2506.02285
Hacked together by Ross Wightman
"""
from typing import List, Optional
import torch
from tor... | pytorch-image-models/timm/optim/sgdw.py/0 | {
"file_path": "pytorch-image-models/timm/optim/sgdw.py",
"repo_id": "pytorch-image-models",
"token_count": 5628
} | 255 |
""" CUDA / AMP utils
Hacked together by / Copyright 2020 Ross Wightman
"""
import torch
try:
from apex import amp
has_apex = True
except ImportError:
amp = None
has_apex = False
from .clip_grad import dispatch_clip_grad
class ApexScaler:
state_dict_key = "amp"
def __call__(
sel... | pytorch-image-models/timm/utils/cuda.py/0 | {
"file_path": "pytorch-image-models/timm/utils/cuda.py",
"repo_id": "pytorch-image-models",
"token_count": 1048
} | 256 |
# What are agents? 🤔
## An introduction to agentic systems.
Any efficient system using AI will need to provide LLMs some kind of access to the real world: for instance the possibility to call a search tool to get external information, or to act on certain programs in order to solve a task. In other words, LLMs shoul... | smolagents/docs/source/en/conceptual_guides/intro_agents.md/0 | {
"file_path": "smolagents/docs/source/en/conceptual_guides/intro_agents.md",
"repo_id": "smolagents",
"token_count": 2431
} | 257 |
# Building good agents
[[open-in-colab]]
There's a world of difference between building an agent that works and one that doesn't.
How can we build agents that fall into the former category?
In this guide, we're going to talk about best practices for building agents.
> [!TIP]
> If you're new to building agents, make ... | smolagents/docs/source/en/tutorials/building_good_agents.md/0 | {
"file_path": "smolagents/docs/source/en/tutorials/building_good_agents.md",
"repo_id": "smolagents",
"token_count": 6232
} | 258 |
# अच्छे Agents का निर्माण
[[open-in-colab]]
एक ऐसा एजेंट बनाने में जो काम करता है और जो काम नहीं करता है, इसमें ज़मीन-आसमान का अंतर है।
हम कैसे ऐसे एजेंट्स बना सकते हैं जो बाद वाली श्रेणी में आते हैं?
इस गाइड में, हम एजेंट्स बनाने के लिए सर्वोत्तम प्रक्रियाएँ के बारे में बात करेंगे।
> [!TIP]
> यदि आप एजेंट्स बनाने म... | smolagents/docs/source/hi/tutorials/building_good_agents.md/0 | {
"file_path": "smolagents/docs/source/hi/tutorials/building_good_agents.md",
"repo_id": "smolagents",
"token_count": 14311
} | 259 |
from smolagents import CodeAgent, GradioUI, InferenceClientModel, WebSearchTool
agent = CodeAgent(
tools=[WebSearchTool()],
model=InferenceClientModel(model_id="meta-llama/Llama-3.3-70B-Instruct", provider="fireworks-ai"),
verbosity_level=1,
planning_interval=3,
name="example_agent",
descripti... | smolagents/examples/gradio_ui.py/0 | {
"file_path": "smolagents/examples/gradio_ui.py",
"repo_id": "smolagents",
"token_count": 184
} | 260 |
# Shamelessly stolen from Microsoft Autogen team: thanks to them for this great resource!
# https://github.com/microsoft/autogen/blob/gaia_multiagent_v01_march_1st/autogen/browser_utils.py
import mimetypes
import os
import pathlib
import re
import time
import uuid
from typing import Any
from urllib.parse import unquote... | smolagents/examples/open_deep_research/scripts/text_web_browser.py/0 | {
"file_path": "smolagents/examples/open_deep_research/scripts/text_web_browser.py",
"repo_id": "smolagents",
"token_count": 10239
} | 261 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2025 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/_function_type_hints_utils.py/0 | {
"file_path": "smolagents/src/smolagents/_function_type_hints_utils.py",
"repo_id": "smolagents",
"token_count": 6241
} | 262 |
#!/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/tools.py/0 | {
"file_path": "smolagents/src/smolagents/tools.py",
"repo_id": "smolagents",
"token_count": 25459
} | 263 |
# 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_local_python_executor.py/0 | {
"file_path": "smolagents/tests/test_local_python_executor.py",
"repo_id": "smolagents",
"token_count": 46959
} | 264 |
# This file instructs Redocly's linter to ignore the rules contained for specific parts of your API.
# See https://redoc.ly/docs/cli/ for more information.
docs/openapi.json:
no-empty-servers:
- '#/openapi'
spec:
- >-
#/components/schemas/GenerateParameters/properties/best_of/exclusiveMinimum
- >-... | text-generation-inference/.redocly.lint-ignore.yaml/0 | {
"file_path": "text-generation-inference/.redocly.lint-ignore.yaml",
"repo_id": "text-generation-inference",
"token_count": 1750
} | 265 |
from typing import Optional
import torch
import torch.nn as nn
import os
from text_generation_server.utils.weights import Weights
from text_generation_server.layers.fp8 import (
Fp8Weight,
fp8_quantize,
quant_dtype,
normalize_e4m3fn_to_native_float8,
dynamic_quant,
dequant_block_fp8_weight_nai... | text-generation-inference/backends/gaudi/server/text_generation_server/layers/moe/fp8.py/0 | {
"file_path": "text-generation-inference/backends/gaudi/server/text_generation_server/layers/moe/fp8.py",
"repo_id": "text-generation-inference",
"token_count": 4907
} | 266 |
use bindgen::callbacks::{ItemInfo, ParseCallbacks};
use std::env;
use std::path::PathBuf;
#[derive(Debug)]
struct PrefixStripper;
impl ParseCallbacks for PrefixStripper {
fn generated_name_override(&self, item_info: ItemInfo<'_>) -> Option<String> {
item_info.name.strip_prefix("llama_").map(str::to_string... | text-generation-inference/backends/llamacpp/build.rs/0 | {
"file_path": "text-generation-inference/backends/llamacpp/build.rs",
"repo_id": "text-generation-inference",
"token_count": 766
} | 267 |
import os
import shutil
import time
from typing import Optional
from huggingface_hub import snapshot_download
from huggingface_hub.constants import HF_HUB_CACHE
from loguru import logger
from optimum.neuron.cache import get_hub_cached_entries
from optimum.neuron.configuration_utils import NeuronConfig
from .tgi_env... | text-generation-inference/backends/neuron/server/text_generation_server/model.py/0 | {
"file_path": "text-generation-inference/backends/neuron/server/text_generation_server/model.py",
"repo_id": "text-generation-inference",
"token_count": 1909
} | 268 |
#!/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_entry_point.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": 130
} | 269 |
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
} | 270 |
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
} | 271 |
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
} | 272 |
# Monitoring TGI server with Prometheus and Grafana dashboard
TGI server deployment can easily be monitored through a Grafana dashboard, consuming a Prometheus data collection. Example of inspectable metrics are statistics on the effective batch sizes used by TGI, prefill/decode latencies, number of generated tokens, ... | text-generation-inference/docs/source/basic_tutorials/monitoring.md/0 | {
"file_path": "text-generation-inference/docs/source/basic_tutorials/monitoring.md",
"repo_id": "text-generation-inference",
"token_count": 1376
} | 273 |
## Speculation
Speculative decoding, assisted generation, Medusa, and others are a few different names for the same idea.
The idea is to generate tokens *before* the large model actually runs, and only *check* if those tokens where valid.
So you are making *more* computations on your LLM, but if you are correct you ... | text-generation-inference/docs/source/conceptual/speculation.md/0 | {
"file_path": "text-generation-inference/docs/source/conceptual/speculation.md",
"repo_id": "text-generation-inference",
"token_count": 706
} | 274 |
# Supported Models
Text Generation Inference enables serving optimized models. The following sections list which models (VLMs & LLMs) are supported.
- [Deepseek V2](https://huggingface.co/deepseek-ai/DeepSeek-V2)
- [Deepseek V3](https://huggingface.co/deepseek-ai/DeepSeek-V3)
- [Idefics 2](https://huggingface.co/Hug... | text-generation-inference/docs/source/supported_models.md/0 | {
"file_path": "text-generation-inference/docs/source/supported_models.md",
"repo_id": "text-generation-inference",
"token_count": 1536
} | 275 |
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "Okay, let's analyze the image. \n\nThe transparent image reveals a stylized depiction of **a human head**. It's a minimalist, geometric representation, showing the basic shapes of the s... | text-generation-inference/integration-tests/models/__snapshots__/test_flash_gemma3/test_flash_gemma3_image_base64_rgba.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_gemma3/test_flash_gemma3_image_base64_rgba.json",
"repo_id": "text-generation-inference",
"token_count": 330
} | 276 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [],
"seed": 0,
"tokens": [
{
"id": 5229,
"logprob": -0.6645508,
"special": false,
"text": " failed"
},
{
"id": 29901,
"logpr... | text-generation-inference/integration-tests/models/__snapshots__/test_flash_llama_marlin_24/test_flash_llama_marlin24_all_params.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_llama_marlin_24/test_flash_llama_marlin24_all_params.json",
"repo_id": "text-generation-inference",
"token_count": 857
} | 277 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "eos_token",
"generated_tokens": 13,
"prefill": [],
"seed": null,
"tokens": [
{
"id": 450,
"logprob": -0.2602539,
"special": false,
"text": " The"
},
{
"id": 21282,
"log... | text-generation-inference/integration-tests/models/__snapshots__/test_idefics/test_idefics_two_images.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_idefics/test_idefics_two_images.json",
"repo_id": "text-generation-inference",
"token_count": 1102
} | 278 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 100,
"prefill": [],
"seed": null,
"tokens": [
{
"id": 2721,
"logprob": -0.21582031,
"special": false,
"text": " people"
},
{
"id": 21807,
"... | text-generation-inference/integration-tests/models/__snapshots__/test_transformers_llama4/test_flash_llama4.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_transformers_llama4/test_flash_llama4.json",
"repo_id": "text-generation-inference",
"token_count": 7698
} | 279 |
import pytest
@pytest.fixture(scope="module")
def compressed_tensors_wna16_handle(launcher):
with launcher(
"neuralmagic/gemma-2-2b-it-quantized.w4a16",
num_shard=2,
quantize="compressed-tensors",
) as handle:
yield handle
@pytest.fixture(scope="module")
async def compressed_... | text-generation-inference/integration-tests/models/test_compressed_tensors_wna16_int.py/0 | {
"file_path": "text-generation-inference/integration-tests/models/test_compressed_tensors_wna16_int.py",
"repo_id": "text-generation-inference",
"token_count": 1007
} | 280 |
import pytest
@pytest.fixture(scope="module")
def flash_llama_fp8_kv_cache_handle(launcher):
with launcher(
"neuralmagic/Meta-Llama-3-8B-Instruct-FP8-KV",
num_shard=2,
kv_cache_dtype="fp8_e4m3fn",
) as handle:
yield handle
@pytest.fixture(scope="module")
async def flash_llama... | text-generation-inference/integration-tests/models/test_flash_llama_fp8_kv_cache.py/0 | {
"file_path": "text-generation-inference/integration-tests/models/test_flash_llama_fp8_kv_cache.py",
"repo_id": "text-generation-inference",
"token_count": 986
} | 281 |
import pytest
@pytest.fixture(scope="module")
def flash_phi35_moe_handle(launcher):
with launcher(
"microsoft/Phi-3.5-MoE-instruct",
num_shard=4,
) as handle:
yield handle
@pytest.fixture(scope="module")
async def flash_phi35_moe(flash_phi35_moe_handle):
await flash_phi35_moe_han... | text-generation-inference/integration-tests/models/test_flash_phi35_moe.py/0 | {
"file_path": "text-generation-inference/integration-tests/models/test_flash_phi35_moe.py",
"repo_id": "text-generation-inference",
"token_count": 921
} | 282 |
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
} | 283 |
[pytest]
addopts = --snapshot-warn-unused
asyncio_mode = auto
markers =
private: marks tests as requiring an admin hf token (deselect with '-m "not private"')
| text-generation-inference/integration-tests/pytest.ini/0 | {
"file_path": "text-generation-inference/integration-tests/pytest.ini",
"repo_id": "text-generation-inference",
"token_count": 58
} | 284 |
# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand.
[[package]]
name = "certifi"
version = "2024.8.30"
description = "Python package for providing Mozilla's CA Bundle."
optional = false
python-versions = ">=3.6"
files = [
{file = "certifi-2024.8.30-py3-none-any.whl", hash = "... | text-generation-inference/load_tests/poetry.lock/0 | {
"file_path": "text-generation-inference/load_tests/poetry.lock",
"repo_id": "text-generation-inference",
"token_count": 27378
} | 285 |
// pub(crate) mod v2;
mod chat_template;
pub mod tool_grammar;
use crate::validation::{ValidGenerateRequest, Validation, ValidationError};
use crate::Tool;
use crate::{
ChatTemplateVersions, FinishReason, GenerateRequest, HubProcessorConfig, HubTokenizerConfig,
Message, PrefillToken, Token,
};
use async_stream... | text-generation-inference/router/src/infer/mod.rs/0 | {
"file_path": "text-generation-inference/router/src/infer/mod.rs",
"repo_id": "text-generation-inference",
"token_count": 8233
} | 286 |
exllamav2_commit := v0.1.8
build-exllamav2:
git clone https://github.com/turboderp/exllamav2.git exllamav2 && \
cd exllamav2 && git fetch && git checkout $(exllamav2_commit) && \
git submodule update --init --recursive && \
pip install -r requirements.txt && \
CUDA_ARCH_LIST="8.0;9.0a" NVCC_GENCODE="-gencode=arc... | text-generation-inference/server/Makefile-exllamav2/0 | {
"file_path": "text-generation-inference/server/Makefile-exllamav2",
"repo_id": "text-generation-inference",
"token_count": 302
} | 287 |
#include "q4_matmul.cuh"
#include "column_remap.cuh"
#include <ATen/cuda/CUDAContext.h>
#include "../util.cuh"
#include "../matrix.cuh"
#include "../cu_compat.cuh"
#include "../cuda_buffers.cuh"
#if defined(USE_ROCM)
#include "../hip_compat.cuh"
#endif
const int THREADS_X = 32; // Block size and thread count alo... | text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/q4_matmul.cu/0 | {
"file_path": "text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/q4_matmul.cu",
"repo_id": "text-generation-inference",
"token_count": 4211
} | 288 |
#include "compat.cuh"
__forceinline__ __device__ half2 dot22_8(half2(&dq)[4], const half* a_ptr, const half2 g_result, const half qs_h)
{
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 __hfm... | text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_gemm_kernel.cuh/0 | {
"file_path": "text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_gemm_kernel.cuh",
"repo_id": "text-generation-inference",
"token_count": 11459
} | 289 |
# test_watermark_logits_processor.py
import os
import numpy as np
import torch
from text_generation_server.utils.watermark import WatermarkLogitsProcessor
GAMMA = os.getenv("WATERMARK_GAMMA", 0.5)
DELTA = os.getenv("WATERMARK_DELTA", 2.0)
def test_seed_rng():
input_ids = [101, 2036, 3731, 102, 2003, 103]
p... | text-generation-inference/server/tests/utils/test_watermark.py/0 | {
"file_path": "text-generation-inference/server/tests/utils/test_watermark.py",
"repo_id": "text-generation-inference",
"token_count": 781
} | 290 |
import intel_extension_for_pytorch as ipex
import torch
from text_generation_server.layers.attention.kv_cache import KVCache, KVScales
from text_generation_server.layers.attention import Seqlen
from typing import Optional
from text_generation_server.models.globals import (
ATTENTION,
BLOCK_SIZE,
)
if ATTENTION... | text-generation-inference/server/text_generation_server/layers/attention/ipex.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/layers/attention/ipex.py",
"repo_id": "text-generation-inference",
"token_count": 2563
} | 291 |
from dataclasses import dataclass
from typing import List, Optional, Union
import torch
import torch.nn as nn
from text_generation_server.layers.marlin.util import _check_marlin_kernels
from text_generation_server.utils.import_utils import SYSTEM
from text_generation_server.utils.kernels import load_kernel
from text_... | text-generation-inference/server/text_generation_server/layers/marlin/marlin.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/layers/marlin/marlin.py",
"repo_id": "text-generation-inference",
"token_count": 6121
} | 292 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | text-generation-inference/server/text_generation_server/models/custom_modeling/idefics_processing.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/idefics_processing.py",
"repo_id": "text-generation-inference",
"token_count": 8120
} | 293 |
import torch
import os
from loguru import logger
from typing import Dict, Optional
from text_generation_server.utils.log import log_master
REQUEST_LOGPROBS = os.getenv("REQUEST_LOGPROBS", "0").lower() in {"1", "true"}
ATTENTION = os.environ["ATTENTION"]
# default_prefix_caching = "1" if ATTENTION in {"flashinfer", "f... | text-generation-inference/server/text_generation_server/models/globals.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/globals.py",
"repo_id": "text-generation-inference",
"token_count": 917
} | 294 |
import {
PaddingDirection,
WordPiece,
punctuationPreTokenizer,
sequencePreTokenizer,
whitespacePreTokenizer,
Encoding,
EncodeOptions,
Tokenizer,
} from '../../'
import { InputSequence } from '../../types'
const MOCKS_DIR = __dirname + '/__mocks__'
describe('Can modify pretokenizers on the fly', () => ... | tokenizers/bindings/node/lib/bindings/encoding.test.ts/0 | {
"file_path": "tokenizers/bindings/node/lib/bindings/encoding.test.ts",
"repo_id": "tokenizers",
"token_count": 3020
} | 295 |
{
"name": "tokenizers-freebsd-x64",
"version": "0.13.4-rc1",
"os": [
"freebsd"
],
"cpu": [
"x64"
],
"main": "tokenizers.freebsd-x64.node",
"files": [
"tokenizers.freebsd-x64.node"
],
"description": "Tokenizers platform specific bindings",
"keywords": [
"napi-rs",
"NAPI",
"N... | tokenizers/bindings/node/npm/freebsd-x64/package.json/0 | {
"file_path": "tokenizers/bindings/node/npm/freebsd-x64/package.json",
"repo_id": "tokenizers",
"token_count": 272
} | 296 |
{
"name": "tokenizers-win32-x64-msvc",
"version": "0.13.4-rc1",
"os": [
"win32"
],
"cpu": [
"x64"
],
"main": "tokenizers.win32-x64-msvc.node",
"files": [
"tokenizers.win32-x64-msvc.node"
],
"description": "Tokenizers platform specific bindings",
"keywords": [
"napi-rs",
"NAPI",... | tokenizers/bindings/node/npm/win32-x64-msvc/package.json/0 | {
"file_path": "tokenizers/bindings/node/npm/win32-x64-msvc/package.json",
"repo_id": "tokenizers",
"token_count": 277
} | 297 |
use napi::bindgen_prelude::*;
use napi_derive::napi;
use tokenizers as tk;
use tokenizers::Encoding;
use crate::encoding::JsEncoding;
#[napi]
pub fn slice(s: String, begin_index: Option<i32>, end_index: Option<i32>) -> Result<String> {
let len = s.chars().count();
let get_index = |x: i32| -> usize {
if x >= ... | tokenizers/bindings/node/src/utils.rs/0 | {
"file_path": "tokenizers/bindings/node/src/utils.rs",
"repo_id": "tokenizers",
"token_count": 503
} | 298 |
import argparse
import glob
from os.path import join
from tokenizers import ByteLevelBPETokenizer
parser = argparse.ArgumentParser()
parser.add_argument(
"--files",
default=None,
metavar="path",
type=str,
required=True,
help="The files to use as training; accept '**/*.txt' type of patterns \
... | tokenizers/bindings/python/examples/train_bytelevel_bpe.py/0 | {
"file_path": "tokenizers/bindings/python/examples/train_bytelevel_bpe.py",
"repo_id": "tokenizers",
"token_count": 521
} | 299 |
from .. import normalizers
Normalizer = normalizers.Normalizer
BertNormalizer = normalizers.BertNormalizer
NFD = normalizers.NFD
NFKD = normalizers.NFKD
NFC = normalizers.NFC
NFKC = normalizers.NFKC
Sequence = normalizers.Sequence
Lowercase = normalizers.Lowercase
Prepend = normalizers.Prepend
Strip = normalizers.Str... | tokenizers/bindings/python/py_src/tokenizers/normalizers/__init__.py/0 | {
"file_path": "tokenizers/bindings/python/py_src/tokenizers/normalizers/__init__.py",
"repo_id": "tokenizers",
"token_count": 304
} | 300 |
[isort]
default_section = FIRSTPARTY
ensure_newline_before_comments = True
force_grid_wrap = 0
include_trailing_comma = True
known_first_party = transformers
known_third_party =
absl
conllu
datasets
elasticsearch
fairseq
faiss-cpu
fastprogress
fire
fugashi
git
h5py
matplo... | tokenizers/bindings/python/setup.cfg/0 | {
"file_path": "tokenizers/bindings/python/setup.cfg",
"repo_id": "tokenizers",
"token_count": 386
} | 301 |
use pyo3::exceptions;
use pyo3::prelude::*;
use tk::utils::SysRegex;
/// Instantiate a new Regex with the given pattern
#[pyclass(module = "tokenizers", name = "Regex")]
pub struct PyRegex {
pub inner: SysRegex,
pub pattern: String,
}
#[pymethods]
impl PyRegex {
#[new]
#[pyo3(text_signature = "(self, ... | tokenizers/bindings/python/src/utils/regex.rs/0 | {
"file_path": "tokenizers/bindings/python/src/utils/regex.rs",
"repo_id": "tokenizers",
"token_count": 273
} | 302 |
from tokenizers import Tokenizer
from ..utils import data_dir, doc_wiki_tokenizer
disable_printing = True
original_print = print
def print(*args, **kwargs):
if not disable_printing:
original_print(*args, **kwargs)
class TestQuicktour:
# This method contains everything we don't want to run
@sta... | tokenizers/bindings/python/tests/documentation/test_quicktour.py/0 | {
"file_path": "tokenizers/bindings/python/tests/documentation/test_quicktour.py",
"repo_id": "tokenizers",
"token_count": 3290
} | 303 |
# Encoding
<tokenizerslangcontent>
<python>
## Encoding
[[autodoc]] tokenizers.Encoding
- all
- attention_mask
- ids
- n_sequences
- offsets
- overflowing
- sequence_ids
- special_tokens_mask
- tokens
- type_ids
- word_ids
- words
</python>
<rust>
The Rust API Reference... | tokenizers/docs/source-doc-builder/api/encoding.mdx/0 | {
"file_path": "tokenizers/docs/source-doc-builder/api/encoding.mdx",
"repo_id": "tokenizers",
"token_count": 190
} | 304 |
from docutils import nodes
import sphinx
from sphinx.locale import _
from conf import rust_version
logger = sphinx.util.logging.getLogger(__name__)
class RustRef:
def __call__(self, name, rawtext, text, lineno, inliner, options={}, content=[]):
doctype = name.split("_")[1]
parts = text.split(":... | tokenizers/docs/source/_ext/rust_doc.py/0 | {
"file_path": "tokenizers/docs/source/_ext/rust_doc.py",
"repo_id": "tokenizers",
"token_count": 1221
} | 305 |
Tokenizers
====================================================================================================
Fast State-of-the-art tokenizers, optimized for both research and production
`🤗 Tokenizers`_ provides an implementation of today's most used tokenizers, with
a focus on performance and versatility. These t... | tokenizers/docs/source/index.rst/0 | {
"file_path": "tokenizers/docs/source/index.rst",
"repo_id": "tokenizers",
"token_count": 404
} | 306 |
use std::time::{Duration, Instant};
use std::hint::black_box;
use tokenizers::{
Decoder, EncodeInput, Model, Normalizer, PostProcessor, PreTokenizer, TokenizerImpl, Trainer,
};
#[allow(dead_code)]
pub fn iter_bench_encode<M, N, PT, PP, D>(
iters: u64,
tokenizer: &TokenizerImpl<M, N, PT, PP, D>,
lines... | tokenizers/tokenizers/benches/common/mod.rs/0 | {
"file_path": "tokenizers/tokenizers/benches/common/mod.rs",
"repo_id": "tokenizers",
"token_count": 942
} | 307 |
use crate::tokenizer::{Decoder, Result};
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Clone, Debug, Serialize)]
/// The WordPiece decoder takes care of decoding a list of wordpiece tokens
/// back into a readable string.
#[serde(tag = "type")]
#[non_exhaustive]
pub struct WordPiece {
/// The prefix ... | tokenizers/tokenizers/src/decoders/wordpiece.rs/0 | {
"file_path": "tokenizers/tokenizers/src/decoders/wordpiece.rs",
"repo_id": "tokenizers",
"token_count": 1159
} | 308 |
use super::WordLevel;
use crate::utils::parallelism::*;
use crate::{AddedToken, Result, Trainer};
use ahash::AHashMap;
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;
#[non_exhaustive]
#[derive(Debug, Clone, Builder, Serialize, Deserialize)]
pub struct WordLevelTrainer {
/// The minimum frequency a wo... | tokenizers/tokenizers/src/models/wordlevel/trainer.rs/0 | {
"file_path": "tokenizers/tokenizers/src/models/wordlevel/trainer.rs",
"repo_id": "tokenizers",
"token_count": 2720
} | 309 |
use serde::{Deserialize, Serialize};
use crate::tokenizer::{PreTokenizedString, PreTokenizer, Result, SplitDelimiterBehavior};
use crate::utils::macro_rules_attribute;
#[derive(Clone, Debug, PartialEq, Eq)]
/// Pre tokenizes the numbers into single tokens. If individual_digits is set
/// to true, then all digits are ... | tokenizers/tokenizers/src/pre_tokenizers/digits.rs/0 | {
"file_path": "tokenizers/tokenizers/src/pre_tokenizers/digits.rs",
"repo_id": "tokenizers",
"token_count": 1667
} | 310 |
use super::{
normalizer::Range, Model, NormalizedString, Normalizer, Offsets, PreTokenizedString, Token,
};
use ahash::{AHashMap, AHashSet};
use aho_corasick::{AhoCorasick, AhoCorasickBuilder, MatchKind};
use regex::Regex;
use serde::{ser::SerializeSeq, Deserialize, Serialize, Serializer};
use std::sync::LazyLock;
... | tokenizers/tokenizers/src/tokenizer/added_vocabulary.rs/0 | {
"file_path": "tokenizers/tokenizers/src/tokenizer/added_vocabulary.rs",
"repo_id": "tokenizers",
"token_count": 17713
} | 311 |
use crate::tokenizer::{Encoding, Result};
use serde::{Deserialize, Serialize};
use std::cmp;
use std::mem;
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Eq, Default)]
pub enum TruncationDirection {
Left,
#[default]
Right,
}
impl std::convert::AsRef<str> for TruncationDirection {
fn a... | tokenizers/tokenizers/src/utils/truncation.rs/0 | {
"file_path": "tokenizers/tokenizers/src/utils/truncation.rs",
"repo_id": "tokenizers",
"token_count": 5474
} | 312 |
By default, Transformers.js uses [hosted pretrained models](https://huggingface.co/models?library=transformers.js) and [precompiled WASM binaries](https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.2/dist/), which should work out-of-the-box. You can customize this as follows:
### Settings
```javascript
impo... | transformers.js/docs/snippets/4_custom-usage.snippet/0 | {
"file_path": "transformers.js/docs/snippets/4_custom-usage.snippet",
"repo_id": "transformers.js",
"token_count": 588
} | 313 |
# Server-side Inference in Node.js
Although Transformers.js was originally designed to be used in the browser, it's also able to run inference on the server. In this tutorial, we will design a simple Node.js API that uses Transformers.js for sentiment analysis.
We'll also show you how to use the library in both Comm... | transformers.js/docs/source/tutorials/node.md/0 | {
"file_path": "transformers.js/docs/source/tutorials/node.md",
"repo_id": "transformers.js",
"token_count": 2271
} | 314 |
@charset "UTF-8";
/*!
* Start Bootstrap - Business Frontpage v5.0.7 (https://startbootstrap.com/template/business-frontpage)
* Copyright 2013-2021 Start Bootstrap
* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-business-frontpage/blob/master/LICENSE)
*/
/*!
* Bootstrap v5.1.3 (https://getbootst... | transformers.js/examples/demo-site/src/theme.css/0 | {
"file_path": "transformers.js/examples/demo-site/src/theme.css",
"repo_id": "transformers.js",
"token_count": 109692
} | 315 |
import path from 'path';
import { fileURLToPath } from 'url';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import CopyPlugin from 'copy-webpack-plugin';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const config = {
mode: 'development',
devtool: 'inline-source-map',
entry: {
... | transformers.js/examples/extension/webpack.config.js/0 | {
"file_path": "transformers.js/examples/extension/webpack.config.js",
"repo_id": "transformers.js",
"token_count": 580
} | 316 |
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
}
}
| transformers.js/examples/next-server/jsconfig.json/0 | {
"file_path": "transformers.js/examples/next-server/jsconfig.json",
"repo_id": "transformers.js",
"token_count": 44
} | 317 |
import Scatterplot from 'deepscatter';
import { getCachedJSON } from './utils';
// Start loading metadata and positions asynchronously as soon as possible.
let metadata = {};
getCachedJSON('https://huggingface.co/datasets/Xenova/MusicBenchEmbedded/resolve/main/metadata.json')
.then((data) => {
metadata = ... | transformers.js/examples/semantic-audio-search/index.js/0 | {
"file_path": "transformers.js/examples/semantic-audio-search/index.js",
"repo_id": "transformers.js",
"token_count": 1844
} | 318 |
'use client'
import Image from 'next/image'
import { blurHashToDataURL } from '../utils.js'
export function ImageGrid({ images, setCurrentImage }) {
return (
<div className="columns-2 gap-4 sm:columns-3 xl:columns-4 2xl:columns-5">
{images && images.map(({ id, url, ar, blur }) => (
... | transformers.js/examples/semantic-image-search-client/src/app/components/ImageGrid.jsx/0 | {
"file_path": "transformers.js/examples/semantic-image-search-client/src/app/components/ImageGrid.jsx",
"repo_id": "transformers.js",
"token_count": 791
} | 319 |
/** @type {import('next').NextConfig} */
const nextConfig = {
// (Optional) Export as a standalone site
// See https://nextjs.org/docs/pages/api-reference/next-config-js/output#automatically-copying-traced-files
output: 'standalone', // Feel free to modify/remove this option
// Indicate that these pack... | transformers.js/examples/semantic-image-search/next.config.js/0 | {
"file_path": "transformers.js/examples/semantic-image-search/next.config.js",
"repo_id": "transformers.js",
"token_count": 207
} | 320 |
import { decode } from "blurhash"
const SIZE = 32;
export function blurHashToDataURL(hash) {
if (!hash) return undefined
const pixels = decode(hash, SIZE, SIZE)
const canvas = document.createElement("canvas");
canvas.width = SIZE;
canvas.height = SIZE;
const ctx = canvas.getContext("2d");
... | transformers.js/examples/semantic-image-search/src/app/utils.js/0 | {
"file_path": "transformers.js/examples/semantic-image-search/src/app/utils.js",
"repo_id": "transformers.js",
"token_count": 500
} | 321 |
import json
import os
import shutil
from dataclasses import dataclass, field, asdict
from typing import Optional
from enum import Enum
from transformers import (
AutoConfig,
AutoTokenizer,
HfArgumentParser
)
import onnxslim
from optimum.exporters.onnx import main_export, export_models
from optimum.onnx.g... | transformers.js/scripts/convert.py/0 | {
"file_path": "transformers.js/scripts/convert.py",
"repo_id": "transformers.js",
"token_count": 6977
} | 322 |
import { FEATURE_EXTRACTOR_NAME } from "../utils/constants.js";
import { Callable } from "../utils/generic.js";
import { getModelJSON } from "../utils/hub.js";
/**
* Base class for feature extractors.
*/
export class FeatureExtractor extends Callable {
/**
* Constructs a new FeatureExtractor instance.
... | transformers.js/src/base/feature_extraction_utils.js/0 | {
"file_path": "transformers.js/src/base/feature_extraction_utils.js",
"repo_id": "transformers.js",
"token_count": 823
} | 323 |
import {
ImageProcessor,
} from "../../base/image_processors_utils.js";
export class BeitFeatureExtractor extends ImageProcessor { }
| transformers.js/src/models/beit/image_processing_beit.js/0 | {
"file_path": "transformers.js/src/models/beit/image_processing_beit.js",
"repo_id": "transformers.js",
"token_count": 44
} | 324 |
import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';
import { full, Tensor } from '../../utils/tensor.js';
import { mel_filter_bank, spectrogram, window_function } from '../../utils/audio.js';
export class Gemma3nAudioFeatureExtractor extends FeatureExtractor {
constru... | transformers.js/src/models/gemma3n/feature_extraction_gemma3n.js/0 | {
"file_path": "transformers.js/src/models/gemma3n/feature_extraction_gemma3n.js",
"repo_id": "transformers.js",
"token_count": 1819
} | 325 |
import { Processor } from "../../base/processing_utils.js";
import { AutoImageProcessor } from "../auto/image_processing_auto.js";
import { AutoTokenizer } from "../../tokenizers.js";
import { max, softmax } from "../../utils/maths.js";
const DECODE_TYPE_MAPPING = {
'char': ['char_decode', 1],
'bpe': ['bpe_dec... | transformers.js/src/models/mgp_str/processing_mgp_str.js/0 | {
"file_path": "transformers.js/src/models/mgp_str/processing_mgp_str.js",
"repo_id": "transformers.js",
"token_count": 2810
} | 326 |
import {
ImageProcessor,
} from "../../base/image_processors_utils.js";
export class PvtImageProcessor extends ImageProcessor { }
| transformers.js/src/models/pvt/image_processing_pvt.js/0 | {
"file_path": "transformers.js/src/models/pvt/image_processing_pvt.js",
"repo_id": "transformers.js",
"token_count": 44
} | 327 |
import { Processor } from "../../base/processing_utils.js";
import { AutoTokenizer } from "../../tokenizers.js";
import { AutoFeatureExtractor } from "../auto/feature_extraction_auto.js";
export class SpeechT5Processor extends Processor {
static tokenizer_class = AutoTokenizer
static feature_extractor_class = ... | transformers.js/src/models/speecht5/processing_speecht5.js/0 | {
"file_path": "transformers.js/src/models/speecht5/processing_speecht5.js",
"repo_id": "transformers.js",
"token_count": 206
} | 328 |
import { createInferenceSession, isONNXProxy } from "../backends/onnx.js";
import { Tensor } from "../utils/tensor.js";
import { apis } from "../env.js";
const IS_WEB_ENV = apis.IS_BROWSER_ENV || apis.IS_WEBWORKER_ENV;
/**
* Asynchronously creates a wrapper function for running an ONNX inference session.
*
* @param... | transformers.js/src/ops/registry.js/0 | {
"file_path": "transformers.js/src/ops/registry.js",
"repo_id": "transformers.js",
"token_count": 3856
} | 329 |
import { RawImage } from "../src/transformers.js";
const BASE_URL = "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/";
const TEST_IMAGES = Object.freeze({
white_image: BASE_URL + "white-image.png",
blue_image: BASE_URL + "blue-image.png",
pattern_3x3: BASE_URL + "pattern_3x3.png",
pat... | transformers.js/tests/asset_cache.js/0 | {
"file_path": "transformers.js/tests/asset_cache.js",
"repo_id": "transformers.js",
"token_count": 904
} | 330 |
import { EsmTokenizer } from "../../../src/tokenizers.js";
import { BASE_TEST_STRINGS, ESM_TEST_STRINGS } from "../test_strings.js";
export const TOKENIZER_CLASS = EsmTokenizer;
export const TEST_CONFIG = {
"Xenova/nucleotide-transformer-500m-human-ref": {
SIMPLE: {
text: BASE_TEST_STRINGS.SIMPLE,
//... | transformers.js/tests/models/esm/test_tokenization_esm.js/0 | {
"file_path": "transformers.js/tests/models/esm/test_tokenization_esm.js",
"repo_id": "transformers.js",
"token_count": 6890
} | 331 |
import { GroundingDinoProcessor, GroundingDinoForObjectDetection, RawImage } 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 () => {
const text = "a cat."; // NB: text query needs to be l... | transformers.js/tests/models/grounding_dino/test_modeling_grounding_dino.js/0 | {
"file_path": "transformers.js/tests/models/grounding_dino/test_modeling_grounding_dino.js",
"repo_id": "transformers.js",
"token_count": 684
} | 332 |
import { EncodecFeatureExtractor, MimiModel, MimiEncoderModel, MimiDecoderModel } 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("MimiModel", () => {
const model_id ... | transformers.js/tests/models/mimi/test_modeling_mimi.js/0 | {
"file_path": "transformers.js/tests/models/mimi/test_modeling_mimi.js",
"repo_id": "transformers.js",
"token_count": 1199
} | 333 |
import { AutoProcessor, PaliGemmaProcessor } from "../../../src/transformers.js";
import { load_cached_image } from "../../asset_cache.js";
import { MAX_PROCESSOR_LOAD_TIME, MAX_TEST_EXECUTION_TIME } from "../../init.js";
export default () => {
const model_id = "hf-internal-testing/tiny-random-PaliGemmaForCondition... | transformers.js/tests/models/paligemma/test_processor_paligemma.js/0 | {
"file_path": "transformers.js/tests/models/paligemma/test_processor_paligemma.js",
"repo_id": "transformers.js",
"token_count": 709
} | 334 |
import { pipeline, AutomaticSpeechRecognitionPipeline } 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 = "automatic-speech-recognition";
export default () => {
describe("Automatic Speech R... | transformers.js/tests/pipelines/test_pipelines_automatic_speech_recognition.js/0 | {
"file_path": "transformers.js/tests/pipelines/test_pipelines_automatic_speech_recognition.js",
"repo_id": "transformers.js",
"token_count": 2373
} | 335 |
import { pipeline, TextGenerationPipeline } 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 = "text-generation";
export default () => {
describe("Text Generation", () => {
const model_i... | transformers.js/tests/pipelines/test_pipelines_text_generation.js/0 | {
"file_path": "transformers.js/tests/pipelines/test_pipelines_text_generation.js",
"repo_id": "transformers.js",
"token_count": 1603
} | 336 |
# Copyright 2025 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... | transformers/benchmark/benches/llama.py/0 | {
"file_path": "transformers/benchmark/benches/llama.py",
"repo_id": "transformers",
"token_count": 6303
} | 337 |
FROM python:3.9-slim
ENV PYTHONDONTWRITEBYTECODE=1
ARG REF=main
USER root
RUN apt-get update && apt-get install -y libsndfile1-dev espeak-ng time git libgl1-mesa-glx libgl1 g++ tesseract-ocr
ENV UV_PYTHON=/usr/local/bin/python
RUN pip --no-cache-dir install uv && uv pip install --no-cache-dir -U pip setuptools
RUN uv p... | transformers/docker/exotic-models.dockerfile/0 | {
"file_path": "transformers/docker/exotic-models.dockerfile",
"repo_id": "transformers",
"token_count": 477
} | 338 |
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-23-11.html#rel-23-11
FROM nvcr.io/nvidia/pytorch:24.08-py3
LABEL maintainer="Hugging Face"
ARG DEBIAN_FRONTEND=noninteractive
# Example: `cu102`, `cu113`, etc.
ARG CUDA='cu126'
RUN apt -y update
RUN apt install -y libaio-dev
RUN python3 -m p... | transformers/docker/transformers-pytorch-deepspeed-nightly-gpu/Dockerfile/0 | {
"file_path": "transformers/docker/transformers-pytorch-deepspeed-nightly-gpu/Dockerfile",
"repo_id": "transformers",
"token_count": 1118
} | 339 |
# تحميل نماذج مدربة مسبقًا باستخدام AutoClass
لم ترغب في إنشاء محول معماري لمؤشر الترابط الخاص بك، فهناك العديد من محولات المعمارية المختلفة التي يمكنك الاختيار من بينها. كجزء من الفلسفة الأساسية لـ 🤗 Transformers لجعل المكتبة سهلة وبسيطة ومرنة، فإن فئة `AutoClass` تستدل تلقائيًا وتحمّل البنية الصحيحة من نسخة نموذج (M... | transformers/docs/source/ar/autoclass_tutorial.md/0 | {
"file_path": "transformers/docs/source/ar/autoclass_tutorial.md",
"repo_id": "transformers",
"token_count": 5440
} | 340 |
# شارك نموذجك مع العالم
أظهرت آخر درسين تعليميين كيفية ضبط نموذج بدقة باستخدام PyTorch و Keras و 🤗 Accelerate لعمليات التهيئة الموزعة. والخطوة التالية هي مشاركة نموذجك مع المجتمع! في Hugging Face، نؤمن بالمشاركة المفتوحة للمعرفة والموارد لتمكين الجميع من الاستفادة من الذكاء الاصطناعي. ونشجعك على مشاركة نموذجك مع المج... | transformers/docs/source/ar/model_sharing.md/0 | {
"file_path": "transformers/docs/source/ar/model_sharing.md",
"repo_id": "transformers",
"token_count": 6703
} | 341 |
# ما الذي تستطيع مكتبة 🤗 Transformers القيام به؟
مكتبة 🤗 Transformers هي مجموعة من النماذج المُدرّبة مسبقًا الأفضل في فئتها لمهام معالجة اللغة الطبيعية (NLP)، ورؤية الحاسوب، ومعالجة الصوت والكلام. لا تحتوي المكتبة فقط على نماذج المحولات (Transformer) فحسب، بل تشمل أيضًا نماذج أخرى لا تعتمد على المحولات مثل الشبكات ا... | transformers/docs/source/ar/task_summary.md/0 | {
"file_path": "transformers/docs/source/ar/task_summary.md",
"repo_id": "transformers",
"token_count": 14746
} | 342 |
# استكشاف الأخطاء وإصلاحها
تحدث الأخطاء أحيانًا، لكننا هنا للمساعدة! يغطي هذا الدليل بعض المشكلات الأكثر شيوعًا التي واجهناها وكيفية حلها. مع ذلك، لا يُقصد بهذا الدليل أن يكون مجموعة شاملة لكل مشكلات 🤗 Transformers. لمزيد من المساعدة في استكشاف مشكلتك وإصلاحها، جرب ما يلي:
<Youtube id="S2EEG3JIt2A"/>
1. اطلب المساع... | transformers/docs/source/ar/troubleshooting.md/0 | {
"file_path": "transformers/docs/source/ar/troubleshooting.md",
"repo_id": "transformers",
"token_count": 5400
} | 343 |
<!--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/quicktour.md/0 | {
"file_path": "transformers/docs/source/de/quicktour.md",
"repo_id": "transformers",
"token_count": 7321
} | 344 |
<!--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/chat_extras.md/0 | {
"file_path": "transformers/docs/source/en/chat_extras.md",
"repo_id": "transformers",
"token_count": 2916
} | 345 |
<!--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/generation_strategies.md/0 | {
"file_path": "transformers/docs/source/en/generation_strategies.md",
"repo_id": "transformers",
"token_count": 9148
} | 346 |
<!--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/model_doc/align.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/align.md",
"repo_id": "transformers",
"token_count": 2175
} | 347 |
<!--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/bert.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/bert.md",
"repo_id": "transformers",
"token_count": 1493
} | 348 |
<!--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/camembert.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/camembert.md",
"repo_id": "transformers",
"token_count": 1735
} | 349 |
<!--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/convbert.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/convbert.md",
"repo_id": "transformers",
"token_count": 1101
} | 350 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.