text stringlengths 7 1.24M | id stringlengths 14 166 | metadata dict | __index_level_0__ int64 0 519 |
|---|---|---|---|
# 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/LICENSE-2.0
#
# Unless r... | transformers/tests/models/llava_next/test_modeling_llava_next.py/0 | {
"file_path": "transformers/tests/models/llava_next/test_modeling_llava_next.py",
"repo_id": "transformers",
"token_count": 10995
} | 413 |
# coding=utf-8
# Copyright 2018 LXMERT Authors, The Hugging Face 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... | transformers/tests/models/lxmert/test_modeling_lxmert.py/0 | {
"file_path": "transformers/tests/models/lxmert/test_modeling_lxmert.py",
"repo_id": "transformers",
"token_count": 15327
} | 414 |
# coding=utf-8
# Copyright 2022 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... | transformers/tests/models/markuplm/test_feature_extraction_markuplm.py/0 | {
"file_path": "transformers/tests/models/markuplm/test_feature_extraction_markuplm.py",
"repo_id": "transformers",
"token_count": 1485
} | 415 |
# 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 applicabl... | transformers/tests/models/musicgen/test_processing_musicgen.py/0 | {
"file_path": "transformers/tests/models/musicgen/test_processing_musicgen.py",
"repo_id": "transformers",
"token_count": 2474
} | 416 |
# coding=utf-8
# Copyright 2022 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
#
# Unless r... | transformers/tests/models/opt/test_modeling_tf_opt.py/0 | {
"file_path": "transformers/tests/models/opt/test_modeling_tf_opt.py",
"repo_id": "transformers",
"token_count": 7496
} | 417 |
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team, The Microsoft Research 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
#
# ... | transformers/tests/models/prophetnet/test_modeling_prophetnet.py/0 | {
"file_path": "transformers/tests/models/prophetnet/test_modeling_prophetnet.py",
"repo_id": "transformers",
"token_count": 25641
} | 418 |
# 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... | transformers/tests/models/qwen2_vl/test_image_processing_qwen2_vl.py/0 | {
"file_path": "transformers/tests/models/qwen2_vl/test_image_processing_qwen2_vl.py",
"repo_id": "transformers",
"token_count": 4620
} | 419 |
# coding=utf-8
# Copyright 2023 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
#
# Unless r... | transformers/tests/models/sam/test_modeling_sam.py/0 | {
"file_path": "transformers/tests/models/sam/test_modeling_sam.py",
"repo_id": "transformers",
"token_count": 12984
} | 420 |
# 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/LICENSE-2.0
#
# Unless r... | transformers/tests/models/seggpt/test_modeling_seggpt.py/0 | {
"file_path": "transformers/tests/models/seggpt/test_modeling_seggpt.py",
"repo_id": "transformers",
"token_count": 8356
} | 421 |
# coding=utf-8
# Copyright 2023 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
#
# Unless r... | transformers/tests/models/timm_backbone/test_modeling_timm_backbone.py/0 | {
"file_path": "transformers/tests/models/timm_backbone/test_modeling_timm_backbone.py",
"repo_id": "transformers",
"token_count": 4390
} | 422 |
# 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... | transformers/tests/models/vipllava/test_processor_vipllava.py/0 | {
"file_path": "transformers/tests/models/vipllava/test_processor_vipllava.py",
"repo_id": "transformers",
"token_count": 535
} | 423 |
# coding=utf-8
# Copyright 2023 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
#
# Unless r... | transformers/tests/models/vivit/test_modeling_vivit.py/0 | {
"file_path": "transformers/tests/models/vivit/test_modeling_vivit.py",
"repo_id": "transformers",
"token_count": 6198
} | 424 |
# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/tests/models/wav2vec2_with_lm/test_processor_wav2vec2_with_lm.py/0 | {
"file_path": "transformers/tests/models/wav2vec2_with_lm/test_processor_wav2vec2_with_lm.py",
"repo_id": "transformers",
"token_count": 9340
} | 425 |
# coding=utf-8
# Copyright 2021 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... | transformers/tests/models/xglm/test_tokenization_xglm.py/0 | {
"file_path": "transformers/tests/models/xglm/test_tokenization_xglm.py",
"repo_id": "transformers",
"token_count": 4238
} | 426 |
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/tests/pipelines/test_pipelines_text2text_generation.py/0 | {
"file_path": "transformers/tests/pipelines/test_pipelines_text2text_generation.py",
"repo_id": "transformers",
"token_count": 2131
} | 427 |
# Testing mixed int8 quantization

