text
stringlengths
5
409k
id
stringlengths
14
178
metadata
dict
__index_level_0__
int64
0
572
# 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_cascade/test_stable_cascade_decoder.py/0
{ "file_path": "diffusers/tests/pipelines/stable_cascade/test_stable_cascade_decoder.py", "repo_id": "diffusers", "token_count": 5779 }
169
# 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_flax.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_flax.py", "repo_id": "diffusers", "token_count": 1668 }
170
# 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_xl/test_stable_diffusion_xl_inpaint.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_inpaint.py", "repo_id": "diffusers", "token_count": 15073 }
171
# 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_text_to_video.py/0
{ "file_path": "diffusers/tests/pipelines/text_to_video_synthesis/test_text_to_video.py", "repo_id": "diffusers", "token_count": 3755 }
172
# coding=utf-8 # Copyright 2024 The HuggingFace Team 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 clone of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
diffusers/tests/quantization/bnb/test_mixed_int8.py/0
{ "file_path": "diffusers/tests/quantization/bnb/test_mixed_int8.py", "repo_id": "diffusers", "token_count": 13320 }
173
import tempfile import unittest import torch from diffusers import EDMDPMSolverMultistepScheduler from .test_schedulers import SchedulerCommonTest class EDMDPMSolverMultistepSchedulerTest(SchedulerCommonTest): scheduler_classes = (EDMDPMSolverMultistepScheduler,) forward_default_kwargs = (("num_inference_s...
diffusers/tests/schedulers/test_scheduler_edm_dpmsolver_multistep.py/0
{ "file_path": "diffusers/tests/schedulers/test_scheduler_edm_dpmsolver_multistep.py", "repo_id": "diffusers", "token_count": 5458 }
174
import tempfile import torch from diffusers import ( DEISMultistepScheduler, DPMSolverMultistepScheduler, DPMSolverSinglestepScheduler, UniPCMultistepScheduler, ) from .test_schedulers import SchedulerCommonTest class UniPCMultistepSchedulerTest(SchedulerCommonTest): scheduler_classes = (UniPCM...
diffusers/tests/schedulers/test_scheduler_unipc.py/0
{ "file_path": "diffusers/tests/schedulers/test_scheduler_unipc.py", "repo_id": "diffusers", "token_count": 7568 }
175
import gc import unittest import torch from diffusers import ( StableDiffusionInpaintPipeline, ) from diffusers.utils import load_image from diffusers.utils.testing_utils import ( backend_empty_cache, enable_full_determinism, require_torch_accelerator, slow, torch_device, ) from .single_file_...
diffusers/tests/single_file/test_stable_diffusion_inpaint_single_file.py/0
{ "file_path": "diffusers/tests/single_file/test_stable_diffusion_inpaint_single_file.py", "repo_id": "diffusers", "token_count": 2043 }
176
# 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/custom_init_isort.py/0
{ "file_path": "diffusers/utils/custom_init_isort.py", "repo_id": "diffusers", "token_count": 5346 }
177
{ "homing_offset": [ 2048, 3072, 3072, -1024, -1024, 2048, -2048, 2048, -2048 ], "drive_mode": [ 1, 1, 1, 0, 0, 1, 0, 1, 0 ], "start_pos": [ 2056, ...
lerobot/.cache/calibration/aloha_default/right_follower.json/0
{ "file_path": "lerobot/.cache/calibration/aloha_default/right_follower.json", "repo_id": "lerobot", "token_count": 717 }
178
# Configure image ARG PYTHON_VERSION=3.10 FROM python:${PYTHON_VERSION}-slim ARG PYTHON_VERSION ARG DEBIAN_FRONTEND=noninteractive # Install apt dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential cmake git git-lfs \ libglib2.0-0 libgl1-mesa-glx libegl1-mesa ffmpeg ...
lerobot/docker/lerobot-cpu/Dockerfile/0
{ "file_path": "lerobot/docker/lerobot-cpu/Dockerfile", "repo_id": "lerobot", "token_count": 412 }
179
#!/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/utils.py/0
{ "file_path": "lerobot/lerobot/common/datasets/utils.py", "repo_id": "lerobot", "token_count": 8989 }
180
#!/usr/bin/env python # Copyright 2024 Columbia Artificial Intelligence, Robotics Lab, # and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at #...
lerobot/lerobot/common/policies/diffusion/modeling_diffusion.py/0
{ "file_path": "lerobot/lerobot/common/policies/diffusion/modeling_diffusion.py", "repo_id": "lerobot", "token_count": 14466 }
181
#!/usr/bin/env python # Copyright 2024 Seungjae Lee and Yibin Wang and Haritheja Etukuru # and H. Jin Kim and Nur Muhammad Mahi Shafiullah and Lerrel Pinto # and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in com...
lerobot/lerobot/common/policies/vqbet/modeling_vqbet.py/0
{ "file_path": "lerobot/lerobot/common/policies/vqbet/modeling_vqbet.py", "repo_id": "lerobot", "token_count": 20293 }
182
#!/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/robot_devices/robots/stretch.py/0
{ "file_path": "lerobot/lerobot/common/robot_devices/robots/stretch.py", "repo_id": "lerobot", "token_count": 3353 }
183
import datetime as dt import logging import os from dataclasses import dataclass, field from pathlib import Path from typing import Type import draccus from huggingface_hub import hf_hub_download from huggingface_hub.errors import HfHubHTTPError from lerobot.common import envs from lerobot.common.optim import Optimiz...
lerobot/lerobot/configs/train.py/0
{ "file_path": "lerobot/lerobot/configs/train.py", "repo_id": "lerobot", "token_count": 3287 }
184
version https://git-lfs.github.com/spec/v1 oid sha256:01cfe50c537e3aef0cd5947ec0b15b321b54ecb461baf7b4f2506897158eebc8 size 111338
lerobot/tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_80.safetensors/0
{ "file_path": "lerobot/tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_80.safetensors", "repo_id": "lerobot", "token_count": 65 }
185
version https://git-lfs.github.com/spec/v1 oid sha256:9bb9b195d32e05550af0edd5df88fcc761c829ab8c4b129ba970a723f39b46ee size 68
lerobot/tests/data/save_policy_to_safetensors/aloha_act_1000_steps/output_dict.safetensors/0
{ "file_path": "lerobot/tests/data/save_policy_to_safetensors/aloha_act_1000_steps/output_dict.safetensors", "repo_id": "lerobot", "token_count": 65 }
186
version https://git-lfs.github.com/spec/v1 oid sha256:4636751d82103a268ac7cf36f1e69f6356f356b9c40561a9fe8557bb9255e2ee size 240
lerobot/tests/data/save_policy_to_safetensors/xarm_tdmpcuse_policy/output_dict.safetensors/0
{ "file_path": "lerobot/tests/data/save_policy_to_safetensors/xarm_tdmpcuse_policy/output_dict.safetensors", "repo_id": "lerobot", "token_count": 63 }
187
""" Tests for physical cameras and their mocked versions. If the physical camera is not connected to the computer, or not working, the test will be skipped. Example of running a specific test: ```bash pytest -sx tests/test_cameras.py::test_camera ``` Example of running test on a real camera connected to the computer:...
lerobot/tests/test_cameras.py/0
{ "file_path": "lerobot/tests/test_cameras.py", "repo_id": "lerobot", "token_count": 2521 }
188
""" Tests for physical robots and their mocked versions. If the physical robots are not connected to the computer, or not working, the test will be skipped. Example of running a specific test: ```bash pytest -sx tests/test_robots.py::test_robot ``` Example of running test on real robots connected to the computer: ```...
lerobot/tests/test_robots.py/0
{ "file_path": "lerobot/tests/test_robots.py", "repo_id": "lerobot", "token_count": 1872 }
189
compute_environment: LOCAL_MACHINE debug: false distributed_type: MULTI_GPU downcast_bf16: 'no' gpu_ids: all machine_rank: 0 main_training_function: main mixed_precision: bf16 num_machines: 1 num_processes: 8 rdzv_backend: static same_network: true tpu_env: [] tpu_use_cluster: false tpu_use_sudo: false use_cpu: false
open-r1/recipes/accelerate_configs/ddp.yaml/0
{ "file_path": "open-r1/recipes/accelerate_configs/ddp.yaml", "repo_id": "open-r1", "token_count": 129 }
190
# coding=utf-8 # 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 requir...
open-r1/src/open_r1/configs.py/0
{ "file_path": "open-r1/src/open_r1/configs.py", "repo_id": "open-r1", "token_count": 1133 }
191
# Builds GPU docker image of PyTorch # Uses multi-staged approach to reduce size # Stage 1 # Use base conda image to reduce time FROM continuumio/miniconda3:latest AS compile-image # Specify py version ENV PYTHON_VERSION=3.11 # Install apt libs - copied from https://github.com/huggingface/accelerate/blob/main/docker/ac...
peft/docker/peft-cpu/Dockerfile/0
{ "file_path": "peft/docker/peft-cpu/Dockerfile", "repo_id": "peft", "token_count": 649 }
192
<!--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/contributing.md/0
{ "file_path": "peft/docs/source/developer_guides/contributing.md", "repo_id": "peft", "token_count": 1620 }
193
<!--⚠️ 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. --> # Configuration [`PeftConfigMixin`] is the base configuration class for storing the adapter configuration of a [`PeftModel`], and [`PromptLearningCo...
peft/docs/source/package_reference/config.md/0
{ "file_path": "peft/docs/source/package_reference/config.md", "repo_id": "peft", "token_count": 224 }
194
<!--⚠️ 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. --> # Models [`PeftModel`] is the base model class for specifying the base Transformer model and configuration to apply a PEFT method to. The base `Peft...
peft/docs/source/package_reference/peft_model.md/0
{ "file_path": "peft/docs/source/package_reference/peft_model.md", "repo_id": "peft", "token_count": 564 }
195
<!--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/examples/boft_controlnet/boft_controlnet.md/0
{ "file_path": "peft/examples/boft_controlnet/boft_controlnet.md", "repo_id": "peft", "token_count": 2426 }
196
<jupyter_start><jupyter_text>Training PEFT models with new tokens being added to the embedding layers and tokenizerIn this example, we will learn how to train a LoRA model when adding new tokens to the tokenizer and model. This is a common usecase when doing the following:1. Instruction finetuning with new tokens beind...
peft/examples/causal_language_modeling/peft_lora_clm_with_additional_tokens.ipynb/0
{ "file_path": "peft/examples/causal_language_modeling/peft_lora_clm_with_additional_tokens.ipynb", "repo_id": "peft", "token_count": 4577 }
197
# 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/feature_extraction/peft_lora_embedding_semantic_search.py/0
{ "file_path": "peft/examples/feature_extraction/peft_lora_embedding_semantic_search.py", "repo_id": "peft", "token_count": 8775 }
198
<jupyter_start><jupyter_text>Using PEFT with timm `peft` allows us to train any model with LoRA as long as the layer type is supported. Since `Conv2D` is one of the supported layer types, it makes sense to test it on image models.In this short notebook, we will demonstrate this with an image classification task using [...
peft/examples/image_classification/image_classification_timm_peft_lora.ipynb/0
{ "file_path": "peft/examples/image_classification/image_classification_timm_peft_lora.ipynb", "repo_id": "peft", "token_count": 3067 }
199
import argparse import gc import hashlib import itertools import logging import math import os import threading import warnings from contextlib import nullcontext from pathlib import Path import datasets import diffusers import numpy as np import psutil import torch import torch.nn.functional as F import torch.utils.c...
peft/examples/lora_dreambooth/train_dreambooth.py/0
{ "file_path": "peft/examples/lora_dreambooth/train_dreambooth.py", "repo_id": "peft", "token_count": 20030 }
200
<jupyter_start><jupyter_text>Using FourierFT for sequence classification In this example, we fine-tune Roberta (base) on a sequence classification task using FourierFT. Imports<jupyter_code># To run this notebook, please run `pip install evaluate` to install additional dependencies not covered by PEFT. import torch f...
peft/examples/sequence_classification/FourierFT.ipynb/0
{ "file_path": "peft/examples/sequence_classification/FourierFT.ipynb", "repo_id": "peft", "token_count": 2571 }
201
compute_environment: LOCAL_MACHINE debug: false ...
peft/examples/sft/configs/fsdp_config_qlora.yaml/0
{ "file_path": "peft/examples/sft/configs/fsdp_config_qlora.yaml", "repo_id": "peft", "token_count": 565 }
202
# 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/mapping_func.py/0
{ "file_path": "peft/src/peft/mapping_func.py", "repo_id": "peft", "token_count": 2208 }
203
# 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/adaption_prompt/layer.py/0
{ "file_path": "peft/src/peft/tuners/adaption_prompt/layer.py", "repo_id": "peft", "token_count": 2705 }
204
# 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/cpt/model.py/0
{ "file_path": "peft/src/peft/tuners/cpt/model.py", "repo_id": "peft", "token_count": 3563 }
205
# 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/ln_tuning/layer.py/0
{ "file_path": "peft/src/peft/tuners/ln_tuning/layer.py", "repo_id": "peft", "token_count": 1852 }
206
# 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/lora/dora.py/0
{ "file_path": "peft/src/peft/tuners/lora/dora.py", "repo_id": "peft", "token_count": 3595 }
207
# 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/oft/config.py/0
{ "file_path": "peft/src/peft/tuners/oft/config.py", "repo_id": "peft", "token_count": 4034 }
208
# 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/prompt_tuning/model.py/0
{ "file_path": "peft/src/peft/tuners/prompt_tuning/model.py", "repo_id": "peft", "token_count": 1486 }
209
# 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/utils/__init__.py/0
{ "file_path": "peft/src/peft/utils/__init__.py", "repo_id": "peft", "token_count": 1463 }
210
# 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_boft.py/0
{ "file_path": "peft/tests/test_boft.py", "repo_id": "peft", "token_count": 1325 }
211
# 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_loraplus.py/0
{ "file_path": "peft/tests/test_loraplus.py", "repo_id": "peft", "token_count": 1312 }
212
import argparse import hashlib import os import mxnet as mx import gluoncv import torch from timm import create_model parser = argparse.ArgumentParser(description='Convert from MXNet') parser.add_argument('--model', default='all', type=str, metavar='MODEL', help='Name of model to train (default: "...
pytorch-image-models/convert/convert_from_mxnet.py/0
{ "file_path": "pytorch-image-models/convert/convert_from_mxnet.py", "repo_id": "pytorch-image-models", "token_count": 1786 }
213
# HRNet **HRNet**, or **High-Resolution Net**, is a general purpose convolutional neural network for tasks like semantic segmentation, object detection and image classification. It is able to maintain high resolution representations through the whole process. We start from a high-resolution convolution stream, gradual...
pytorch-image-models/hfdocs/source/models/hrnet.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/hrnet.mdx", "repo_id": "pytorch-image-models", "token_count": 5058 }
214
# RegNetY **RegNetY** is a convolutional network design space with simple, regular models with parameters: depth \\( d \\), initial width \\( w_{0} > 0 \\), and slope \\( w_{a} > 0 \\), and generates a different block width \\( u_{j} \\) for each block \\( j < d \\). The key restriction for the RegNet types of model i...
pytorch-image-models/hfdocs/source/models/regnety.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/regnety.mdx", "repo_id": "pytorch-image-models", "token_count": 6761 }
215
# Scripts A train, validation, inference, and checkpoint cleaning script included in the github root folder. Scripts are not currently packaged in the pip release. The training and validation scripts evolved from early versions of the [PyTorch Imagenet Examples](https://github.com/pytorch/examples). I have added sign...
pytorch-image-models/hfdocs/source/training_script.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/training_script.mdx", "repo_id": "pytorch-image-models", "token_count": 2364 }
216
DEFAULT_CROP_PCT = 0.875 DEFAULT_CROP_MODE = 'center' IMAGENET_DEFAULT_MEAN = (0.485, 0.456, 0.406) IMAGENET_DEFAULT_STD = (0.229, 0.224, 0.225) IMAGENET_INCEPTION_MEAN = (0.5, 0.5, 0.5) IMAGENET_INCEPTION_STD = (0.5, 0.5, 0.5) IMAGENET_DPN_MEAN = (124 / 255, 117 / 255, 104 / 255) IMAGENET_DPN_STD = tuple([1 / (.0167 *...
pytorch-image-models/timm/data/constants.py/0
{ "file_path": "pytorch-image-models/timm/data/constants.py", "repo_id": "pytorch-image-models", "token_count": 236 }
217
""" A dataset reader that extracts images from folders Folders are scanned recursively to find image files. Labels are based on the folder hierarchy, just leaf folders by default. Hacked together by / Copyright 2020 Ross Wightman """ import os from typing import Dict, List, Optional, Set, Tuple, Union from timm.util...
pytorch-image-models/timm/data/readers/reader_image_folder.py/0
{ "file_path": "pytorch-image-models/timm/data/readers/reader_image_folder.py", "repo_id": "pytorch-image-models", "token_count": 1510 }
218
""" Attention Pool 2D Implementations of 2D spatial feature pooling using multi-head attention instead of average pool. Based on idea in CLIP by OpenAI, licensed Apache 2.0 https://github.com/openai/CLIP/blob/3b473b0e682c091a9e53623eebc1ca1657385717/clip/model.py Hacked together by / Copyright 2021 Ross Wightman """...
pytorch-image-models/timm/layers/attention_pool2d.py/0
{ "file_path": "pytorch-image-models/timm/layers/attention_pool2d.py", "repo_id": "pytorch-image-models", "token_count": 5737 }
219
""" EvoNorm in PyTorch Based on `Evolving Normalization-Activation Layers` - https://arxiv.org/abs/2004.02967 @inproceedings{NEURIPS2020, author = {Liu, Hanxiao and Brock, Andy and Simonyan, Karen and Le, Quoc}, booktitle = {Advances in Neural Information Processing Systems}, editor = {H. Larochelle and M. Ranzato ...
pytorch-image-models/timm/layers/evo_norm.py/0
{ "file_path": "pytorch-image-models/timm/layers/evo_norm.py", "repo_id": "pytorch-image-models", "token_count": 6684 }
220
""" Median Pool Hacked together by / Copyright 2020 Ross Wightman """ import torch.nn as nn import torch.nn.functional as F from .helpers import to_2tuple, to_4tuple class MedianPool2d(nn.Module): """ Median pool (usable as median filter when stride=1) module. Args: kernel_size: size of pooling kern...
pytorch-image-models/timm/layers/median_pool.py/0
{ "file_path": "pytorch-image-models/timm/layers/median_pool.py", "repo_id": "pytorch-image-models", "token_count": 883 }
221
import torch import torch.nn as nn class SpaceToDepth(nn.Module): bs: torch.jit.Final[int] def __init__(self, block_size=4): super().__init__() assert block_size == 4 self.bs = block_size def forward(self, x): N, C, H, W = x.size() x = x.view(N, C, H // self.bs, s...
pytorch-image-models/timm/layers/space_to_depth.py/0
{ "file_path": "pytorch-image-models/timm/layers/space_to_depth.py", "repo_id": "pytorch-image-models", "token_count": 568 }
222
""" EfficientNet, MobileNetV3, etc Blocks Hacked together by / Copyright 2019, Ross Wightman """ from typing import Callable, Dict, Optional, Type import torch import torch.nn as nn from torch.nn import functional as F from timm.layers import create_conv2d, DropPath, make_divisible, create_act_layer, create_aa, to_2...
pytorch-image-models/timm/models/_efficientnet_blocks.py/0
{ "file_path": "pytorch-image-models/timm/models/_efficientnet_blocks.py", "repo_id": "pytorch-image-models", "token_count": 13538 }
223
""" BEiT: BERT Pre-Training of Image Transformers (https://arxiv.org/abs/2106.08254) Model from official source: https://github.com/microsoft/unilm/tree/master/beit @inproceedings{beit, title={{BEiT}: {BERT} Pre-Training of Image Transformers}, author={Hangbo Bao and Li Dong and Songhao Piao and Furu Wei}, booktitle=...
pytorch-image-models/timm/models/beit.py/0
{ "file_path": "pytorch-image-models/timm/models/beit.py", "repo_id": "pytorch-image-models", "token_count": 14383 }
224
""" EfficientFormer @article{li2022efficientformer, title={EfficientFormer: Vision Transformers at MobileNet Speed}, author={Li, Yanyu and Yuan, Geng and Wen, Yang and Hu, Eric and Evangelidis, Georgios and Tulyakov, Sergey and Wang, Yanzhi and Ren, Jian}, journal={arXiv preprint arXiv:2206.01191}, year={20...
pytorch-image-models/timm/models/efficientformer.py/0
{ "file_path": "pytorch-image-models/timm/models/efficientformer.py", "repo_id": "pytorch-image-models", "token_count": 10905 }
225
""" An PyTorch implementation of Hiera Adapted for timm from originals at https://github.com/facebookresearch/hiera """ # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. #...
pytorch-image-models/timm/models/hiera.py/0
{ "file_path": "pytorch-image-models/timm/models/hiera.py", "repo_id": "pytorch-image-models", "token_count": 18103 }
226
""" Multi-Scale Vision Transformer v2 @inproceedings{li2021improved, title={MViTv2: Improved multiscale vision transformers for classification and detection}, author={Li, Yanghao and Wu, Chao-Yuan and Fan, Haoqi and Mangalam, Karttikeya and Xiong, Bo and Malik, Jitendra and Feichtenhofer, Christoph}, booktitle={...
pytorch-image-models/timm/models/mvitv2.py/0
{ "file_path": "pytorch-image-models/timm/models/mvitv2.py", "repo_id": "pytorch-image-models", "token_count": 21263 }
227
"""Pre-Activation ResNet v2 with GroupNorm and Weight Standardization. A PyTorch implementation of ResNetV2 adapted from the Google Big-Transfer (BiT) source code at https://github.com/google-research/big_transfer to match timm interfaces. The BiT weights have been included here as pretrained models from their origina...
pytorch-image-models/timm/models/resnetv2.py/0
{ "file_path": "pytorch-image-models/timm/models/resnetv2.py", "repo_id": "pytorch-image-models", "token_count": 17289 }
228
""" Hybrid Vision Transformer (ViT) in PyTorch A PyTorch implement of the Hybrid Vision Transformers as described in: 'An Image Is Worth 16 x 16 Words: Transformers for Image Recognition at Scale' - https://arxiv.org/abs/2010.11929 `How to train your ViT? Data, Augmentation, and Regularization in Vision Transfor...
pytorch-image-models/timm/models/vision_transformer_hybrid.py/0
{ "file_path": "pytorch-image-models/timm/models/vision_transformer_hybrid.py", "repo_id": "pytorch-image-models", "token_count": 8273 }
229
""" AdaHessian Optimizer Lifted from https://github.com/davda54/ada-hessian/blob/master/ada_hessian.py Originally licensed MIT, Copyright 2020, David Samuel """ import torch class Adahessian(torch.optim.Optimizer): """ Implements the AdaHessian algorithm from "ADAHESSIAN: An Adaptive Second OrderOptimizer fo...
pytorch-image-models/timm/optim/adahessian.py/0
{ "file_path": "pytorch-image-models/timm/optim/adahessian.py", "repo_id": "pytorch-image-models", "token_count": 3131 }
230
# lots of uses of these functions directly, ala 'import timm.optim.optim_factory as optim_factory', fun :/ from ._optim_factory import create_optimizer, create_optimizer_v2, optimizer_kwargs from ._param_groups import param_groups_layer_decay, param_groups_weight_decay, group_parameters, _layer_map, _group import war...
pytorch-image-models/timm/optim/optim_factory.py/0
{ "file_path": "pytorch-image-models/timm/optim/optim_factory.py", "repo_id": "pytorch-image-models", "token_count": 130 }
231
""" Adaptive Gradient Clipping An impl of AGC, as per (https://arxiv.org/abs/2102.06171): @article{brock2021high, author={Andrew Brock and Soham De and Samuel L. Smith and Karen Simonyan}, title={High-Performance Large-Scale Image Recognition Without Normalization}, journal={arXiv preprint arXiv:}, year={2021...
pytorch-image-models/timm/utils/agc.py/0
{ "file_path": "pytorch-image-models/timm/utils/agc.py", "repo_id": "pytorch-image-models", "token_count": 661 }
232
__version__ = '1.0.15'
pytorch-image-models/timm/version.py/0
{ "file_path": "pytorch-image-models/timm/version.py", "repo_id": "pytorch-image-models", "token_count": 12 }
233
- title: Get started sections: - local: index title: 🤗 Agents - local: guided_tour title: Guided tour - title: Tutorials sections: - local: tutorials/building_good_agents title: ✨ Building good agents - local: tutorials/inspect_runs title: 📊 Inspect your agent runs using telemetry - loca...
smolagents/docs/source/en/_toctree.yml/0
{ "file_path": "smolagents/docs/source/en/_toctree.yml", "repo_id": "smolagents", "token_count": 418 }
234
<!--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/tutorials/tools.mdx/0
{ "file_path": "smolagents/docs/source/en/tutorials/tools.mdx", "repo_id": "smolagents", "token_count": 3370 }
235
# docstyle-ignore INSTALL_CONTENT = """ # Installation ! pip install smolagents # To install from source instead of the last release, comment the command above and uncomment the following one. # ! pip install git+https://github.com/huggingface/smolagents.git """ notebook_first_cells = [{"type": "code", "content": INST...
smolagents/docs/source/zh/_config.py/0
{ "file_path": "smolagents/docs/source/zh/_config.py", "repo_id": "smolagents", "token_count": 155 }
236
# This is a config for E2B sandbox template. # You can use template ID (qywp2ctmu2q7jzprcf4j) to create a sandbox: # Python SDK # from e2b import Sandbox, AsyncSandbox # sandbox = Sandbox("qywp2ctmu2q7jzprcf4j") # Sync sandbox # sandbox = await AsyncSandbox.create("qywp2ctmu2q7jzprcf4j") # Async sandbox # JS SDK # im...
smolagents/e2b.toml/0
{ "file_path": "smolagents/e2b.toml", "repo_id": "smolagents", "token_count": 254 }
237
import json import os import shutil import textwrap from pathlib import Path # import tqdm.asyncio from smolagents.utils import AgentError def serialize_agent_error(obj): if isinstance(obj, AgentError): return {"error_type": obj.__class__.__name__, "message": obj.message} else: return str(obj...
smolagents/examples/open_deep_research/scripts/run_agents.py/0
{ "file_path": "smolagents/examples/open_deep_research/scripts/run_agents.py", "repo_id": "smolagents", "token_count": 1425 }
238
#!/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/LI...
smolagents/src/smolagents/gradio_ui.py/0
{ "file_path": "smolagents/src/smolagents/gradio_ui.py", "repo_id": "smolagents", "token_count": 5258 }
239
# 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_default_tools.py/0
{ "file_path": "smolagents/tests/test_default_tools.py", "repo_id": "smolagents", "token_count": 1333 }
240
# coding=utf-8 # Copyright 2025-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 a...
smolagents/utils/check_tests_in_ci.py/0
{ "file_path": "smolagents/utils/check_tests_in_ci.py", "repo_id": "smolagents", "token_count": 729 }
241
repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: - id: check-yaml - id: end-of-file-fixer exclude: crate-hashes.json - id: trailing-whitespace exclude: docs/source/reference/launcher.md - repo: https://github.com/psf/black rev: 24.2.0 ...
text-generation-inference/.pre-commit-config.yaml/0
{ "file_path": "text-generation-inference/.pre-commit-config.yaml", "repo_id": "text-generation-inference", "token_count": 314 }
242
# Llamacpp backend If all your dependencies are installed at the system level, running cargo build should be sufficient. However, if you want to experiment with different versions of llama.cpp, some additional setup is required. ## Install llama.cpp LLAMACPP_PREFIX=$(pwd)/llama.cpp.out git clone https://git...
text-generation-inference/backends/llamacpp/README.md/0
{ "file_path": "text-generation-inference/backends/llamacpp/README.md", "repo_id": "text-generation-inference", "token_count": 297 }
243
import asyncio from pathlib import Path from typing import List from grpc import aio from grpc_reflection.v1alpha import reflection from loguru import logger from .generator import Generator, NeuronGenerator from .interceptor import ExceptionInterceptor from .pb import generate_pb2, generate_pb2_grpc class TextGene...
text-generation-inference/backends/neuron/server/text_generation_server/server.py/0
{ "file_path": "text-generation-inference/backends/neuron/server/text_generation_server/server.py", "repo_id": "text-generation-inference", "token_count": 1222 }
244
# Text Generation Inference - TensorRT-LLM Backend Implementation ## Description This folder provides the sources of the TensorRT-LLM backend implementation powered by TensorRT-LLM Executor new API ## Simplified Request Sequence ```mermaid sequenceDiagram actor User participant TextGenerationInference.HttpS...
text-generation-inference/backends/trtllm/README.md/0
{ "file_path": "text-generation-inference/backends/trtllm/README.md", "repo_id": "text-generation-inference", "token_count": 1019 }
245
/// /// Extract the first line of the provided string reference. /// If there is no lines in the buffer, it returns a string /// which content is defined by the content of `fail` /// # Arguments /// /// * `s`: The string buffer to extract the first-line from /// * `fail`: A string content which is returned if no lines ...
text-generation-inference/backends/trtllm/src/utils.rs/0
{ "file_path": "text-generation-inference/backends/trtllm/src/utils.rs", "repo_id": "text-generation-inference", "token_count": 201 }
246
use std::sync::Arc; use tokio::sync::{mpsc, oneshot}; use crate::radix::RadixAllocator; #[derive(Debug, Clone)] pub struct BlockAllocation { pub allocation_id: u64, pub blocks: Vec<u32>, pub slots: Vec<u32>, /// Prefix that was cached and for which the KV does not have to /// be recomputed. p...
text-generation-inference/backends/v3/src/block_allocator.rs/0
{ "file_path": "text-generation-inference/backends/v3/src/block_allocator.rs", "repo_id": "text-generation-inference", "token_count": 3008 }
247
/// MIT License // // Copyright (c) 2020 hatoo // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merg...
text-generation-inference/benchmark/src/utils.rs/0
{ "file_path": "text-generation-inference/benchmark/src/utils.rs", "repo_id": "text-generation-inference", "token_count": 598 }
248
{ "git+https://github.com/dottxt-ai/outlines-core.git?rev=ba10c619fc9bf3c487e43f49bdecb95a24bb465c#outlines-core@0.1.0": "1j9dcd831b0bmmjk2n4aag3x47qnqmkpg4gqpvwwyic7744llbfm" }
text-generation-inference/crate-hashes.json/0
{ "file_path": "text-generation-inference/crate-hashes.json", "repo_id": "text-generation-inference", "token_count": 106 }
249
# Using TGI CLI You can use TGI command-line interface (CLI) to download weights, serve and quantize models, or get information on serving parameters. To install the CLI, please refer to [the installation section](../installation#install-cli). `text-generation-server` lets you download the model with `download-weight...
text-generation-inference/docs/source/basic_tutorials/using_cli.md/0
{ "file_path": "text-generation-inference/docs/source/basic_tutorials/using_cli.md", "repo_id": "text-generation-inference", "token_count": 323 }
250
# Using TGI with AMD GPUs TGI is supported and tested on [AMD Instinct MI210](https://www.amd.com/en/products/accelerators/instinct/mi200/mi210.html), [MI250](https://www.amd.com/en/products/accelerators/instinct/mi200/mi250.html) and [MI300](https://www.amd.com/en/products/accelerators/instinct/mi300.html) GPUs. The ...
text-generation-inference/docs/source/installation_amd.md/0
{ "file_path": "text-generation-inference/docs/source/installation_amd.md", "repo_id": "text-generation-inference", "token_count": 1047 }
251
import copy import logging import sys from tempfile import TemporaryDirectory import huggingface_hub import pytest import docker import hashlib import os import tempfile from docker.errors import NotFound TEST_ORGANIZATION = "optimum-internal-testing" TEST_CACHE_REPO_ID = f"{TEST_ORGANIZATION}/neuron-testing-cache"...
text-generation-inference/integration-tests/fixtures/neuron/model.py/0
{ "file_path": "text-generation-inference/integration-tests/fixtures/neuron/model.py", "repo_id": "text-generation-inference", "token_count": 3604 }
252
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [], "seed": 0, "tokens": [ { "id": 5380, "logprob": 0.0, "special": false, "text": "?\n" }, { "id": 34564, "logprob": 0.0, ...
text-generation-inference/integration-tests/models/__snapshots__/test_compressed_tensors_w8a8_int/test_compressed_tensors_w8a8_int_all_params.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_compressed_tensors_w8a8_int/test_compressed_tensors_w8a8_int_all_params.json", "repo_id": "text-generation-inference", "token_count": 853 }
253
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [], "seed": null, "tokens": [ { "id": 13, "logprob": -1.9306641, "special": false, "text": "\n" }, { "id": 5618, "logprob": ...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_awq/test_flash_llama_awq.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_awq/test_flash_llama_awq.json", "repo_id": "text-generation-inference", "token_count": 868 }
254
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [], "seed": null, "tokens": [ { "id": 604, "logprob": -2.4296875, "special": false, "text": " for" }, { "id": 573, "logprob"...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_gemma_gptq/test_flash_gemma_gptq.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_gemma_gptq/test_flash_gemma_gptq.json", "repo_id": "text-generation-inference", "token_count": 872 }
255
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [], "seed": null, "tokens": [ { "id": 369, "logprob": -2.1816406, "special": false, "text": " for" }, { "id": 279, "logprob"...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_llama_fp8/test_flash_llama_fp8.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_llama_fp8/test_flash_llama_fp8.json", "repo_id": "text-generation-inference", "token_count": 862 }
256
[ { "choices": [ { "finish_reason": "length", "index": 0, "logprobs": null, "message": { "content": "Jeff Walker's Product Launch Formula is a comprehensive system", "name": null, "role": "assistant", "tool_calls": null }, ...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_llama_prefix_flashdecoding/test_flash_llama_flashdecoding.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_llama_prefix_flashdecoding/test_flash_llama_flashdecoding.json", "repo_id": "text-generation-inference", "token_count": 32357 }
257
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [], "seed": null, "tokens": [ { "id": 42, "logprob": -0.88378906, "special": false, "text": "I" }, { "id": 1353, "logprob": ...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_neox/test_flash_neox.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_neox/test_flash_neox.json", "repo_id": "text-generation-inference", "token_count": 854 }
258
{ "choices": [ { "finish_reason": "stop", "index": 0, "logprobs": null, "message": { "content": "The image showcases the Statue of Liberty, a colossal bronze statue located in New York Harbor, a heritage building in the United States. The statue has a majestic presence, with one ar...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_qwen2_5_vl/test_flash_qwen2_5_vl_bay.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_qwen2_5_vl/test_flash_qwen2_5_vl_bay.json", "repo_id": "text-generation-inference", "token_count": 395 }
259
{ "details": { "best_of_sequences": null, "finish_reason": "eos_token", "generated_tokens": 9, "prefill": [], "seed": null, "tokens": [ { "id": 2684, "logprob": -0.24902344, "special": false, "text": " There" }, { "id": 374, "lo...
text-generation-inference/integration-tests/models/__snapshots__/test_idefics3/test_flash_idefics3_next_simple_url.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_idefics3/test_flash_idefics3_next_simple_url.json", "repo_id": "text-generation-inference", "token_count": 796 }
260
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 0, "logprob": null, "text": "<pad>" } ], "seed": 0, "tokens": [ { "id": 16017, "logprob": 0.0, "special": fals...
text-generation-inference/integration-tests/models/__snapshots__/test_mt0_base/test_mt0_base_all_params.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_mt0_base/test_mt0_base_all_params.json", "repo_id": "text-generation-inference", "token_count": 910 }
261
{ "choices": [ { "delta": { "content": " assistant", "role": "assistant", "tool_calls": null }, "finish_reason": null, "index": 0, "logprobs": null } ], "created": 1728497531, "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_insufficient_information_stream.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_tools_llama/test_flash_llama_grammar_tools_insufficient_information_stream.json", "repo_id": "text-generation-inference", "token_count": 205 }
262
import pytest import requests @pytest.fixture(scope="module") def llama_continue_final_message_handle(launcher): with launcher("TinyLlama/TinyLlama-1.1B-Chat-v1.0") as handle: yield handle @pytest.fixture(scope="module") async def llama_continue_final_message(llama_continue_final_message_handle): aw...
text-generation-inference/integration-tests/models/test_continue_final_message.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_continue_final_message.py", "repo_id": "text-generation-inference", "token_count": 1102 }
263
import pytest @pytest.fixture(scope="module") def flash_llama_marlin24_handle(launcher): with launcher( "nm-testing/Llama-2-7b-pruned2.4-Marlin_24", quantize="marlin" ) as handle: yield handle @pytest.fixture(scope="module") async def flash_llama_marlin(flash_llama_marlin24_handle): awai...
text-generation-inference/integration-tests/models/test_flash_llama_marlin_24.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_flash_llama_marlin_24.py", "repo_id": "text-generation-inference", "token_count": 754 }
264
import pytest @pytest.fixture(scope="module") def flash_qwen2_vl_handle(launcher): with launcher("Qwen/Qwen2-VL-7B-Instruct") as handle: yield handle @pytest.fixture(scope="module") async def flash_qwen2(flash_qwen2_vl_handle): await flash_qwen2_vl_handle.health(300) return flash_qwen2_vl_handle...
text-generation-inference/integration-tests/models/test_flash_qwen2_vl.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_flash_qwen2_vl.py", "repo_id": "text-generation-inference", "token_count": 2158 }
265
import pytest @pytest.fixture(scope="module") def mt0_base_handle(launcher): with launcher("bigscience/mt0-base") as handle: yield handle @pytest.fixture(scope="module") async def mt0_base(mt0_base_handle): await mt0_base_handle.health(300) return mt0_base_handle.client @pytest.mark.release @p...
text-generation-inference/integration-tests/models/test_mt0_base.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_mt0_base.py", "repo_id": "text-generation-inference", "token_count": 737 }
266
pub fn get_cuda_capability() -> Option<(usize, usize)> { use pyo3::prelude::*; let py_get_capability = |py: Python| -> PyResult<(isize, isize)> { let torch = py.import_bound("torch.cuda")?; let get_device_capability = torch.getattr("get_device_capability")?; get_device_capability.call0(...
text-generation-inference/launcher/src/gpu.rs/0
{ "file_path": "text-generation-inference/launcher/src/gpu.rs", "repo_id": "text-generation-inference", "token_count": 350 }
267
final: prev: { # You can use this overlay to temporarily override packages for # development. For permanent overrides, it's better to do this in # our package flake: # # https://github.com/huggingface/text-generation-inference-nix # # Note that overriding packages that are in the transitive closure # of...
text-generation-inference/nix/overlay.nix/0
{ "file_path": "text-generation-inference/nix/overlay.nix", "repo_id": "text-generation-inference", "token_count": 597 }
268