text stringlengths 5 409k | id stringlengths 14 178 | metadata dict | __index_level_0__ int64 0 572 |
|---|---|---|---|
# Copyright 2024 Susung Hong and 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 requi... | diffusers/src/diffusers/pipelines/stable_diffusion_sag/pipeline_stable_diffusion_sag.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_sag/pipeline_stable_diffusion_sag.py",
"repo_id": "diffusers",
"token_count": 21760
} | 128 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py",
"repo_id": "diffusers",
"token_count": 13992
} | 129 |
# Copyright (c) 2023 Dominic Rampas MIT License
# 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/licen... | diffusers/src/diffusers/pipelines/wuerstchen/modeling_wuerstchen_diffnext.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/wuerstchen/modeling_wuerstchen_diffnext.py",
"repo_id": "diffusers",
"token_count": 5544
} | 130 |
# Copyright 2024 UC Berkeley Team and 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 ... | diffusers/src/diffusers/schedulers/scheduling_ddpm.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_ddpm.py",
"repo_id": "diffusers",
"token_count": 11158
} | 131 |
# Copyright 2024 Stability AI, Katherine Crowson and 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-... | diffusers/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py",
"repo_id": "diffusers",
"token_count": 9834
} | 132 |
# Copyright 2024 Stanford University Team and 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
#
#... | diffusers/src/diffusers/schedulers/scheduling_tcd.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_tcd.py",
"repo_id": "diffusers",
"token_count": 14693
} | 133 |
# This file is autogenerated by the command `make fix-copies`, do not edit.
from ..utils import DummyObject, requires_backends
class HookRegistry(metaclass=DummyObject):
_backends = ["torch"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch"])
@classmethod
def from_config... | diffusers/src/diffusers/utils/dummy_pt_objects.py/0 | {
"file_path": "diffusers/src/diffusers/utils/dummy_pt_objects.py",
"repo_id": "diffusers",
"token_count": 20374
} | 134 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/utils/outputs.py/0 | {
"file_path": "diffusers/src/diffusers/utils/outputs.py",
"repo_id": "diffusers",
"token_count": 2035
} | 135 |
import os
import tempfile
import unittest
import torch
from diffusers.loaders.lora_base import LoraBaseMixin
class UtilityMethodDeprecationTests(unittest.TestCase):
def test_fetch_state_dict_cls_method_raises_warning(self):
state_dict = torch.nn.Linear(3, 3).state_dict()
with self.assertWarns(Fu... | diffusers/tests/lora/test_deprecated_utilities.py/0 | {
"file_path": "diffusers/tests/lora/test_deprecated_utilities.py",
"repo_id": "diffusers",
"token_count": 740
} | 136 |
# 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... | diffusers/tests/models/autoencoders/test_models_autoencoder_hunyuan_video.py/0 | {
"file_path": "diffusers/tests/models/autoencoders/test_models_autoencoder_hunyuan_video.py",
"repo_id": "diffusers",
"token_count": 3393
} | 137 |
# 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... | diffusers/tests/models/transformers/test_models_transformer_lumina2.py/0 | {
"file_path": "diffusers/tests/models/transformers/test_models_transformer_lumina2.py",
"repo_id": "diffusers",
"token_count": 1221
} | 138 |
# 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... | diffusers/tests/models/unets/test_unet_blocks_common.py/0 | {
"file_path": "diffusers/tests/models/unets/test_unet_blocks_common.py",
"repo_id": "diffusers",
"token_count": 1805
} | 139 |
import unittest
import numpy as np
import torch
from transformers import AutoTokenizer, UMT5EncoderModel
from diffusers import AuraFlowPipeline, AuraFlowTransformer2DModel, AutoencoderKL, FlowMatchEulerDiscreteScheduler
from ..test_pipelines_common import (
PipelineTesterMixin,
check_qkv_fusion_matches_attn_... | diffusers/tests/pipelines/aura_flow/test_pipeline_aura_flow.py/0 | {
"file_path": "diffusers/tests/pipelines/aura_flow/test_pipeline_aura_flow.py",
"repo_id": "diffusers",
"token_count": 2297
} | 140 |
# 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... | diffusers/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py/0 | {
"file_path": "diffusers/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py",
"repo_id": "diffusers",
"token_count": 3184
} | 141 |
# 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... | diffusers/tests/pipelines/deepfloyd_if/test_if_inpainting_superresolution.py/0 | {
"file_path": "diffusers/tests/pipelines/deepfloyd_if/test_if_inpainting_superresolution.py",
"repo_id": "diffusers",
"token_count": 2555
} | 142 |
# 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... | diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_img2img.py",
"repo_id": "diffusers",
"token_count": 4477
} | 143 |
# Copyright 2024 The HuggingFace 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 law or agreed to in... | diffusers/tests/pipelines/mochi/test_mochi.py/0 | {
"file_path": "diffusers/tests/pipelines/mochi/test_mochi.py",
"repo_id": "diffusers",
"token_count": 4994
} | 144 |
import inspect
import unittest
import numpy as np
import torch
from transformers import AutoTokenizer, CLIPTextConfig, CLIPTextModelWithProjection, CLIPTokenizer, T5EncoderModel
from diffusers import (
AutoencoderKL,
FlowMatchEulerDiscreteScheduler,
SD3Transformer2DModel,
StableDiffusion3PAGPipeline,
... | diffusers/tests/pipelines/pag/test_pag_sd3.py/0 | {
"file_path": "diffusers/tests/pipelines/pag/test_pag_sd3.py",
"repo_id": "diffusers",
"token_count": 5329
} | 145 |
# 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... | diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 6756
} | 146 |
# 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... | diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_latent_upscale.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_latent_upscale.py",
"repo_id": "diffusers",
"token_count": 5933
} | 147 |
# 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... | diffusers/tests/pipelines/text_to_video_synthesis/test_video_to_video.py/0 | {
"file_path": "diffusers/tests/pipelines/text_to_video_synthesis/test_video_to_video.py",
"repo_id": "diffusers",
"token_count": 3629
} | 148 |
# coding=utf-8
# 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 requir... | diffusers/tests/quantization/torchao/test_torchao.py/0 | {
"file_path": "diffusers/tests/quantization/torchao/test_torchao.py",
"repo_id": "diffusers",
"token_count": 17851
} | 149 |
import torch
from diffusers import EulerAncestralDiscreteScheduler
from diffusers.utils.testing_utils import torch_device
from .test_schedulers import SchedulerCommonTest
class EulerAncestralDiscreteSchedulerTest(SchedulerCommonTest):
scheduler_classes = (EulerAncestralDiscreteScheduler,)
num_inference_step... | diffusers/tests/schedulers/test_scheduler_euler_ancestral.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_euler_ancestral.py",
"repo_id": "diffusers",
"token_count": 2492
} | 150 |
import gc
import tempfile
import unittest
import torch
from diffusers import (
StableDiffusionXLAdapterPipeline,
T2IAdapter,
)
from diffusers.loaders.single_file_utils import _extract_repo_id_and_weights_name
from diffusers.utils import load_image
from diffusers.utils.testing_utils import (
backend_empty_... | diffusers/tests/single_file/test_stable_diffusion_xl_adapter_single_file.py/0 | {
"file_path": "diffusers/tests/single_file/test_stable_diffusion_xl_adapter_single_file.py",
"repo_id": "diffusers",
"token_count": 3851
} | 151 |
# coding=utf-8
# Copyright 2025 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... | diffusers/utils/get_modified_files.py/0 | {
"file_path": "diffusers/utils/get_modified_files.py",
"repo_id": "diffusers",
"token_count": 435
} | 152 |
# Using the [SO-100](https://github.com/TheRobotStudio/SO-ARM100) with LeRobot
## Table of Contents
- [A. Source the parts](#a-source-the-parts)
- [B. Install LeRobot](#b-install-lerobot)
- [C. Configure the motors](#c-configure-the-motors)
- [D. Assemble the arms](#d-assemble-the-arms)
- [E. Calibrate](#e-... | lerobot/examples/10_use_so100.md/0 | {
"file_path": "lerobot/examples/10_use_so100.md",
"repo_id": "lerobot",
"token_count": 6383
} | 153 |
#!/usr/bin/env python
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | lerobot/lerobot/common/datasets/compute_stats.py/0 | {
"file_path": "lerobot/lerobot/common/datasets/compute_stats.py",
"repo_id": "lerobot",
"token_count": 4000
} | 154 |
#!/usr/bin/env python
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | lerobot/lerobot/common/datasets/push_dataset_to_hub/_download_raw.py/0 | {
"file_path": "lerobot/lerobot/common/datasets/push_dataset_to_hub/_download_raw.py",
"repo_id": "lerobot",
"token_count": 4911
} | 155 |
#!/usr/bin/env python
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | lerobot/lerobot/common/datasets/video_utils.py/0 | {
"file_path": "lerobot/lerobot/common/datasets/video_utils.py",
"repo_id": "lerobot",
"token_count": 4362
} | 156 |
from dataclasses import dataclass, field
from lerobot.common.optim.optimizers import AdamWConfig
from lerobot.common.optim.schedulers import (
CosineDecayWithWarmupSchedulerConfig,
)
from lerobot.configs.policies import PreTrainedConfig
from lerobot.configs.types import FeatureType, NormalizationMode, PolicyFeatur... | lerobot/lerobot/common/policies/pi0/configuration_pi0.py/0 | {
"file_path": "lerobot/lerobot/common/policies/pi0/configuration_pi0.py",
"repo_id": "lerobot",
"token_count": 1875
} | 157 |
"""
This file contains utilities for recording frames from Intel Realsense cameras.
"""
import argparse
import concurrent.futures
import logging
import math
import shutil
import threading
import time
import traceback
from collections import Counter
from pathlib import Path
from threading import Thread
import numpy as... | lerobot/lerobot/common/robot_devices/cameras/intelrealsense.py/0 | {
"file_path": "lerobot/lerobot/common/robot_devices/cameras/intelrealsense.py",
"repo_id": "lerobot",
"token_count": 8222
} | 158 |
#!/usr/bin/env python
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | lerobot/lerobot/common/utils/benchmark.py/0 | {
"file_path": "lerobot/lerobot/common/utils/benchmark.py",
"repo_id": "lerobot",
"token_count": 1033
} | 159 |
"""
Utilities to control a robot.
Useful to record a dataset, replay a recorded episode, run the policy on your robot
and record an evaluation dataset, and to recalibrate your robot if needed.
Examples of usage:
- Recalibrate your robot:
```bash
python lerobot/scripts/control_robot.py \
--robot.type=so100 \
... | lerobot/lerobot/scripts/control_robot.py/0 | {
"file_path": "lerobot/lerobot/scripts/control_robot.py",
"repo_id": "lerobot",
"token_count": 4895
} | 160 |
[project.urls]
homepage = "https://github.com/huggingface/lerobot"
issues = "https://github.com/huggingface/lerobot/issues"
discord = "https://discord.gg/s3KuuzsPFb"
[project]
name = "lerobot"
version = "0.1.0"
description = "🤗 LeRobot: State-of-the-art Machine Learning for Real-World Robotics in Pytorch"
authors = [... | lerobot/pyproject.toml/0 | {
"file_path": "lerobot/pyproject.toml",
"repo_id": "lerobot",
"token_count": 1720
} | 161 |
version https://git-lfs.github.com/spec/v1
oid sha256:24150994c6959631dc081b43e4001a8664e13b194ac194a32100f7d3fd2c0d0f
size 85353
| lerobot/tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_1.safetensors/0 | {
"file_path": "lerobot/tests/data/save_dataset_to_safetensors/lerobot/xarm_lift_medium/frame_1.safetensors",
"repo_id": "lerobot",
"token_count": 65
} | 162 |
version https://git-lfs.github.com/spec/v1
oid sha256:c9007dd51c748db4ecd6d75e70bdcabf8c312454ac97bf6710895a12e7288557
size 31672
| lerobot/tests/data/save_policy_to_safetensors/dora_aloha_real_act_aloha_real/grad_stats.safetensors/0 | {
"file_path": "lerobot/tests/data/save_policy_to_safetensors/dora_aloha_real_act_aloha_real/grad_stats.safetensors",
"repo_id": "lerobot",
"token_count": 62
} | 163 |
import random
from pathlib import Path
from unittest.mock import patch
import datasets
import numpy as np
import PIL.Image
import pytest
import torch
from lerobot.common.datasets.lerobot_dataset import CODEBASE_VERSION, LeRobotDataset, LeRobotDatasetMetadata
from lerobot.common.datasets.utils import (
DEFAULT_CHU... | lerobot/tests/fixtures/dataset_factories.py/0 | {
"file_path": "lerobot/tests/fixtures/dataset_factories.py",
"repo_id": "lerobot",
"token_count": 6830
} | 164 |
import pytest
import torch
from datasets import Dataset
from lerobot.common.datasets.utils import (
calculate_episode_data_index,
check_delta_timestamps,
check_timestamps_sync,
get_delta_indices,
hf_transform_to_torch,
)
from tests.fixtures.constants import DUMMY_MOTOR_FEATURES
@pytest.fixture(sc... | lerobot/tests/test_delta_timestamps.py/0 | {
"file_path": "lerobot/tests/test_delta_timestamps.py",
"repo_id": "lerobot",
"token_count": 4146
} | 165 |
from pathlib import Path
from unittest.mock import Mock, patch
from lerobot.common.constants import (
CHECKPOINTS_DIR,
LAST_CHECKPOINT_LINK,
OPTIMIZER_PARAM_GROUPS,
OPTIMIZER_STATE,
RNG_STATE,
SCHEDULER_STATE,
TRAINING_STATE_DIR,
TRAINING_STEP,
)
from lerobot.common.utils.train_utils im... | lerobot/tests/test_train_utils.py/0 | {
"file_path": "lerobot/tests/test_train_utils.py",
"repo_id": "lerobot",
"token_count": 1084
} | 166 |
import argparse
import asyncio
import hashlib
import json
import os
import random
from asyncio import Lock
from typing import Set
from datasets import load_dataset
from tqdm.asyncio import tqdm
import aiofiles
import aiohttp
import uvloop
file_lock = Lock()
async def generate_completion(session, prompt, args):
... | open-r1/scripts/generate_reasoning.py/0 | {
"file_path": "open-r1/scripts/generate_reasoning.py",
"repo_id": "open-r1",
"token_count": 2800
} | 167 |
# 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... | open-r1/src/open_r1/grpo.py/0 | {
"file_path": "open-r1/src/open_r1/grpo.py",
"repo_id": "open-r1",
"token_count": 4025
} | 168 |
<!--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... | peft/docs/source/developer_guides/low_level_api.md/0 | {
"file_path": "peft/docs/source/developer_guides/low_level_api.md",
"repo_id": "peft",
"token_count": 1653
} | 169 |
<!--⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.
-->
# Helper methods
A collection of helper functions for PEFT.
## Checking if a model is a PEFT model
[[autodoc]] helpers.check_if_peft_model
- a... | peft/docs/source/package_reference/helpers.md/0 | {
"file_path": "peft/docs/source/package_reference/helpers.md",
"repo_id": "peft",
"token_count": 180
} | 170 |
<!--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... | peft/docs/source/package_reference/prefix_tuning.md/0 | {
"file_path": "peft/docs/source/package_reference/prefix_tuning.md",
"repo_id": "peft",
"token_count": 514
} | 171 |
# Copyright 2024-present 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 law or... | peft/examples/corda_finetuning/preprocess.py/0 | {
"file_path": "peft/examples/corda_finetuning/preprocess.py",
"repo_id": "peft",
"token_count": 1976
} | 172 |
import os
import torch
import torch.nn as nn
import transformers
from datasets import load_dataset
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import LoraConfig, get_peft_model
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
# -*- coding: utf-8 -*-
"""Finetune-opt-bnb-peft.i... | peft/examples/fp4_finetuning/finetune_fp4_opt_bnb_peft.py/0 | {
"file_path": "peft/examples/fp4_finetuning/finetune_fp4_opt_bnb_peft.py",
"repo_id": "peft",
"token_count": 2325
} | 173 |
# Copyright 2023-present 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 law or... | peft/examples/int8_training/fine_tune_blip2_int8.py/0 | {
"file_path": "peft/examples/int8_training/fine_tune_blip2_int8.py",
"repo_id": "peft",
"token_count": 1309
} | 174 |
<jupyter_start><jupyter_text>This notebook shows how to use the adapter merging methods from `peft` and apply them image generation models using `diffusers`. Turn `diffusers` LoRA checkpoints into `PeftModel`<jupyter_code>!pip install diffusers accelerate transformers -U -q
!pip install git+https://github.com/huggingf... | peft/examples/multi_adapter_examples/multi_adapter_weighted_inference_diffusers.ipynb/0 | {
"file_path": "peft/examples/multi_adapter_examples/multi_adapter_weighted_inference_diffusers.ipynb",
"repo_id": "peft",
"token_count": 1802
} | 175 |
python train.py \
--seed 100 \
--model_name_or_path "mistralai/Mistral-7B-v0.1" \
--dataset_name "smangrul/ultrachat-10k-chatml" \
--chat_template_format "chatml" \
--add_special_tokens False \
--append_concat_token False \
--splits "train,test" \
--max_seq_len 2048 \
--num_train_epochs 1 \
--logging_steps 5 \
--log_le... | peft/examples/sft/run_peft.sh/0 | {
"file_path": "peft/examples/sft/run_peft.sh",
"repo_id": "peft",
"token_count": 457
} | 176 |
[tool.black]
# Only used by `hf-doc-builder´.
line-length = 119
target-version = ['py38']
[tool.ruff]
target-version = "py38"
line-length = 119
extend-exclude = ["*.ipynb"]
[tool.ruff.lint]
preview = true
explicit-preview-rules = true
extend-select = [
"C", # Complexity
"E", # PEP8 errors
"F", # PEP8 form... | peft/pyproject.toml/0 | {
"file_path": "peft/pyproject.toml",
"repo_id": "peft",
"token_count": 463
} | 177 |
# Copyright 2024-present 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 law or... | peft/src/peft/optimizers/loraplus.py/0 | {
"file_path": "peft/src/peft/optimizers/loraplus.py",
"repo_id": "peft",
"token_count": 1910
} | 178 |
# Copyright 2024-present 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 law or... | peft/src/peft/tuners/fourierft/layer.py/0 | {
"file_path": "peft/src/peft/tuners/fourierft/layer.py",
"repo_id": "peft",
"token_count": 3638
} | 179 |
# Copyright 2023-present 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 law or... | peft/src/peft/tuners/loha/config.py/0 | {
"file_path": "peft/src/peft/tuners/loha/config.py",
"repo_id": "peft",
"token_count": 2612
} | 180 |
# Copyright 2024-present 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 law or... | peft/src/peft/utils/incremental_pca.py/0 | {
"file_path": "peft/src/peft/utils/incremental_pca.py",
"repo_id": "peft",
"token_count": 6139
} | 181 |
# Copyright 2024-present 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 law or... | peft/tests/test_cpt.py/0 | {
"file_path": "peft/tests/test_cpt.py",
"repo_id": "peft",
"token_count": 4903
} | 182 |
# Copyright 2023-present 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 law or... | peft/tests/test_mixed.py/0 | {
"file_path": "peft/tests/test_mixed.py",
"repo_id": "peft",
"token_count": 16988
} | 183 |
# Hugging Face Timm Docs
## Getting Started
```
pip install git+https://github.com/huggingface/doc-builder.git@main#egg=hf-doc-builder
pip install watchdog black
```
## Preview the Docs Locally
```
doc-builder preview timm hfdocs/source
```
| pytorch-image-models/hfdocs/README.md/0 | {
"file_path": "pytorch-image-models/hfdocs/README.md",
"repo_id": "pytorch-image-models",
"token_count": 88
} | 184 |
# Dual Path Network (DPN)
A **Dual Path Network (DPN)** is a convolutional neural network which presents a new topology of connection paths internally. The intuition is that [ResNets](https://paperswithcode.com/method/resnet) enables feature re-usage while DenseNet enables new feature exploration, and both are importa... | pytorch-image-models/hfdocs/source/models/dpn.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/models/dpn.mdx",
"repo_id": "pytorch-image-models",
"token_count": 3694
} | 185 |
# ResNeSt
A **ResNeSt** is a variant on a [ResNet](https://paperswithcode.com/method/resnet), which instead stacks [Split-Attention blocks](https://paperswithcode.com/method/split-attention). The cardinal group representations are then concatenated along the channel dimension: \\( V = \text{Concat} \{ V^{1},V^{2},\cdo... | pytorch-image-models/hfdocs/source/models/resnest.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/models/resnest.mdx",
"repo_id": "pytorch-image-models",
"token_count": 5468
} | 186 |
# (Tensorflow) EfficientNet
**EfficientNet** is a convolutional neural network architecture and scaling method that uniformly scales all dimensions of depth/width/resolution using a *compound coefficient*. Unlike conventional practice that arbitrary scales these factors, the EfficientNet scaling method uniformly scale... | pytorch-image-models/hfdocs/source/models/tf-efficientnet.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/models/tf-efficientnet.mdx",
"repo_id": "pytorch-image-models",
"token_count": 8001
} | 187 |
""" ONNX export script
Export PyTorch models as ONNX graphs.
This export script originally started as an adaptation of code snippets found at
https://pytorch.org/tutorials/advanced/super_resolution_with_onnxruntime.html
The default parameters work with PyTorch 1.6 and ONNX 1.7 and produce an optimal ONNX graph
for h... | pytorch-image-models/onnx_export.py/0 | {
"file_path": "pytorch-image-models/onnx_export.py",
"repo_id": "pytorch-image-models",
"token_count": 1811
} | 188 |
import pytest
import torch
import torch.nn as nn
from timm.layers import create_act_layer, set_layer_config, get_act_layer, get_act_fn, Attention2d, MultiQueryAttentionV2
import importlib
import os
torch_backend = os.environ.get('TORCH_BACKEND')
if torch_backend is not None:
importlib.import_module(torch_backend... | pytorch-image-models/tests/test_layers.py/0 | {
"file_path": "pytorch-image-models/tests/test_layers.py",
"repo_id": "pytorch-image-models",
"token_count": 1935
} | 189 |
from abc import ABC, abstractmethod
from typing import Dict, List, Optional, Union
class DatasetInfo(ABC):
def __init__(self):
pass
@abstractmethod
def num_classes(self):
pass
@abstractmethod
def label_names(self):
pass
@abstractmethod
def label_descriptions(sel... | pytorch-image-models/timm/data/dataset_info.py/0 | {
"file_path": "pytorch-image-models/timm/data/dataset_info.py",
"repo_id": "pytorch-image-models",
"token_count": 941
} | 190 |
""" Dataset reader that wraps TFDS datasets
Wraps many (most?) TFDS image-classification datasets
from https://github.com/tensorflow/datasets
https://www.tensorflow.org/datasets/catalog/overview#image_classification
Hacked together by / Copyright 2020 Ross Wightman
"""
import math
import os
import sys
from typing imp... | pytorch-image-models/timm/data/readers/reader_tfds.py/0 | {
"file_path": "pytorch-image-models/timm/data/readers/reader_tfds.py",
"repo_id": "pytorch-image-models",
"token_count": 7089
} | 191 |
""" CBAM (sort-of) Attention
Experimental impl of CBAM: Convolutional Block Attention Module: https://arxiv.org/abs/1807.06521
WARNING: Results with these attention layers have been mixed. They can significantly reduce performance on
some tasks, especially fine-grained it seems. I may end up removing this impl.
Hack... | pytorch-image-models/timm/layers/cbam.py/0 | {
"file_path": "pytorch-image-models/timm/layers/cbam.py",
"repo_id": "pytorch-image-models",
"token_count": 2016
} | 192 |
from enum import Enum
from typing import Union
import torch
class Format(str, Enum):
NCHW = 'NCHW'
NHWC = 'NHWC'
NCL = 'NCL'
NLC = 'NLC'
FormatT = Union[str, Format]
def get_spatial_dim(fmt: FormatT):
fmt = Format(fmt)
if fmt is Format.NLC:
dim = (1,)
elif fmt is Format.NCL:
... | pytorch-image-models/timm/layers/format.py/0 | {
"file_path": "pytorch-image-models/timm/layers/format.py",
"repo_id": "pytorch-image-models",
"token_count": 572
} | 193 |
""" MLP module w/ dropout and configurable activation layer
Hacked together by / Copyright 2020 Ross Wightman
"""
from functools import partial
from torch import nn as nn
from .grn import GlobalResponseNorm
from .helpers import to_2tuple
class Mlp(nn.Module):
""" MLP as used in Vision Transformer, MLP-Mixer an... | pytorch-image-models/timm/layers/mlp.py/0 | {
"file_path": "pytorch-image-models/timm/layers/mlp.py",
"repo_id": "pytorch-image-models",
"token_count": 4398
} | 194 |
""" Squeeze-and-Excitation Channel Attention
An SE implementation originally based on PyTorch SE-Net impl.
Has since evolved with additional functionality / configuration.
Paper: `Squeeze-and-Excitation Networks` - https://arxiv.org/abs/1709.01507
Also included is Effective Squeeze-Excitation (ESE).
Paper: `CenterMa... | pytorch-image-models/timm/layers/squeeze_excite.py/0 | {
"file_path": "pytorch-image-models/timm/layers/squeeze_excite.py",
"repo_id": "pytorch-image-models",
"token_count": 1859
} | 195 |
""" PyTorch Feature Extraction Helpers
A collection of classes, functions, modules to help extract features from models
and provide a common interface for describing them.
The return_layers, module re-writing idea inspired by torchvision IntermediateLayerGetter
https://github.com/pytorch/vision/blob/d88d8961ae51507d0... | pytorch-image-models/timm/models/_features.py/0 | {
"file_path": "pytorch-image-models/timm/models/_features.py",
"repo_id": "pytorch-image-models",
"token_count": 8419
} | 196 |
""" Class-Attention in Image Transformers (CaiT)
Paper: 'Going deeper with Image Transformers' - https://arxiv.org/abs/2103.17239
Original code and weights from https://github.com/facebookresearch/deit, copyright below
Modifications and additions for timm hacked together by / Copyright 2021, Ross Wightman
"""
# Copy... | pytorch-image-models/timm/models/cait.py/0 | {
"file_path": "pytorch-image-models/timm/models/cait.py",
"repo_id": "pytorch-image-models",
"token_count": 10623
} | 197 |
""" EfficientViT (by MIT Song Han's Lab)
Paper: `Efficientvit: Enhanced linear attention for high-resolution low-computation visual recognition`
- https://arxiv.org/abs/2205.14756
Adapted from official impl at https://github.com/mit-han-lab/efficientvit
"""
__all__ = ['EfficientVit', 'EfficientVitLarge']
from ty... | pytorch-image-models/timm/models/efficientvit_mit.py/0 | {
"file_path": "pytorch-image-models/timm/models/efficientvit_mit.py",
"repo_id": "pytorch-image-models",
"token_count": 18100
} | 198 |
from ._hub import *
import warnings
warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.models", FutureWarning)
| pytorch-image-models/timm/models/hub.py/0 | {
"file_path": "pytorch-image-models/timm/models/hub.py",
"repo_id": "pytorch-image-models",
"token_count": 40
} | 199 |
""" Next-ViT
As described in https://arxiv.org/abs/2207.05501
Next-ViT model defs and weights adapted from https://github.com/bytedance/Next-ViT, original copyright below
"""
# Copyright (c) ByteDance Inc. All rights reserved.
from functools import partial
from typing import Optional
import torch
import torch.nn.fun... | pytorch-image-models/timm/models/nextvit.py/0 | {
"file_path": "pytorch-image-models/timm/models/nextvit.py",
"repo_id": "pytorch-image-models",
"token_count": 12227
} | 200 |
"""
SEResNet implementation from Cadene's pretrained models
https://github.com/Cadene/pretrained-models.pytorch/blob/master/pretrainedmodels/models/senet.py
Additional credit to https://github.com/creafz
Original model: https://github.com/hujie-frank/SENet
ResNet code gently borrowed from
https://github.com/pytorch/v... | pytorch-image-models/timm/models/senet.py/0 | {
"file_path": "pytorch-image-models/timm/models/senet.py",
"repo_id": "pytorch-image-models",
"token_count": 8363
} | 201 |
""" ViTamin
Paper: Designing Scalable Vison Models in the Vision-Language Era
A family of model weights on Huggingface: https://huggingface.co/collections/jienengchen/vitamin-family-661048126b72debdaca060bf
@inproceedings{chen2024vitamin,
title={ViTamin: Designing Scalable Vision Models in the Vision-language Era},... | pytorch-image-models/timm/models/vitamin.py/0 | {
"file_path": "pytorch-image-models/timm/models/vitamin.py",
"repo_id": "pytorch-image-models",
"token_count": 10072
} | 202 |
""" Adan Optimizer
Adan: Adaptive Nesterov Momentum Algorithm for Faster Optimizing Deep Models[J]. arXiv preprint arXiv:2208.06677, 2022.
https://arxiv.org/abs/2208.06677
Implementation adapted from https://github.com/sail-sg/Adan
"""
# Copyright 2022 Garena Online Private Limited
#
# Licensed under the Apache L... | pytorch-image-models/timm/optim/adan.py/0 | {
"file_path": "pytorch-image-models/timm/optim/adan.py",
"repo_id": "pytorch-image-models",
"token_count": 5803
} | 203 |
"""
SGDP Optimizer Implementation copied from https://github.com/clovaai/AdamP/blob/master/adamp/sgdp.py
Paper: `Slowing Down the Weight Norm Increase in Momentum-based Optimizers` - https://arxiv.org/abs/2006.08217
Code: https://github.com/clovaai/AdamP
Copyright (c) 2020-present NAVER Corp.
MIT license
"""
import ... | pytorch-image-models/timm/optim/sgdp.py/0 | {
"file_path": "pytorch-image-models/timm/optim/sgdp.py",
"repo_id": "pytorch-image-models",
"token_count": 1374
} | 204 |
import torch
from timm.utils.agc import adaptive_clip_grad
def dispatch_clip_grad(parameters, value: float, mode: str = 'norm', norm_type: float = 2.0):
""" Dispatch to gradient clipping method
Args:
parameters (Iterable): model parameters to clip
value (float): clipping value/factor/norm, m... | pytorch-image-models/timm/utils/clip_grad.py/0 | {
"file_path": "pytorch-image-models/timm/utils/clip_grad.py",
"repo_id": "pytorch-image-models",
"token_count": 306
} | 205 |
<!--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/en/examples/multiagents.mdx/0 | {
"file_path": "smolagents/docs/source/en/examples/multiagents.mdx",
"repo_id": "smolagents",
"token_count": 2350
} | 206 |
<!--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/hi/conceptual_guides/intro_agents.mdx/0 | {
"file_path": "smolagents/docs/source/hi/conceptual_guides/intro_agents.mdx",
"repo_id": "smolagents",
"token_count": 11609
} | 207 |
<!--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/conceptual_guides/react.mdx/0 | {
"file_path": "smolagents/docs/source/zh/conceptual_guides/react.mdx",
"repo_id": "smolagents",
"token_count": 1043
} | 208 |
from dotenv import load_dotenv
from smolagents import CodeAgent, HfApiModel, Tool
from smolagents.default_tools import VisitWebpageTool
load_dotenv()
class GetCatImageTool(Tool):
name = "get_cat_image"
description = "Get a cat image"
inputs = {}
output_type = "image"
def __init__(self):
... | smolagents/examples/e2b_example.py/0 | {
"file_path": "smolagents/examples/e2b_example.py",
"repo_id": "smolagents",
"token_count": 496
} | 209 |
import base64
import json
import mimetypes
import os
import uuid
from io import BytesIO
from typing import Optional
import requests
from dotenv import load_dotenv
from huggingface_hub import InferenceClient
from PIL import Image
from transformers import AutoProcessor
from smolagents import Tool, tool
load_dotenv(ov... | smolagents/examples/open_deep_research/scripts/visual_qa.py/0 | {
"file_path": "smolagents/examples/open_deep_research/scripts/visual_qa.py",
"repo_id": "smolagents",
"token_count": 2519
} | 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/models.py/0 | {
"file_path": "smolagents/src/smolagents/models.py",
"repo_id": "smolagents",
"token_count": 18080
} | 211 |
# 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_function_type_hints_utils.py/0 | {
"file_path": "smolagents/tests/test_function_type_hints_utils.py",
"repo_id": "smolagents",
"token_count": 1789
} | 212 |
<!---
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 ... | text-generation-inference/CONTRIBUTING.md/0 | {
"file_path": "text-generation-inference/CONTRIBUTING.md",
"repo_id": "text-generation-inference",
"token_count": 1396
} | 213 |
mod llamacpp {
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(dead_code)]
include!(concat!(env!("OUT_DIR"), "/llamacpp.rs"));
}
use async_trait::async_trait;
use std::ffi::CString;
use std::mem::replace;
use std::str::FromStr;
use std::sync::{mps... | text-generation-inference/backends/llamacpp/src/backend.rs/0 | {
"file_path": "text-generation-inference/backends/llamacpp/src/backend.rs",
"repo_id": "text-generation-inference",
"token_count": 13949
} | 214 |
import os
from argparse import ArgumentParser
from huggingface_hub import HfApi
def main():
parser = ArgumentParser()
parser.add_argument("--yes", action="store_true", default=False)
args = parser.parse_args()
api = HfApi()
models = api.list_models(search="optimum-internal-testing/neuron-tgi-test... | text-generation-inference/backends/neuron/tests/prune_test_models.py/0 | {
"file_path": "text-generation-inference/backends/neuron/tests/prune_test_models.py",
"repo_id": "text-generation-inference",
"token_count": 290
} | 215 |
set(SPDLOG_USE_FMT ON)
set(SPDLOG_BUILD_SHARED OFF)
set(SPDLOG_FMT_EXTERNAL OFF)
# Define the level at which SPDLOG_ compilation level is defined
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
add_compile_definitions(SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE)
else ()
add_compile_definitions(SPDLOG_ACTIVE_LEVEL SPDLOG_... | text-generation-inference/backends/trtllm/cmake/spdlog.cmake/0 | {
"file_path": "text-generation-inference/backends/trtllm/cmake/spdlog.cmake",
"repo_id": "text-generation-inference",
"token_count": 245
} | 216 |
[package]
name = "text-generation-router-v2"
description = "Text Generation Webserver"
version.workspace = true
edition.workspace = true
authors.workspace = true
homepage.workspace = true
[lib]
path = "src/lib.rs"
[[bin]]
name = "text-generation-router-v2"
path = "src/main.rs"
[dependencies]
async-trait = "0.1.74"
a... | text-generation-inference/backends/v2/Cargo.toml/0 | {
"file_path": "text-generation-inference/backends/v2/Cargo.toml",
"repo_id": "text-generation-inference",
"token_count": 869
} | 217 |
# Legacy warning ⚠️
The inference clients from [huggingface_hub](https://huggingface.co/docs/huggingface_hub/guides/inference) are recommended over `text_generation`.
# Text Generation
The Hugging Face Text Generation Python library provides a convenient way of interfacing with a
`text-generation-inference` instance ... | text-generation-inference/clients/python/README.md/0 | {
"file_path": "text-generation-inference/clients/python/README.md",
"repo_id": "text-generation-inference",
"token_count": 2491
} | 218 |
{
"openapi": "3.0.3",
"info": {
"title": "Text Generation Inference",
"description": "Text Generation Webserver",
"contact": {
"name": "Olivier Dehaene"
},
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0"
},
"version": "3.1.1-dev0"... | text-generation-inference/docs/openapi.json/0 | {
"file_path": "text-generation-inference/docs/openapi.json",
"repo_id": "text-generation-inference",
"token_count": 39213
} | 219 |
# TGI v3 overview
## Summary
Performance leap: TGI processes 3x more tokens, 13x faster than vLLM on long prompts. Zero config !
### 3x more tokens.
By reducing our memory footprint, we’re able to ingest many more tokens and more dynamically than before. A single L4 (24GB) can handle 30k tokens on llama 3.1-8B, whil... | text-generation-inference/docs/source/conceptual/chunking.md/0 | {
"file_path": "text-generation-inference/docs/source/conceptual/chunking.md",
"repo_id": "text-generation-inference",
"token_count": 2789
} | 220 |
# Using TGI with Intel GPUs
TGI optimized models are supported on Intel Data Center GPU [Max1100](https://www.intel.com/content/www/us/en/products/sku/232876/intel-data-center-gpu-max-1100/specifications.html), [Max1550](https://www.intel.com/content/www/us/en/products/sku/232873/intel-data-center-gpu-max-1550/specifi... | text-generation-inference/docs/source/installation_intel.md/0 | {
"file_path": "text-generation-inference/docs/source/installation_intel.md",
"repo_id": "text-generation-inference",
"token_count": 562
} | 221 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [],
"seed": 0,
"tokens": [
{
"id": 5267,
"logprob": -1.1464844,
"special": false,
"text": "?\n"
},
{
"id": 33464,
"logprob":... | text-generation-inference/integration-tests/models/__snapshots__/test_compressed_tensors_w8a8_int_dynamic_weight/test_compressed_tensors_w8a8_int_dynamic_weight_all_params.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_compressed_tensors_w8a8_int_dynamic_weight/test_compressed_tensors_w8a8_int_dynamic_weight_all_params.json",
"repo_id": "text-generation-inference",
"token_count": 862
} | 222 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [],
"seed": null,
"tokens": [
{
"id": 198,
"logprob": -0.68603516,
"special": false,
"text": "\n"
},
{
"id": 198,
"logprob":... | text-generation-inference/integration-tests/models/__snapshots__/test_flash_gpt2/test_flash_gpt2.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_gpt2/test_flash_gpt2.json",
"repo_id": "text-generation-inference",
"token_count": 866
} | 223 |
{
"choices": [
{
"delta": {
"content": "",
"role": "assistant",
"tool_calls": null
},
"finish_reason": "stop",
"index": 0,
"logprobs": null
}
],
"created": 1738343559,
"id": "",
"model": "Qwen/Qwen2.5-VL-3B-Instruct",
"object": "chat.completion.c... | text-generation-inference/integration-tests/models/__snapshots__/test_flash_qwen2_5_vl/test_flash_qwen2_5_vl_simple_streaming.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_qwen2_5_vl/test_flash_qwen2_5_vl_simple_streaming.json",
"repo_id": "text-generation-inference",
"token_count": 203
} | 224 |
{
"details": {
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [],
"seed": null,
"tokens": [
{
"id": 100,
"logprob": -0.9824219,
"special": false,
"text": "_"
},
{
"id": 5879,
"logprob": -0.3017578,
"special": ... | text-generation-inference/integration-tests/models/__snapshots__/test_flash_starcoder2_lora/test_flash_starcoder2_with_hugcode_adapter.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_starcoder2_lora/test_flash_starcoder2_with_hugcode_adapter.json",
"repo_id": "text-generation-inference",
"token_count": 852
} | 225 |
{
"choices": [
{
"delta": {
"content": " deep",
"role": "assistant",
"tool_calls": null
},
"finish_reason": "length",
"index": 0,
"logprobs": null
}
],
"created": 1729262528,
"id": "",
"model": "meta-llama/Llama-3.1-8B-Instruct",
"object": "chat.... | text-generation-inference/integration-tests/models/__snapshots__/test_tools_llama/test_flash_llama_grammar_tools_sea_creatures_stream_none.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_tools_llama/test_flash_llama_grammar_tools_sea_creatures_stream_none.json",
"repo_id": "text-generation-inference",
"token_count": 206
} | 226 |
import pytest
@pytest.fixture(scope="module")
def flash_deepseek_v2_handle(launcher):
with launcher("deepseek-ai/DeepSeek-V2-Lite", num_shard=2) as handle:
yield handle
@pytest.fixture(scope="module")
async def flash_deepseek_v2(flash_deepseek_v2_handle):
await flash_deepseek_v2_handle.health(300)
... | text-generation-inference/integration-tests/models/test_flash_deepseek_v2.py/0 | {
"file_path": "text-generation-inference/integration-tests/models/test_flash_deepseek_v2.py",
"repo_id": "text-generation-inference",
"token_count": 710
} | 227 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.