The following is the recipe on how to effectively debug `bitsandbytes` integration on Hugging Face `transformers`.
## Library requirements
+ `transformers>=4.22.... | transformers/tests/quantization/bnb/README.md/0 | {
"file_path": "transformers/tests/quantization/bnb/README.md",
"repo_id": "transformers",
"token_count": 1405
} | 428 |
# coding=utf-8
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | transformers/tests/quantization/torchao_integration/test_torchao.py/0 | {
"file_path": "transformers/tests/quantization/torchao_integration/test_torchao.py",
"repo_id": "transformers",
"token_count": 3433
} | 429 |
import json
import os
import subprocess
import unittest
from ast import literal_eval
import pytest
from parameterized import parameterized, parameterized_class
from . import is_sagemaker_available
if is_sagemaker_available():
from sagemaker import Session, TrainingJobAnalytics
from sagemaker.huggingface imp... | transformers/tests/sagemaker/test_multi_node_model_parallel.py/0 | {
"file_path": "transformers/tests/sagemaker/test_multi_node_model_parallel.py",
"repo_id": "transformers",
"token_count": 2103
} | 430 |
# coding=utf-8
# Copyright 2018 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 a... | transformers/tests/tokenization/test_tokenization_utils.py/0 | {
"file_path": "transformers/tests/tokenization/test_tokenization_utils.py",
"repo_id": "transformers",
"token_count": 5982
} | 431 |
# 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... | transformers/tests/utils/test_chat_template_utils.py/0 | {
"file_path": "transformers/tests/utils/test_chat_template_utils.py",
"repo_id": "transformers",
"token_count": 7722
} | 432 |
# coding=utf-8
# Copyright 2020 The Hugging Face 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... | transformers/tests/utils/test_model_output.py/0 | {
"file_path": "transformers/tests/utils/test_model_output.py",
"repo_id": "transformers",
"token_count": 3188
} | 433 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/utils/check_doc_toc.py/0 | {
"file_path": "transformers/utils/check_doc_toc.py",
"repo_id": "transformers",
"token_count": 1732
} | 434 |
import argparse
import json
import os
import time
import zipfile
from get_ci_error_statistics import download_artifact, get_artifacts_links
from transformers import logging
logger = logging.get_logger(__name__)
def extract_warnings_from_single_artifact(artifact_path, targets):
"""Extract warnings from a downl... | transformers/utils/extract_warnings.py/0 | {
"file_path": "transformers/utils/extract_warnings.py",
"repo_id": "transformers",
"token_count": 2110
} | 435 |
# coding=utf-8
# Copyright 2021 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... | transformers/utils/release.py/0 | {
"file_path": "transformers/utils/release.py",
"repo_id": "transformers",
"token_count": 2388
} | 436 |
{
"opsets": {
"1": [
"Abs",
"Add",
"AddV2",
"ArgMax",
"ArgMin",
"AvgPool",
"AvgPool3D",
"BatchMatMul",
"BatchMatMulV2",
"BatchToSpaceND",
"BiasAdd",
"BiasAddV1",
... | transformers/utils/tf_ops/onnx.json/0 | {
"file_path": "transformers/utils/tf_ops/onnx.json",
"repo_id": "transformers",
"token_count": 4081
} | 437 |
from dataclasses import dataclass
import tyro
from huggingface_hub import HfApi
@dataclass
class Args:
folder_path: str = "benchmark/trl"
path_in_repo: str = "images/benchmark"
repo_id: str = "trl-internal-testing/example-images"
repo_type: str = "dataset"
args = tyro.cli(Args)
api = HfApi()
api.u... | trl/benchmark/upload_benchmark.py/0 | {
"file_path": "trl/benchmark/upload_benchmark.py",
"repo_id": "trl",
"token_count": 200
} | 438 |
# Quickstart
## How does it work?
Fine-tuning a language model via PPO consists of roughly three steps:
1. **Rollout**: The language model generates a response or continuation based on a query which could be the start of a sentence.
2. **Evaluation**: The query and response are evaluated with a function, model, huma... | trl/docs/source/quickstart.mdx/0 | {
"file_path": "trl/docs/source/quickstart.mdx",
"repo_id": "trl",
"token_count": 1120
} | 439 |
# This is an example configuration file of TRL CLI, you can use it for
# SFT like that: `trl sft --config config.yaml --output_dir test-sft`
# The YAML file supports environment variables by adding an `env` field
# as below
# env:
# CUDA_VISIBLE_DEVICES: 0
model_name_or_path:
trl-internal-testing/tiny-random-Lla... | trl/examples/cli_configs/example_config.yaml/0 | {
"file_path": "trl/examples/cli_configs/example_config.yaml",
"repo_id": "trl",
"token_count": 169
} | 440 |
# DPO pipeline for the creation of StackLlaMa 2: a Stack exchange llama-v2-7b model
## Prerequisites
Install all the dependencies in the `requirements.txt`:
```
$ pip install -U -r requirements.txt
```
Since we will use `accelerate` for training, make sure to run:
```
$ accelerate config
```
## Training
There wer... | trl/examples/research_projects/stack_llama_2/scripts/README.md/0 | {
"file_path": "trl/examples/research_projects/stack_llama_2/scripts/README.md",
"repo_id": "trl",
"token_count": 896
} | 441 |
# flake8: noqa
# Copyright 2023 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
#
# Unless r... | trl/examples/scripts/dpo.py/0 | {
"file_path": "trl/examples/scripts/dpo.py",
"repo_id": "trl",
"token_count": 2542
} | 442 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | trl/tests/test_ppov2_trainer.py/0 | {
"file_path": "trl/tests/test_ppov2_trainer.py",
"repo_id": "trl",
"token_count": 760
} | 443 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | trl/trl/environment/base_environment.py/0 | {
"file_path": "trl/trl/environment/base_environment.py",
"repo_id": "trl",
"token_count": 7661
} | 444 |
# 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... | trl/trl/trainer/bco_config.py/0 | {
"file_path": "trl/trl/trainer/bco_config.py",
"repo_id": "trl",
"token_count": 1784
} | 445 |
# 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... | trl/trl/trainer/orpo_config.py/0 | {
"file_path": "trl/trl/trainer/orpo_config.py",
"repo_id": "trl",
"token_count": 1172
} | 446 |
// File only needed for VSCode users to have proper Docker based interpreters
{
"name": "accelerate_dev_environment",
"build": {
// ACTION NEEDED: comment/uncomment the relevant line depending on whether you are in a CPU/GPU environment
"dockerfile": "../docker/accelerate-cpu/Dockerfile"
// ... | accelerate/.devcontainer/devcontainer.json/0 | {
"file_path": "accelerate/.devcontainer/devcontainer.json",
"repo_id": "accelerate",
"token_count": 459
} | 0 |
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
... | accelerate/LICENSE/0 | {
"file_path": "accelerate/LICENSE",
"repo_id": "accelerate",
"token_count": 3168
} | 1 |
# Builds GPU docker image of PyTorch specifically
# 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
# Note: DeepSpeed beyond v0.12.6 requires py 3.10
ENV PYTHON_VERSION=3.10
# Install apt libs
RUN apt-get ... | accelerate/docker/accelerate-gpu-deepspeed/Dockerfile/0 | {
"file_path": "accelerate/docker/accelerate-gpu-deepspeed/Dockerfile",
"repo_id": "accelerate",
"token_count": 560
} | 2 |
<!--Copyright 2022 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | accelerate/docs/source/concept_guides/gradient_synchronization.md/0 | {
"file_path": "accelerate/docs/source/concept_guides/gradient_synchronization.md",
"repo_id": "accelerate",
"token_count": 2842
} | 3 |
<!--Copyright 2021 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... | accelerate/docs/source/package_reference/kwargs.md/0 | {
"file_path": "accelerate/docs/source/package_reference/kwargs.md",
"repo_id": "accelerate",
"token_count": 385
} | 4 |
<!--Copyright 2022 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | accelerate/docs/source/usage_guides/gradient_accumulation.md/0 | {
"file_path": "accelerate/docs/source/usage_guides/gradient_accumulation.md",
"repo_id": "accelerate",
"token_count": 2733
} | 5 |
# Copyright 2022 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
#
# Unless required by appl... | accelerate/examples/by_feature/cross_validation.py/0 | {
"file_path": "accelerate/examples/by_feature/cross_validation.py",
"repo_id": "accelerate",
"token_count": 4478
} | 6 |
# Similar to FSDP, we set the distributed type as DEEPSPEED
distributed_type: DEEPSPEED
# With DeepSpeed, we utilize a deepspeed config file for the entire configuration
deepspeed_config:
# Can also be any of the config json's in accelerate/examples/deepspeed_config_templates
deepspeed_config_file: ../deepspeed_con... | accelerate/examples/config_yaml_templates/deepspeed.yaml/0 | {
"file_path": "accelerate/examples/config_yaml_templates/deepspeed.yaml",
"repo_id": "accelerate",
"token_count": 239
} | 7 |
# Distributed inference examples with PiPPy
This repo contains a variety of tutorials for using the [PiPPy](https://github.com/PyTorch/PiPPy) pipeline parallelism library with accelerate. You will find examples covering:
1. How to trace the model using `accelerate.prepare_pippy`
2. How to specify inputs based on what... | accelerate/examples/inference/pippy/README.md/0 | {
"file_path": "accelerate/examples/inference/pippy/README.md",
"repo_id": "accelerate",
"token_count": 646
} | 8 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | accelerate/manim_animations/big_model_inference/stage_3.py/0 | {
"file_path": "accelerate/manim_animations/big_model_inference/stage_3.py",
"repo_id": "accelerate",
"token_count": 2891
} | 9 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | accelerate/src/accelerate/checkpointing.py/0 | {
"file_path": "accelerate/src/accelerate/checkpointing.py",
"repo_id": "accelerate",
"token_count": 5333
} | 10 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | accelerate/src/accelerate/scheduler.py/0 | {
"file_path": "accelerate/src/accelerate/scheduler.py",
"repo_id": "accelerate",
"token_count": 1577
} | 11 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | accelerate/src/accelerate/test_utils/scripts/test_notebook.py/0 | {
"file_path": "accelerate/src/accelerate/test_utils/scripts/test_notebook.py",
"repo_id": "accelerate",
"token_count": 1371
} | 12 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | accelerate/src/accelerate/utils/megatron_lm.py/0 | {
"file_path": "accelerate/src/accelerate/utils/megatron_lm.py",
"repo_id": "accelerate",
"token_count": 26898
} | 13 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | accelerate/tests/test_accelerator.py/0 | {
"file_path": "accelerate/tests/test_accelerator.py",
"repo_id": "accelerate",
"token_count": 13399
} | 14 |
# 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... | accelerate/tests/test_imports.py/0 | {
"file_path": "accelerate/tests/test_imports.py",
"repo_id": "accelerate",
"token_count": 1442
} | 15 |
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
| alignment-handbook/recipes/accelerate_configs/multi_gpu.yaml/0 | {
"file_path": "alignment-handbook/recipes/accelerate_configs/multi_gpu.yaml",
"repo_id": "alignment-handbook",
"token_count": 129
} | 16 |
# Instructions to train StarChat2
Similar to how we trained Zephyr 7B Beta in our [technical report](https://huggingface.co/papers/2310.16944), training this model proceeds in two steps:
1. Apply SFT to fine-tune [StarCoder2 15B](https://huggingface.co/bigcode/starcoder2-15b) on a blend of chat, code, and math datas... | alignment-handbook/recipes/starchat2-15b/README.md/0 | {
"file_path": "alignment-handbook/recipes/starchat2-15b/README.md",
"repo_id": "alignment-handbook",
"token_count": 495
} | 17 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2023 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... | alignment-handbook/scripts/run_orpo.py/0 | {
"file_path": "alignment-handbook/scripts/run_orpo.py",
"repo_id": "alignment-handbook",
"token_count": 3945
} | 18 |
# coding=utf-8
# 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 requir... | alignment-handbook/tests/test_model_utils.py/0 | {
"file_path": "alignment-handbook/tests/test_model_utils.py",
"repo_id": "alignment-handbook",
"token_count": 1490
} | 19 |
[book]
authors = ["Nicolas Patry"]
language = "en"
multilingual = false
src = "src"
title = "Candle Documentation"
| candle/candle-book/book.toml/0 | {
"file_path": "candle/candle-book/book.toml",
"repo_id": "candle",
"token_count": 38
} | 20 |
# Advanced Cuda usage
| candle/candle-book/src/inference/cuda/README.md/0 | {
"file_path": "candle/candle-book/src/inference/cuda/README.md",
"repo_id": "candle",
"token_count": 6
} | 21 |
use crate::benchmarks::{BenchDevice, BenchDeviceHandler};
use candle_core::{DType, Device, Tensor};
use criterion::{black_box, criterion_group, Criterion, Throughput};
use std::time::Instant;
fn run(a: &Tensor) {
a.affine(12.34, 56.78).unwrap();
}
fn run_affine_benchmark(c: &mut Criterion, device: &Device, dtype:... | candle/candle-core/benches/benchmarks/affine.rs/0 | {
"file_path": "candle/candle-core/benches/benchmarks/affine.rs",
"repo_id": "candle",
"token_count": 590
} | 22 |
//! Implement conversion traits for tensors
use crate::{DType, Device, Error, Tensor, WithDType};
use half::{bf16, f16, slice::HalfFloatSliceExt};
use std::convert::TryFrom;
impl<T: WithDType> TryFrom<&Tensor> for Vec<T> {
type Error = Error;
fn try_from(tensor: &Tensor) -> Result<Self, Self::Error> {
... | candle/candle-core/src/convert.rs/0 | {
"file_path": "candle/candle-core/src/convert.rs",
"repo_id": "candle",
"token_count": 2242
} | 23 |
/// Pretty printing of tensors
/// This implementation should be in line with the PyTorch version.
/// https://github.com/pytorch/pytorch/blob/7b419e8513a024e172eae767e24ec1b849976b13/torch/_tensor_str.py
use crate::{DType, Result, Tensor, WithDType};
use half::{bf16, f16};
impl Tensor {
fn fmt_dt<T: WithDType + s... | candle/candle-core/src/display.rs/0 | {
"file_path": "candle/candle-core/src/display.rs",
"repo_id": "candle",
"token_count": 9753
} | 24 |
#![allow(unused)]
use super::GgmlDType;
use crate::{CudaDevice, CudaStorage, Error, Result};
pub struct QCudaStorage {
dtype: GgmlDType,
device: CudaDevice,
}
impl QCudaStorage {
pub fn zeros(_: &CudaDevice, _: usize, _: GgmlDType) -> Result<Self> {
Err(Error::NotCompiledWithCudaSupport)
}
... | candle/candle-core/src/quantized/dummy_cuda.rs/0 | {
"file_path": "candle/candle-core/src/quantized/dummy_cuda.rs",
"repo_id": "candle",
"token_count": 594
} | 25 |
use crate::Layout;
/// An iterator over offset position for items of an N-dimensional arrays stored in a
/// flat buffer using some potential strides.
#[derive(Debug)]
pub struct StridedIndex<'a> {
next_storage_index: Option<usize>,
multi_index: Vec<usize>,
dims: &'a [usize],
stride: &'a [usize],
}
im... | candle/candle-core/src/strided_index.rs/0 | {
"file_path": "candle/candle-core/src/strided_index.rs",
"repo_id": "candle",
"token_count": 1148
} | 26 |
import torch
from collections import OrderedDict
# Write a trivial tensor to a pt file
a= torch.tensor([[1,2,3,4], [5,6,7,8]])
o = OrderedDict()
o["test"] = a
# Write a trivial tensor to a pt file
torch.save(o, "test.pt")
###############################################################################################... | candle/candle-core/tests/pth.py/0 | {
"file_path": "candle/candle-core/tests/pth.py",
"repo_id": "candle",
"token_count": 441
} | 27 |
//! The CIFAR-10 dataset.
//!
//! The files can be downloaded from the following page:
//! <https://www.cs.toronto.edu/~kriz/cifar.html>
//! The binary version of the dataset is used.
use crate::vision::Dataset;
use candle::{DType, Device, Error, Result, Tensor};
use hf_hub::{api::sync::Api, Repo, RepoType};
use parque... | candle/candle-datasets/src/vision/cifar.rs/0 | {
"file_path": "candle/candle-datasets/src/vision/cifar.rs",
"repo_id": "candle",
"token_count": 2139
} | 28 |
//! DINOv2: Learning Robust Visual Features without Supervision
//! https://github.com/facebookresearch/dinov2
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use clap::Parser;
use candle::{DType, IndexOp, D};
use candle_nn::{Module, VarBuilder};
use c... | candle/candle-examples/examples/dinov2/main.rs/0 | {
"file_path": "candle/candle-examples/examples/dinov2/main.rs",
"repo_id": "candle",
"token_count": 791
} | 29 |
# candle-fastvit
[FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization](https://arxiv.org/abs/2303.14189).
This candle implementation uses a pre-trained FastViT network for inference. The
classification head has been trained on the ImageNet dataset and returns the
probabilities for the top-5 c... | candle/candle-examples/examples/fastvit/README.md/0 | {
"file_path": "candle/candle-examples/examples/fastvit/README.md",
"repo_id": "candle",
"token_count": 258
} | 30 |
// An implementation of LLaMA https://github.com/facebookresearch/llama
//
// This is based on nanoGPT in a similar way to:
// https://github.com/Lightning-AI/lit-llama/blob/main/lit_llama/model.py
//
// The tokenizer config can be retrieved from:
// https://huggingface.co/hf-internal-testing/llama-tokenizer/raw/main/t... | candle/candle-examples/examples/llama/main.rs/0 | {
"file_path": "candle/candle-examples/examples/llama/main.rs",
"repo_id": "candle",
"token_count": 3929
} | 31 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use anyhow::{Error as E, Result};
use clap::Parser;
use candle::{DType, Device, Tensor};
use candle_nn::VarBuilder;
use candle_transformers::{
generation::LogitsProcessor,
models::{moondream, quant... | candle/candle-examples/examples/moondream/main.rs/0 | {
"file_path": "candle/candle-examples/examples/moondream/main.rs",
"repo_id": "candle",
"token_count": 5484
} | 32 |
# candle-quantized-t5
## Seq2Seq example
This example uses a quantized version of the t5 model.
```bash
$ cargo run --example quantized-t5 --release -- --prompt "translate to German: A beautiful candle."
...
Eine schöne Kerze.
```
## Generating Quantized weight files
The weight file is automatically retrieved fro... | candle/candle-examples/examples/quantized-t5/README.md/0 | {
"file_path": "candle/candle-examples/examples/quantized-t5/README.md",
"repo_id": "candle",
"token_count": 683
} | 33 |
#![allow(unused)]
//! Vectorized version of the gym environment.
use candle::{DType, Device, Result, Tensor};
use pyo3::prelude::*;
use pyo3::types::PyDict;
#[derive(Debug)]
pub struct Step {
pub obs: Tensor,
pub reward: Tensor,
pub is_done: Tensor,
}
pub struct VecGymEnv {
env: PyObject,
action_s... | candle/candle-examples/examples/reinforcement-learning/vec_gym_env.rs/0 | {
"file_path": "candle/candle-examples/examples/reinforcement-learning/vec_gym_env.rs",
"repo_id": "candle",
"token_count": 1569
} | 34 |
# candle-trocr
`TrOCR` is a transformer OCR Model. In this example it is used to
transcribe image text. See the associated [model
card](https://huggingface.co/microsoft/trocr-base-printed) for details on
the model itself.
Supported models include:
- `--which base`: small handwritten OCR model.
- `--which large`: lar... | candle/candle-examples/examples/trocr/readme.md/0 | {
"file_path": "candle/candle-examples/examples/trocr/readme.md",
"repo_id": "candle",
"token_count": 360
} | 35 |
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
use candle_transformers::models::stable_diffusion;
use candle_transformers::models::wuerstchen;
use anyhow::{Error as E, Result};
use candle::{DType, Device, IndexOp, Tensor};
use clap::Parser;
use tokeniz... | candle/candle-examples/examples/wuerstchen/main.rs/0 | {
"file_path": "candle/candle-examples/examples/wuerstchen/main.rs",
"repo_id": "candle",
"token_count": 6372
} | 36 |
pub const NAMES: [&str; 80] = [
"person",
"bicycle",
"car",
"motorbike",
"aeroplane",
"bus",
"train",
"truck",
"boat",
"traffic light",
"fire hydrant",
"stop sign",
"parking meter",
"bench",
"bird",
"cat",
"dog",
"horse",
"sheep",
"cow",
... | candle/candle-examples/src/coco_classes.rs/0 | {
"file_path": "candle/candle-examples/src/coco_classes.rs",
"repo_id": "candle",
"token_count": 648
} | 37 |
// Copyright (c) 2023, Tri Dao.
// Splitting the different head dimensions to different files to speed up compilation.
// This file is auto-generated. See "generate_kernels.py"
#include "flash_fwd_launch_template.h"
template<>
void run_mha_fwd_<cutlass::half_t, 128, true>(Flash_fwd_params ¶ms, cudaStream_t stream... | candle/candle-flash-attn/kernels/flash_fwd_hdim128_fp16_causal_sm80.cu/0 | {
"file_path": "candle/candle-flash-attn/kernels/flash_fwd_hdim128_fp16_causal_sm80.cu",
"repo_id": "candle",
"token_count": 139
} | 38 |
// This header is not specific to our application and you'll probably want
// something like this for any extension you're building. This includes the
// infrastructure needed to serialize descriptors that are used with the
// "opaque" parameter of the GPU custom call. In our example we'll use this
// parameter to pass... | candle/candle-flash-attn/kernels/kernel_helpers.h/0 | {
"file_path": "candle/candle-flash-attn/kernels/kernel_helpers.h",
"repo_id": "candle",
"token_count": 600
} | 39 |
#include "cuda_utils.cuh"
#include<stdint.h>
#define AFFINE_OP(TYPENAME, FN_NAME) \
extern "C" __global__ void FN_NAME( \
const size_t numel, \
const size_t num_dims, \
const size_t *info, \
const TYPENAME *inp, \
TYPENAME *out, \
const TYPENAME mul, \
const TYPENAME add \
) { \
cons... | candle/candle-kernels/src/affine.cu/0 | {
"file_path": "candle/candle-kernels/src/affine.cu",
"repo_id": "candle",
"token_count": 659
} | 40 |
# candle-metal-kernels
This crate contains Metal kernels used from candle. | candle/candle-metal-kernels/README.md/0 | {
"file_path": "candle/candle-metal-kernels/README.md",
"repo_id": "candle",
"token_count": 18
} | 41 |
use candle_metal_kernels::{call_affine, Kernels};
use metal::objc::rc::autoreleasepool;
use metal::{Device, MTLResourceOptions};
use rand;
use std::any::type_name;
use std::time::Instant;
fn main() {
let device = Device::system_default().unwrap();
let kernels = Kernels::new();
let f32_1k = (0..1000).map(|... | candle/candle-metal-kernels/tmp/affine.rs/0 | {
"file_path": "candle/candle-metal-kernels/tmp/affine.rs",
"repo_id": "candle",
"token_count": 1154
} | 42 |
//! Encoding Utilities. (e.g., one-hot/cold encoding)
use candle::{bail, DType, Result, Tensor, WithDType};
/// One-hot/cold encoding.
///
/// Given an input tensor of indices, this function returns a tensor of the same shape as the input
/// tensor with an additional dimension of the given depth size. The values in ... | candle/candle-nn/src/encoding.rs/0 | {
"file_path": "candle/candle-nn/src/encoding.rs",
"repo_id": "candle",
"token_count": 2025
} | 43 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use anyhow::Result;
use candle::{test_utils, DType, Device, Tensor};
use candle_nn::{batch_norm, BatchNorm, BatchNormConfig, VarBuilder, VarMap};
/* The test below has been generated using the following Py... | candle/candle-nn/tests/batch_norm.rs/0 | {
"file_path": "candle/candle-nn/tests/batch_norm.rs",
"repo_id": "candle",
"token_count": 3126
} | 44 |
[package]
name = "candle-pyo3"
version.workspace = true
edition.workspace = true
description.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
license.workspace = true
readme = "README.md"
[lib]
name = "candle"
crate-type = ["cdylib"]
[dependencies]
accelerate-src = { ... | candle/candle-pyo3/Cargo.toml/0 | {
"file_path": "candle/candle-pyo3/Cargo.toml",
"repo_id": "candle",
"token_count": 315
} | 45 |
from candle import Tensor, QTensor, DType
from typing import (
Dict,
Tuple,
Any,
Optional,
Union,
Iterator,
Set,
overload,
Mapping,
TypeVar,
List,
)
from collections import OrderedDict, namedtuple
TensorLike = Union[Tensor, QTensor]
T = TypeVar("T", bound="Module")
class _... | candle/candle-pyo3/py_src/candle/nn/module.py/0 | {
"file_path": "candle/candle-pyo3/py_src/candle/nn/module.py",
"repo_id": "candle",
"token_count": 12028
} | 46 |
import candle
print(f"mkl: {candle.utils.has_mkl()}")
print(f"accelerate: {candle.utils.has_accelerate()}")
print(f"num-threads: {candle.utils.get_num_threads()}")
print(f"cuda: {candle.utils.cuda_is_available()}")
t = candle.Tensor(42.0)
print(t)
print(t.shape, t.rank, t.device)
print(t + t)
t = can... | candle/candle-pyo3/test.py/0 | {
"file_path": "candle/candle-pyo3/test.py",
"repo_id": "candle",
"token_count": 340
} | 47 |
use candle::{DType, Device, IndexOp, Result, Tensor, D};
use candle_nn::{embedding, linear_b as linear, Embedding, LayerNorm, Linear, Module, VarBuilder};
fn layer_norm(size: usize, eps: f64, vb: VarBuilder) -> Result<LayerNorm> {
let weight = vb.get(size, "weight")?;
let bias = vb.get(size, "bias")?;
Ok(L... | candle/candle-transformers/src/models/bigcode.rs/0 | {
"file_path": "candle/candle-transformers/src/models/bigcode.rs",
"repo_id": "candle",
"token_count": 6280
} | 48 |
//! EfficientViT (MSRA) inference implementation based on timm.
//!
//! See "EfficientViT: Memory Efficient Vision Transformer with Cascaded Group Attention"
//! https://arxiv.org/abs/2305.07027
//! https://github.com/huggingface/pytorch-image-models/blob/main/timm/models/efficientvit_msra.py
use candle::{Result, Tenso... | candle/candle-transformers/src/models/efficientvit.rs/0 | {
"file_path": "candle/candle-transformers/src/models/efficientvit.rs",
"repo_id": "candle",
"token_count": 6985
} | 49 |
use byteorder::{LittleEndian, ReadBytesExt};
use candle::{DType, Device, IndexOp, Result, Shape, Tensor};
use candle_nn::VarBuilder;
use super::llama2_c::Config;
pub struct TransformerWeights {
// token embedding table
token_embedding_table: Tensor, // (vocab_size, dim)
// weights for rmsnorms
rms_att... | candle/candle-transformers/src/models/llama2_c_weights.rs/0 | {
"file_path": "candle/candle-transformers/src/models/llama2_c_weights.rs",
"repo_id": "candle",
"token_count": 3322
} | 50 |
//! MobileNet-v4 inference implementation based on timm.
//!
//! See "MobileNetV4 - Universal Models for the Mobile Ecosystem"
//! https://arxiv.org/abs/2404.10518
//!
//! https://github.com/huggingface/pytorch-image-models/blob/main/timm/models/mobilenetv3.py
use candle::{Result, Tensor, D};
use candle_nn::{
batc... | candle/candle-transformers/src/models/mobilenetv4.rs/0 | {
"file_path": "candle/candle-transformers/src/models/mobilenetv4.rs",
"repo_id": "candle",
"token_count": 16874
} | 51 |
use crate::quantized_nn::{linear_b, Embedding, Linear, RmsNorm};
pub use crate::quantized_var_builder::VarBuilder;
use crate::models::metavoice::repeat_interleave;
use candle::{Module, Result, Tensor, D};
pub mod transformer {
use super::*;
type Config = crate::models::metavoice::transformer::Config;
#[... | candle/candle-transformers/src/models/quantized_metavoice.rs/0 | {
"file_path": "candle/candle-transformers/src/models/quantized_metavoice.rs",
"repo_id": "candle",
"token_count": 5050
} | 52 |
//! RepVGG inference implementation
//!
//! See "RepVGG: Making VGG-style ConvNets Great Again" Ding et al. 2021
//! https://arxiv.org/abs/2101.03697
use candle::{Result, Tensor, D};
use candle_nn::{
batch_norm, conv2d_no_bias, linear, BatchNorm, Conv2d, Conv2dConfig, Func, VarBuilder,
};
const CHANNELS_PER_STAGE... | candle/candle-transformers/src/models/repvgg.rs/0 | {
"file_path": "candle/candle-transformers/src/models/repvgg.rs",
"repo_id": "candle",
"token_count": 4371
} | 53 |
use candle::{Result, Tensor, D};
use candle_nn as nn;
use candle_nn::Module;
#[derive(Debug)]
pub struct TimestepEmbedding {
linear_1: nn::Linear,
linear_2: nn::Linear,
}
impl TimestepEmbedding {
// act_fn: "silu"
pub fn new(vs: nn::VarBuilder, channel: usize, time_embed_dim: usize) -> Result<Self> {
... | candle/candle-transformers/src/models/stable_diffusion/embeddings.rs/0 | {
"file_path": "candle/candle-transformers/src/models/stable_diffusion/embeddings.rs",
"repo_id": "candle",
"token_count": 1008
} | 54 |
pub mod audio;
pub mod model;
pub mod quantized_model;
use serde::Deserialize;
// The names in comments correspond to the original implementation:
// https://github.com/openai/whisper/blob/f572f2161ba831bae131364c3bffdead7af6d210/whisper/model.py#L17
#[derive(Debug, Clone, PartialEq, Deserialize)]
pub struct Config {... | candle/candle-transformers/src/models/whisper/mod.rs/0 | {
"file_path": "candle/candle-transformers/src/models/whisper/mod.rs",
"repo_id": "candle",
"token_count": 812
} | 55 |
use candle::quantized::QTensor;
use candle::{Device, Result, Shape};
use std::sync::Arc;
// VarBuilder specialized for QTensors
#[derive(Clone)]
pub struct VarBuilder {
data: Arc<std::collections::HashMap<String, Arc<QTensor>>>,
path: Vec<String>,
device: Device,
}
impl VarBuilder {
pub fn from_gguf<P... | candle/candle-transformers/src/quantized_var_builder.rs/0 | {
"file_path": "candle/candle-transformers/src/quantized_var_builder.rs",
"repo_id": "candle",
"token_count": 1559
} | 56 |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
@import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@200;300;400&family=Source+Sans+3:wght@100;200;300;400;500;600;700;800;900&display=swap");... | candle/candle-wasm-examples/blip/index.html/0 | {
"file_path": "candle/candle-wasm-examples/blip/index.html",
"repo_id": "candle",
"token_count": 7164
} | 57 |
use crate::model::{Cache, Config, Llama};
use byteorder::{LittleEndian, ReadBytesExt};
use candle::{DType, Device, IndexOp, Result, Shape, Tensor};
use candle_nn::VarBuilder;
use candle_transformers::generation::LogitsProcessor;
use serde::{Deserialize, Serialize};
use tokenizers::Tokenizer;
use wasm_bindgen::prelude::... | candle/candle-wasm-examples/llama2-c/src/worker.rs/0 | {
"file_path": "candle/candle-wasm-examples/llama2-c/src/worker.rs",
"repo_id": "candle",
"token_count": 5770
} | 58 |
[package]
name = "candle-wasm-example-sam"
version.workspace = true
edition.workspace = true
description.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
license.workspace = true
[dependencies]
candle = { workspace = true }
candle-nn = { workspace = true }
candle-trans... | candle/candle-wasm-examples/segment-anything/Cargo.toml/0 | {
"file_path": "candle/candle-wasm-examples/segment-anything/Cargo.toml",
"repo_id": "candle",
"token_count": 264
} | 59 |
export async function extractEmbeddings(
worker,
weightsURL,
tokenizerURL,
configURL,
modelID,
sentences,
updateStatus,
normalize_embeddings = true
) {
return new Promise((resolve, reject) => {
worker.postMessage({
weightsURL,
tokenizerURL,
configURL,
modelID,
sentenc... | candle/candle-wasm-examples/t5/utils.js/0 | {
"file_path": "candle/candle-wasm-examples/t5/utils.js",
"repo_id": "candle",
"token_count": 2339
} | 60 |
[package]
name = "candle-wasm-example-yolo"
version.workspace = true
edition.workspace = true
description.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
license.workspace = true
[dependencies]
candle = { workspace = true }
candle-nn = { workspace = true }
num-traits ... | candle/candle-wasm-examples/yolo/Cargo.toml/0 | {
"file_path": "candle/candle-wasm-examples/yolo/Cargo.toml",
"repo_id": "candle",
"token_count": 463
} | 61 |
pub fn add(left: usize, right: usize) -> usize {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
| candle/candle-wasm-tests/src/lib.rs/0 | {
"file_path": "candle/candle-wasm-tests/src/lib.rs",
"repo_id": "candle",
"token_count": 108
} | 62 |
apiVersion: v1
kind: ConfigMap
metadata:
labels: {{ include "labels.standard" . | nindent 4 }}
name: {{ include "name" . }}
namespace: {{ .Release.Namespace }}
data:
{{- range $key, $value := $.Values.envVars }}
{{ $key }}: {{ $value | quote }}
{{- end }}
| chat-ui/chart/templates/config.yaml/0 | {
"file_path": "chat-ui/chart/templates/config.yaml",
"repo_id": "chat-ui",
"token_count": 96
} | 63 |
# Amazon Web Services (AWS)
| Feature | Available |
| --------------------------- | --------- |
| [Tools](../tools) | No |
| [Multimodal](../multimodal) | No |
You may specify your Amazon SageMaker instance as an endpoint for Chat UI:
```ini
MODELS=`[{
"name": "your-mode... | chat-ui/docs/source/configuration/models/providers/aws.md/0 | {
"file_path": "chat-ui/docs/source/configuration/models/providers/aws.md",
"repo_id": "chat-ui",
"token_count": 348
} | 64 |
# 🤗 Chat UI
Open source chat interface with support for tools, web search, multimodal and many API providers. The app uses MongoDB and SvelteKit behind the scenes. Try the live version of the app called [HuggingChat on hf.co/chat](https://huggingface.co/chat) or [setup your own instance](./installation/spaces).
🔧 *... | chat-ui/docs/source/index.md/0 | {
"file_path": "chat-ui/docs/source/index.md",
"repo_id": "chat-ui",
"token_count": 1435
} | 65 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.