text
stringlengths
7
1.24M
id
stringlengths
14
166
metadata
dict
__index_level_0__
int64
0
519
# Copyright 2024 Katherine Crowson, The HuggingFace Team and hlky. 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_k_dpm_2_ancestral_discrete.py/0
{ "file_path": "diffusers/src/diffusers/schedulers/scheduling_k_dpm_2_ancestral_discrete.py", "repo_id": "diffusers", "token_count": 9739 }
166
# 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/schedulers/scheduling_utils_flax.py/0
{ "file_path": "diffusers/src/diffusers/schedulers/scheduling_utils_flax.py", "repo_id": "diffusers", "token_count": 4948 }
167
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..utils import DummyObject, requires_backends class StableDiffusionKDiffusionPipeline(metaclass=DummyObject): _backends = ["torch", "transformers", "k_diffusion"] def __init__(self, *args, **kwargs): requires_backends(se...
diffusers/src/diffusers/utils/dummy_torch_and_transformers_and_k_diffusion_objects.py/0
{ "file_path": "diffusers/src/diffusers/utils/dummy_torch_and_transformers_and_k_diffusion_objects.py", "repo_id": "diffusers", "token_count": 451 }
168
import functools import importlib import inspect import io import logging import multiprocessing import os import random import re import struct import sys import tempfile import time import unittest import urllib.parse from contextlib import contextmanager from io import BytesIO, StringIO from pathlib import Path from...
diffusers/src/diffusers/utils/testing_utils.py/0
{ "file_path": "diffusers/src/diffusers/utils/testing_utils.py", "repo_id": "diffusers", "token_count": 14935 }
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/models/autoencoders/test_models_vae.py/0
{ "file_path": "diffusers/tests/models/autoencoders/test_models_vae.py", "repo_id": "diffusers", "token_count": 21124 }
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/models/transformers/test_models_transformer_latte.py/0
{ "file_path": "diffusers/tests/models/transformers/test_models_transformer_latte.py", "repo_id": "diffusers", "token_count": 1169 }
171
# 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/tests/others/test_check_dummies.py/0
{ "file_path": "diffusers/tests/others/test_check_dummies.py", "repo_id": "diffusers", "token_count": 1872 }
172
import gc import unittest import numpy as np import torch from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer import diffusers from diffusers import ( AnimateDiffPipeline, AutoencoderKL, DDIMScheduler, DPMSolverMultistepScheduler, LCMScheduler, MotionAdapter, StableDiffus...
diffusers/tests/pipelines/animatediff/test_animatediff.py/0
{ "file_path": "diffusers/tests/pipelines/animatediff/test_animatediff.py", "repo_id": "diffusers", "token_count": 10689 }
173
import gc import unittest import numpy as np import torch from torch.backends.cuda import sdp_kernel from diffusers import ( CMStochasticIterativeScheduler, ConsistencyModelPipeline, UNet2DModel, ) from diffusers.utils.testing_utils import ( enable_full_determinism, nightly, require_torch_2, ...
diffusers/tests/pipelines/consistency_models/test_consistency_models.py/0
{ "file_path": "diffusers/tests/pipelines/consistency_models/test_consistency_models.py", "repo_id": "diffusers", "token_count": 5052 }
174
# coding=utf-8 # Copyright 2024 HuggingFace Inc and The InstantX 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 b...
diffusers/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py/0
{ "file_path": "diffusers/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py", "repo_id": "diffusers", "token_count": 5922 }
175
import gc import inspect import unittest import numpy as np import torch from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, LatentConsistencyModelPipeline, LCMScheduler, UNet2DConditionModel, ) from diffusers.utils.testing_utils import ( en...
diffusers/tests/pipelines/latent_consistency_models/test_latent_consistency_models.py/0
{ "file_path": "diffusers/tests/pipelines/latent_consistency_models/test_latent_consistency_models.py", "repo_id": "diffusers", "token_count": 4773 }
176
# 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/musicldm/test_musicldm.py/0
{ "file_path": "diffusers/tests/pipelines/musicldm/test_musicldm.py", "repo_id": "diffusers", "token_count": 8048 }
177
# 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_depth.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_depth.py", "repo_id": "diffusers", "token_count": 11083 }
178
# 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_adapter.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_adapter.py", "repo_id": "diffusers", "token_count": 12911 }
179
from diffusers.utils.testing_utils import require_onnxruntime @require_onnxruntime class OnnxPipelineTesterMixin: """ This mixin is designed to be used with unittest.TestCase classes. It provides a set of common tests for each ONNXRuntime pipeline, e.g. saving and loading the pipeline, equivalence of ...
diffusers/tests/pipelines/test_pipelines_onnx_common.py/0
{ "file_path": "diffusers/tests/pipelines/test_pipelines_onnx_common.py", "repo_id": "diffusers", "token_count": 118 }
180
import torch from diffusers import CMStochasticIterativeScheduler from .test_schedulers import SchedulerCommonTest class CMStochasticIterativeSchedulerTest(SchedulerCommonTest): scheduler_classes = (CMStochasticIterativeScheduler,) num_inference_steps = 10 def get_scheduler_config(self, **kwargs): ...
diffusers/tests/schedulers/test_scheduler_consistency_model.py/0
{ "file_path": "diffusers/tests/schedulers/test_scheduler_consistency_model.py", "repo_id": "diffusers", "token_count": 3029 }
181
import torch from diffusers import HeunDiscreteScheduler from diffusers.utils.testing_utils import torch_device from .test_schedulers import SchedulerCommonTest class HeunDiscreteSchedulerTest(SchedulerCommonTest): scheduler_classes = (HeunDiscreteScheduler,) num_inference_steps = 10 def get_scheduler_...
diffusers/tests/schedulers/test_scheduler_heun.py/0
{ "file_path": "diffusers/tests/schedulers/test_scheduler_heun.py", "repo_id": "diffusers", "token_count": 3945 }
182
# 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/single_file/test_model_controlnet_single_file.py/0
{ "file_path": "diffusers/tests/single_file/test_model_controlnet_single_file.py", "repo_id": "diffusers", "token_count": 991 }
183
# coding=utf-8 # Copyright 2024 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/check_config_docstrings.py/0
{ "file_path": "diffusers/utils/check_config_docstrings.py", "repo_id": "diffusers", "token_count": 1113 }
184
#!/usr/bin/env python3 # coding=utf-8 # Copyright 2024 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 # # Unles...
diffusers/utils/print_env.py/0
{ "file_path": "diffusers/utils/print_env.py", "repo_id": "diffusers", "token_count": 424 }
185
# Video benchmark ## Questions What is the optimal trade-off between: - maximizing loading time with random access, - minimizing memory space on disk, - maximizing success rate of policies, - compatibility across devices/platforms for decoding videos (e.g. video players, web browsers). How to encode videos? - Which ...
lerobot/benchmarks/video/README.md/0
{ "file_path": "lerobot/benchmarks/video/README.md", "repo_id": "lerobot", "token_count": 6168 }
186
#!/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/__init__.py/0
{ "file_path": "lerobot/lerobot/__init__.py", "repo_id": "lerobot", "token_count": 3408 }
187
#!/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/_diffusion_policy_replay_buffer.py/0
{ "file_path": "lerobot/lerobot/common/datasets/push_dataset_to_hub/_diffusion_policy_replay_buffer.py", "repo_id": "lerobot", "token_count": 10692 }
188
#!/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/sampler.py/0
{ "file_path": "lerobot/lerobot/common/datasets/sampler.py", "repo_id": "lerobot", "token_count": 952 }
189
#!/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/policies/utils.py/0
{ "file_path": "lerobot/lerobot/common/policies/utils.py", "repo_id": "lerobot", "token_count": 590 }
190
defaults: - _self_ - env: pusht - policy: diffusion hydra: run: # Set `dir` to where you would like to save all of the run outputs. If you run another training session # with the same value for `dir` its contents will be overwritten unless you set `resume` to true. dir: outputs/train/${now:%Y-%m-%d...
lerobot/lerobot/configs/default.yaml/0
{ "file_path": "lerobot/lerobot/configs/default.yaml", "repo_id": "lerobot", "token_count": 1759 }
191
_target_: lerobot.common.robot_devices.robots.koch.KochRobot calibration_path: .cache/calibration/koch_bimanual.pkl leader_arms: left: _target_: lerobot.common.robot_devices.motors.dynamixel.DynamixelMotorsBus port: /dev/tty.usbmodem585A0085511 motors: # name: (index, model) shoulder_pan: [1, ...
lerobot/lerobot/configs/robot/koch_bimanual.yaml/0
{ "file_path": "lerobot/lerobot/configs/robot/koch_bimanual.yaml", "repo_id": "lerobot", "token_count": 1135 }
192
version https://git-lfs.github.com/spec/v1 oid sha256:d394d451929b805f2d94f9fc5b12d15c31cfc494df76d7d642b63378b8ba0131 size 247
lerobot/tests/data/lerobot/aloha_mobile_elevator/train/state.json/0
{ "file_path": "lerobot/tests/data/lerobot/aloha_mobile_elevator/train/state.json", "repo_id": "lerobot", "token_count": 66 }
193
version https://git-lfs.github.com/spec/v1 oid sha256:0a2c1f98c816728136291fcb7530cd0ebcf4ea47b0f6750836da56b8324d64c1 size 435600
lerobot/tests/data/lerobot/aloha_mobile_wash_pan/train/data-00000-of-00001.arrow/0
{ "file_path": "lerobot/tests/data/lerobot/aloha_mobile_wash_pan/train/data-00000-of-00001.arrow", "repo_id": "lerobot", "token_count": 66 }
194
version https://git-lfs.github.com/spec/v1 oid sha256:50e40e4c2bb523fca0b54e9a9635281312e9c6f9d757db03c06a0865c5508f29 size 188
lerobot/tests/data/lerobot/aloha_sim_insertion_human/meta_data/info.json/0
{ "file_path": "lerobot/tests/data/lerobot/aloha_sim_insertion_human/meta_data/info.json", "repo_id": "lerobot", "token_count": 68 }
195
version https://git-lfs.github.com/spec/v1 oid sha256:3948750400c273b7e3ef2998fa84ca7a520d8972c8759c2428ff6fbdc2bd8fb7 size 11505144
lerobot/tests/data/lerobot/aloha_sim_transfer_cube_scripted_image/train/data-00000-of-00001.arrow/0
{ "file_path": "lerobot/tests/data/lerobot/aloha_sim_transfer_cube_scripted_image/train/data-00000-of-00001.arrow", "repo_id": "lerobot", "token_count": 66 }
196
version https://git-lfs.github.com/spec/v1 oid sha256:e03257da37ff6c6c37551bd2edf7bfaf832bbd9856d074978633a80cb32ee1d0 size 280536
lerobot/tests/data/lerobot/aloha_static_candy/train/data-00000-of-00001.arrow/0
{ "file_path": "lerobot/tests/data/lerobot/aloha_static_candy/train/data-00000-of-00001.arrow", "repo_id": "lerobot", "token_count": 65 }
197
version https://git-lfs.github.com/spec/v1 oid sha256:8d97986c8775f069c508fee38129b9707c6ad8bf44dda7de54829e3685c1c0cb size 247
lerobot/tests/data/lerobot/aloha_static_cups_open/train/state.json/0
{ "file_path": "lerobot/tests/data/lerobot/aloha_static_cups_open/train/state.json", "repo_id": "lerobot", "token_count": 65 }
198
version https://git-lfs.github.com/spec/v1 oid sha256:3ee1bdb3085dc4554f58ccad0db48ca9ad153d866faa4b2ba42afebb3e3206b6 size 280536
lerobot/tests/data/lerobot/aloha_static_tape/train/data-00000-of-00001.arrow/0
{ "file_path": "lerobot/tests/data/lerobot/aloha_static_tape/train/data-00000-of-00001.arrow", "repo_id": "lerobot", "token_count": 66 }
199
version https://git-lfs.github.com/spec/v1 oid sha256:6ab094bd9de1a90273cefa1e02a84b3c3916e7812b9c73932f8f92ab2f1b9ba9 size 3432
lerobot/tests/data/lerobot/pusht_image/meta_data/episode_data_index.safetensors/0
{ "file_path": "lerobot/tests/data/lerobot/pusht_image/meta_data/episode_data_index.safetensors", "repo_id": "lerobot", "token_count": 71 }
200
version https://git-lfs.github.com/spec/v1 oid sha256:ffb9f0f0c5001460cfe1d49ba84ad2722be5ee7885de97dd733cf9b36104a702 size 1245
lerobot/tests/data/lerobot/umi_cup_in_the_wild/train/dataset_info.json/0
{ "file_path": "lerobot/tests/data/lerobot/umi_cup_in_the_wild/train/dataset_info.json", "repo_id": "lerobot", "token_count": 64 }
201
version https://git-lfs.github.com/spec/v1 oid sha256:1d6f6342fa2e42703d1584c19e018c2f1254d24beb15a5ac54623c72e6e45e28 size 136
lerobot/tests/data/lerobot/xarm_lift_medium_replay/meta_data/episode_data_index.safetensors/0
{ "file_path": "lerobot/tests/data/lerobot/xarm_lift_medium_replay/meta_data/episode_data_index.safetensors", "repo_id": "lerobot", "token_count": 67 }
202
version https://git-lfs.github.com/spec/v1 oid sha256:791cbb9702e4b7313939600d64658c51e929c4e6d3945ed65fae25e0f9c27484 size 4928
lerobot/tests/data/lerobot/xarm_push_medium/train/data-00000-of-00001.arrow/0
{ "file_path": "lerobot/tests/data/lerobot/xarm_push_medium/train/data-00000-of-00001.arrow", "repo_id": "lerobot", "token_count": 67 }
203
version https://git-lfs.github.com/spec/v1 oid sha256:c8d9f9cc9e232820760fe4a46b47000c921fa5d868420e55d8dbc05dae56e8bd size 111338
lerobot/tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_160.safetensors/0
{ "file_path": "lerobot/tests/data/save_dataset_to_safetensors/lerobot/pusht/frame_160.safetensors", "repo_id": "lerobot", "token_count": 69 }
204
version https://git-lfs.github.com/spec/v1 oid sha256:d796577863740e8fd643a056e9eff891e51a858ff66019eba11f0a982cb9e9c0 size 16904
lerobot/tests/data/save_policy_to_safetensors/xarm_tdmpcuse_mpc/grad_stats.safetensors/0
{ "file_path": "lerobot/tests/data/save_policy_to_safetensors/xarm_tdmpcuse_mpc/grad_stats.safetensors", "repo_id": "lerobot", "token_count": 68 }
205
#!/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/tests/test_image_transforms.py/0
{ "file_path": "lerobot/tests/test_image_transforms.py", "repo_id": "lerobot", "token_count": 4575 }
206
from transformers import AutoFeatureExtractor, AutoTokenizer from parler_tts import ParlerTTSForConditionalGeneration path = "TODO" repo_id = "parler_tts_600M" AutoFeatureExtractor.from_pretrained("ylacombe/dac_44khZ_8kbps").push_to_hub(repo_id) AutoTokenizer.from_pretrained("google/t5-v1_1-base").push_to_hub(repo...
parler-tts/helpers/push_to_hub_scripts/push_trained_parler_tts_to_hub.py/0
{ "file_path": "parler-tts/helpers/push_to_hub_scripts/push_trained_parler_tts_to_hub.py", "repo_id": "parler-tts", "token_count": 158 }
207
from dataclasses import dataclass, field from typing import Optional from transformers import Seq2SeqTrainingArguments @dataclass class ModelArguments: """ Arguments pertaining to which model/config/tokenizer we are going to fine-tune from. """ model_name_or_path: str = field( metadata={"hel...
parler-tts/training/arguments.py/0
{ "file_path": "parler-tts/training/arguments.py", "repo_id": "parler-tts", "token_count": 5930 }
208
<!--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/conceptual_guides/ia3.md/0
{ "file_path": "peft/docs/source/conceptual_guides/ia3.md", "repo_id": "peft", "token_count": 1030 }
209
<!--⚠️ 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 }
210
# 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/boft_controlnet/eval.py/0
{ "file_path": "peft/examples/boft_controlnet/eval.py", "repo_id": "peft", "token_count": 3390 }
211
<!--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_dreambooth/boft_dreambooth.md/0
{ "file_path": "peft/examples/boft_dreambooth/boft_dreambooth.md", "repo_id": "peft", "token_count": 2634 }
212
import os import torch from datasets import load_dataset from transformers import ( AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, DataCollatorWithPadding, Trainer, TrainingArguments, ) from peft import LoraConfig, get_peft_model, prepare_model_for_kbit_training def train_model( ...
peft/examples/dora_finetuning/dora_finetuning.py/0
{ "file_path": "peft/examples/dora_finetuning/dora_finetuning.py", "repo_id": "peft", "token_count": 3104 }
213
# Fine-tuning for image classification using LoRA and 🤗 PEFT ## Vision Transformer model from transformers [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/peft/blob/main/examples/image_classification/image_classification_peft_lora.ipyn...
peft/examples/image_classification/README.md/0
{ "file_path": "peft/examples/image_classification/README.md", "repo_id": "peft", "token_count": 457 }
214
<jupyter_start><jupyter_code>import argparse import gc import hashlib import itertools import logging import math import os import threading import warnings from pathlib import Path from typing import Optional import psutil import json import torch import torch.nn.functional as F import torch.utils.checkpoint from tor...
peft/examples/lora_dreambooth/lora_dreambooth_inference.ipynb/0
{ "file_path": "peft/examples/lora_dreambooth/lora_dreambooth_inference.ipynb", "repo_id": "peft", "token_count": 2282 }
215
from mistralrs import ChatCompletionRequest, Runner, Which runner = Runner( which=Which.XLora( tok_model_id=None, # Automatically determine from ordering file model_id=..., # Model ID of the base model (local path of HF model ID) xlora_model_id=..., # X-LoRA Model ID of the base model (...
peft/examples/xlora/xlora_inference_mistralrs.py/0
{ "file_path": "peft/examples/xlora/xlora_inference_mistralrs.py", "repo_id": "peft", "token_count": 356 }
216
# 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/peft_model.py/0
{ "file_path": "peft/src/peft/peft_model.py", "repo_id": "peft", "token_count": 60834 }
217
# 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/boft/config.py/0
{ "file_path": "peft/src/peft/tuners/boft/config.py", "repo_id": "peft", "token_count": 2537 }
218
# 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/ia3/config.py/0
{ "file_path": "peft/src/peft/tuners/ia3/config.py", "repo_id": "peft", "token_count": 1842 }
219
# 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/aqlm.py/0
{ "file_path": "peft/src/peft/tuners/lora/aqlm.py", "repo_id": "peft", "token_count": 1399 }
220
# 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/multitask_prompt_tuning/model.py/0
{ "file_path": "peft/src/peft/tuners/multitask_prompt_tuning/model.py", "repo_id": "peft", "token_count": 2251 }
221
# 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/loftq_utils.py/0
{ "file_path": "peft/src/peft/utils/loftq_utils.py", "repo_id": "peft", "token_count": 7269 }
222
# 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_feature_extraction_models.py/0
{ "file_path": "peft/tests/test_feature_extraction_models.py", "repo_id": "peft", "token_count": 3721 }
223
# 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_vision_models.py/0
{ "file_path": "peft/tests/test_vision_models.py", "repo_id": "peft", "token_count": 2448 }
224
#!/usr/bin/env python3 """ Bulk Model Script Runner Run validation or benchmark script in separate process for each model Benchmark all 'vit*' models: python bulk_runner.py --model-list 'vit*' --results-file vit_bench.csv benchmark.py --amp -b 512 Validate all models: python bulk_runner.py --model-list all --resul...
pytorch-image-models/bulk_runner.py/0
{ "file_path": "pytorch-image-models/bulk_runner.py", "repo_id": "pytorch-image-models", "token_count": 3627 }
225
# CSP-DarkNet **CSPDarknet53** is a convolutional neural network and backbone for object detection that uses [DarkNet-53](https://paperswithcode.com/method/darknet-53). It employs a CSPNet strategy to partition the feature map of the base layer into two parts and then merges them through a cross-stage hierarchy. The u...
pytorch-image-models/hfdocs/source/models/csp-darknet.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/csp-darknet.mdx", "repo_id": "pytorch-image-models", "token_count": 1756 }
226
# PNASNet **Progressive Neural Architecture Search**, or **PNAS**, is a method for learning the structure of convolutional neural networks (CNNs). It uses a sequential model-based optimization (SMBO) strategy, where we search the space of cell structures, starting with simple (shallow) models and progressing to comple...
pytorch-image-models/hfdocs/source/models/pnasnet.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/pnasnet.mdx", "repo_id": "pytorch-image-models", "token_count": 1622 }
227
# SSL ResNet **Residual Networks**, or **ResNets**, learn residual functions with reference to the layer inputs, instead of learning unreferenced functions. Instead of hoping each few stacked layers directly fit a desired underlying mapping, residual nets let these layers fit a residual mapping. They stack [residual b...
pytorch-image-models/hfdocs/source/models/ssl-resnet.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/ssl-resnet.mdx", "repo_id": "pytorch-image-models", "token_count": 2425 }
228
# Learning Rate Schedulers This page contains the API reference documentation for learning rate schedulers included in `timm`. ## Schedulers ### Factory functions [[autodoc]] timm.scheduler.scheduler_factory.create_scheduler [[autodoc]] timm.scheduler.scheduler_factory.create_scheduler_v2 ### Scheduler Classes [[...
pytorch-image-models/hfdocs/source/reference/schedulers.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/reference/schedulers.mdx", "repo_id": "pytorch-image-models", "token_count": 242 }
229
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 }
230
""" 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 }
231
""" 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 }
232
""" 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 }
233
""" 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 }
234
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 }
235
""" 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 }
236
""" 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": 14385 }
237
""" 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 }
238
""" 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": 18107 }
239
""" NasNet-A (Large) nasnetalarge implementation grabbed from Cadene's pretrained models https://github.com/Cadene/pretrained-models.pytorch """ from functools import partial from typing import Optional import torch import torch.nn as nn import torch.nn.functional as F from timm.layers import ConvNormAct, create_co...
pytorch-image-models/timm/models/nasnet.py/0
{ "file_path": "pytorch-image-models/timm/models/nasnet.py", "repo_id": "pytorch-image-models", "token_count": 13276 }
240
""" ReXNet A PyTorch impl of `ReXNet: Diminishing Representational Bottleneck on Convolutional Neural Network` - https://arxiv.org/abs/2007.00992 Adapted from original impl at https://github.com/clovaai/rexnet Copyright (c) 2020-present NAVER Corp. MIT license Changes for timm, feature extraction, and rounded channe...
pytorch-image-models/timm/models/rexnet.py/0
{ "file_path": "pytorch-image-models/timm/models/rexnet.py", "repo_id": "pytorch-image-models", "token_count": 5803 }
241
""" Relative Position Vision Transformer (ViT) in PyTorch NOTE: these models are experimental / WIP, expect changes Hacked together by / Copyright 2022, Ross Wightman """ import logging import math from functools import partial from typing import List, Optional, Tuple, Type, Union try: from typing import Literal...
pytorch-image-models/timm/models/vision_transformer_relpos.py/0
{ "file_path": "pytorch-image-models/timm/models/vision_transformer_relpos.py", "repo_id": "pytorch-image-models", "token_count": 13354 }
242
""" PyTorch LARS / LARC Optimizer An implementation of LARS (SGD) + LARC in PyTorch Based on: * PyTorch SGD: https://github.com/pytorch/pytorch/blob/1.7/torch/optim/sgd.py#L100 * NVIDIA APEX LARC: https://github.com/NVIDIA/apex/blob/master/apex/parallel/LARC.py Additional cleanup and modifications to properly su...
pytorch-image-models/timm/optim/lars.py/0
{ "file_path": "pytorch-image-models/timm/optim/lars.py", "repo_id": "pytorch-image-models", "token_count": 2571 }
243
""" Polynomial Scheduler Polynomial LR schedule with warmup, noise. Hacked together by / Copyright 2021 Ross Wightman """ import math import logging from typing import List import torch from .scheduler import Scheduler _logger = logging.getLogger(__name__) class PolyLRScheduler(Scheduler): """ Polynomial LR...
pytorch-image-models/timm/scheduler/poly_lr.py/0
{ "file_path": "pytorch-image-models/timm/scheduler/poly_lr.py", "repo_id": "pytorch-image-models", "token_count": 1979 }
244
""" Misc utils Hacked together by / Copyright 2020 Ross Wightman """ import argparse import ast import re def natural_key(string_): """See http://www.codinghorror.com/blog/archives/001018.html""" return [int(s) if s.isdigit() else s for s in re.split(r'(\d+)', string_.lower())] def add_bool_arg(parser, nam...
pytorch-image-models/timm/utils/misc.py/0
{ "file_path": "pytorch-image-models/timm/utils/misc.py", "repo_id": "pytorch-image-models", "token_count": 451 }
245
# Rust builder FROM lukemathwalker/cargo-chef:latest-rust-1.80 AS chef WORKDIR /usr/src ARG CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse FROM chef AS planner COPY Cargo.lock Cargo.lock COPY Cargo.toml Cargo.toml COPY rust-toolchain.toml rust-toolchain.toml COPY proto proto COPY benchmark benchmark COPY router router CO...
text-generation-inference/Dockerfile_amd/0
{ "file_path": "text-generation-inference/Dockerfile_amd", "repo_id": "text-generation-inference", "token_count": 2713 }
246
#[allow(clippy::derive_partial_eq_without_eq)] mod pb; mod client; mod sharded_client; pub use client::Client; pub use pb::generate::v3::{ input_chunk::Chunk, Batch, CachedBatch, FinishReason, GeneratedText, Generation, GrammarType, HealthResponse, Image, InfoResponse, Input, InputChunk, NextTokenChooserParam...
text-generation-inference/backends/client/src/v3/mod.rs/0
{ "file_path": "text-generation-inference/backends/client/src/v3/mod.rs", "repo_id": "text-generation-inference", "token_count": 142 }
247
// // Created by mfuntowicz on 7/23/24. // #ifndef TGI_TRTLLM_BACKEND_HARDWARE_H #define TGI_TRTLLM_BACKEND_HARDWARE_H #include <cstdint> #include <limits> #include <fmt/base.h> #include <spdlog/spdlog.h> #include <nvml.h> namespace huggingface::hardware::cuda { #define AMPERE_SM_MAJOR 8 #define HOPPER_SM_MAJOR 8 ...
text-generation-inference/backends/trtllm/include/hardware.h/0
{ "file_path": "text-generation-inference/backends/trtllm/include/hardware.h", "repo_id": "text-generation-inference", "token_count": 774 }
248
use crate::client::{ClientError, Result}; /// Multi shard Client use crate::client::{Health, ShardInfo}; use crate::client::grpc_client::{DecodeTimings, PrefillTimings}; use crate::client::{ Batch, CachedBatch, Client, Generation, GrammarType, HealthResponse, NextTokenChooserParameters, Request, StoppingCriter...
text-generation-inference/backends/v3/src/client/sharded_client.rs/0
{ "file_path": "text-generation-inference/backends/v3/src/client/sharded_client.rs", "repo_id": "text-generation-inference", "token_count": 4198 }
249
# 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 }
250
- sections: - local: index title: Text Generation Inference - local: quicktour title: Quick Tour - local: installation_nvidia title: Using TGI with Nvidia GPUs - local: installation_amd title: Using TGI with AMD GPUs - local: installation_gaudi title: Using TGI with Intel Gaudi - local: ...
text-generation-inference/docs/source/_toctree.yml/0
{ "file_path": "text-generation-inference/docs/source/_toctree.yml", "repo_id": "text-generation-inference", "token_count": 747 }
251
# Quantization TGI offers many quantization schemes to run LLMs effectively and fast based on your use-case. TGI supports GPTQ, AWQ, bits-and-bytes, EETQ, Marlin, EXL2 and fp8 quantization. To leverage GPTQ, AWQ, Marlin and EXL2 quants, you must provide pre-quantized weights. Whereas for bits-and-bytes, EETQ and fp8,...
text-generation-inference/docs/source/conceptual/quantization.md/0
{ "file_path": "text-generation-inference/docs/source/conceptual/quantization.md", "repo_id": "text-generation-inference", "token_count": 1430 }
252
# Supported Models and Hardware Text Generation Inference enables serving optimized models on specific hardware for the highest performance. The following sections list which models (VLMs & LLMs) are supported. ## Supported Models - [Deepseek V2](https://huggingface.co/deepseek-ai/DeepSeek-V2) - [Idefics 2](https:/...
text-generation-inference/docs/source/supported_models.md/0
{ "file_path": "text-generation-inference/docs/source/supported_models.md", "repo_id": "text-generation-inference", "token_count": 1141 }
253
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 1, "logprob": null, "text": "<s>" }, { "id": 1724, "logprob": -7.703125, "text": "What" }, { "id": 338...
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": 1236 }
254
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 2, "logprob": null, "text": "<bos>" }, { "id": 2015, "logprob": -9.640625, "text": "Test" }, { "id": 3...
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": 1053 }
255
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 128000, "logprob": null, "text": "<|begin_of_text|>" }, { "id": 2323, "logprob": -9.421875, "text": "Test" }, ...
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": 1053 }
256
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 1, "logprob": null, "text": "<s>" }, { "id": 3735, "logprob": -12.9140625, "text": "Test" }, { "id": 2...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_mistral/test_flash_mistral_all_params.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_mistral/test_flash_mistral_all_params.json", "repo_id": "text-generation-inference", "token_count": 1041 }
257
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 589, "logprob": null, "text": "def" }, { "id": 1459, "logprob": -5.6289062, "text": " print" }, { "id"...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_starcoder/test_flash_starcoder.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_starcoder/test_flash_starcoder.json", "repo_id": "text-generation-inference", "token_count": 1111 }
258
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [], "seed": null, "tokens": [ { "id": 330, "logprob": -0.08660889, "special": false, "text": " A" }, { "id": 13088, "logprob...
text-generation-inference/integration-tests/models/__snapshots__/test_idefics2/test_flash_idefics2_next_simple.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_idefics2/test_flash_idefics2_next_simple.json", "repo_id": "text-generation-inference", "token_count": 868 }
259
[ { "details": { "best_of_sequences": null, "finish_reason": "eos_token", "generated_tokens": 6, "prefill": [ { "id": 0, "logprob": null, "text": "<pad>" } ], "seed": null, "tokens": [ { "id": 259, ...
text-generation-inference/integration-tests/models/__snapshots__/test_mt0_base/test_mt0_base_load.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_mt0_base/test_mt0_base_load.json", "repo_id": "text-generation-inference", "token_count": 2874 }
260
import pytest @pytest.fixture(scope="module") def bloom_560m_sharded_handle(launcher): with launcher("bigscience/bloom-560m", num_shard=2) as handle: yield handle @pytest.fixture(scope="module") async def bloom_560m_sharded(bloom_560m_sharded_handle): await bloom_560m_sharded_handle.health(240) ...
text-generation-inference/integration-tests/models/test_bloom_560m_sharded.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_bloom_560m_sharded.py", "repo_id": "text-generation-inference", "token_count": 527 }
261
import pytest @pytest.fixture(scope="module") def flash_llama_marlin_handle(launcher): with launcher( "neuralmagic/llama-2-7b-chat-marlin", num_shard=2, quantize="marlin" ) as handle: yield handle @pytest.fixture(scope="module") async def flash_llama_marlin(flash_llama_marlin_handle): aw...
text-generation-inference/integration-tests/models/test_flash_llama_marlin.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_flash_llama_marlin.py", "repo_id": "text-generation-inference", "token_count": 748 }
262
import pytest import base64 # TODO fix the server parsser to count inline image tokens correctly def get_chicken(): with open("integration-tests/images/chicken_on_money.png", "rb") as image_file: encoded_string = base64.b64encode(image_file.read()) return f"data:image/png;base64,{encoded_string.decode...
text-generation-inference/integration-tests/models/test_idefics2.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_idefics2.py", "repo_id": "text-generation-inference", "token_count": 1397 }
263
use std::error::Error; use vergen::EmitBuilder; fn main() -> Result<(), Box<dyn Error>> { // Emit cargo and rustc compile time values EmitBuilder::builder().all_cargo().all_rustc().emit()?; // Try to get the git sha from the local git repository if EmitBuilder::builder() .fail_on_error() ...
text-generation-inference/launcher/build.rs/0
{ "file_path": "text-generation-inference/launcher/build.rs", "repo_id": "text-generation-inference", "token_count": 363 }
264
// pub(crate) mod v2; mod chat_template; pub mod tool_grammar; use crate::validation::{ValidGenerateRequest, Validation, ValidationError}; use crate::Tool; use crate::{ ChatTemplateVersions, FinishReason, GenerateRequest, HubProcessorConfig, HubTokenizerConfig, Message, PrefillToken, Token, }; use async_trait:...
text-generation-inference/router/src/infer/mod.rs/0
{ "file_path": "text-generation-inference/router/src/infer/mod.rs", "repo_id": "text-generation-inference", "token_count": 5577 }
265