text stringlengths 5 631k | id stringlengths 14 178 | metadata dict | __index_level_0__ int64 0 647 |
|---|---|---|---|
# coding=utf-8
# Copyright 2019-present, Facebook, Inc and 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
#
# Un... | transformers/src/transformers/models/xlm/modeling_xlm.py/0 | {
"file_path": "transformers/src/transformers/models/xlm/modeling_xlm.py",
"repo_id": "transformers",
"token_count": 32472
} | 565 |
# coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | transformers/src/transformers/models/xlnet/modeling_tf_xlnet.py/0 | {
"file_path": "transformers/src/transformers/models/xlnet/modeling_tf_xlnet.py",
"repo_id": "transformers",
"token_count": 34875
} | 566 |
# 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... | transformers/src/transformers/models/zoedepth/convert_zoedepth_to_hf.py/0 | {
"file_path": "transformers/src/transformers/models/zoedepth/convert_zoedepth_to_hf.py",
"repo_id": "transformers",
"token_count": 7653
} | 567 |
# coding=utf-8
# Copyright 2018 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/src/transformers/pipelines/base.py/0 | {
"file_path": "transformers/src/transformers/pipelines/base.py",
"repo_id": "transformers",
"token_count": 28768
} | 568 |
import enum
import warnings
from typing import Any, Union
from ..generation import GenerationConfig
from ..tokenization_utils import TruncationStrategy
from ..utils import add_end_docstrings, is_tf_available, is_torch_available, logging
from .base import Pipeline, build_pipeline_init_args
if is_tf_available():
i... | transformers/src/transformers/pipelines/text2text_generation.py/0 | {
"file_path": "transformers/src/transformers/pipelines/text2text_generation.py",
"repo_id": "transformers",
"token_count": 7499
} | 569 |
# 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 required by appl... | transformers/src/transformers/quantizers/base.py/0 | {
"file_path": "transformers/src/transformers/quantizers/base.py",
"repo_id": "transformers",
"token_count": 6401
} | 570 |
# 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 required by appl... | transformers/src/transformers/quantizers/quantizer_quanto.py/0 | {
"file_path": "transformers/src/transformers/quantizers/quantizer_quanto.py",
"repo_id": "transformers",
"token_count": 3187
} | 571 |
# Copyright 2020 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 agreed ... | transformers/src/transformers/tokenization_utils_fast.py/0 | {
"file_path": "transformers/src/transformers/tokenization_utils_fast.py",
"repo_id": "transformers",
"token_count": 18367
} | 572 |
# 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/src/transformers/utils/deprecation.py/0 | {
"file_path": "transformers/src/transformers/utils/deprecation.py",
"repo_id": "transformers",
"token_count": 3013
} | 573 |
# This file is autogenerated by the command `make fix-copies`, do not edit.
from ..utils import DummyObject, requires_backends
class BaseImageProcessorFast(metaclass=DummyObject):
_backends = ["torchvision"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torchvision"])
class BaseVid... | transformers/src/transformers/utils/dummy_torchvision_objects.py/0 | {
"file_path": "transformers/src/transformers/utils/dummy_torchvision_objects.py",
"repo_id": "transformers",
"token_count": 173
} | 574 |
# coding=utf-8
# Copyright 2025 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/video_processing_utils.py/0 | {
"file_path": "transformers/src/transformers/video_processing_utils.py",
"repo_id": "transformers",
"token_count": 17113
} | 575 |
# Copyright 2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/tests/commands/test_chat.py/0 | {
"file_path": "transformers/tests/commands/test_chat.py",
"repo_id": "transformers",
"token_count": 1615
} | 576 |
# Copyright 2020 The HuggingFace Team Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a clone of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | transformers/tests/generation/test_utils.py/0 | {
"file_path": "transformers/tests/generation/test_utils.py",
"repo_id": "transformers",
"token_count": 118895
} | 577 |
# 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 agreed to in writ... | transformers/tests/models/aria/test_image_processing_aria.py/0 | {
"file_path": "transformers/tests/models/aria/test_image_processing_aria.py",
"repo_id": "transformers",
"token_count": 6234
} | 578 |
# Copyright 2021 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 agreed to in writ... | transformers/tests/models/beit/test_image_processing_beit.py/0 | {
"file_path": "transformers/tests/models/beit/test_image_processing_beit.py",
"repo_id": "transformers",
"token_count": 6176
} | 579 |
# 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 agreed to in writ... | transformers/tests/models/blip/test_image_processing_blip.py/0 | {
"file_path": "transformers/tests/models/blip/test_image_processing_blip.py",
"repo_id": "transformers",
"token_count": 2098
} | 580 |
# 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 required by appl... | transformers/tests/models/colpali/test_modeling_colpali.py/0 | {
"file_path": "transformers/tests/models/colpali/test_modeling_colpali.py",
"repo_id": "transformers",
"token_count": 5848
} | 581 |
# Copyright 2018 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 agreed to in ... | transformers/tests/models/cpm/test_tokenization_cpm.py/0 | {
"file_path": "transformers/tests/models/cpm/test_tokenization_cpm.py",
"repo_id": "transformers",
"token_count": 782
} | 582 |
# 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... | transformers/tests/models/decision_transformer/test_modeling_decision_transformer.py/0 | {
"file_path": "transformers/tests/models/decision_transformer/test_modeling_decision_transformer.py",
"repo_id": "transformers",
"token_count": 4114
} | 583 |
# 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 required by appl... | transformers/tests/models/dpt/test_modeling_dpt_auto_backbone.py/0 | {
"file_path": "transformers/tests/models/dpt/test_modeling_dpt_auto_backbone.py",
"repo_id": "transformers",
"token_count": 6064
} | 584 |
# 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 required by appl... | transformers/tests/models/encodec/test_modeling_encodec.py/0 | {
"file_path": "transformers/tests/models/encodec/test_modeling_encodec.py",
"repo_id": "transformers",
"token_count": 45000
} | 585 |
# 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/flaubert/test_tokenization_flaubert.py/0 | {
"file_path": "transformers/tests/models/flaubert/test_tokenization_flaubert.py",
"repo_id": "transformers",
"token_count": 1361
} | 586 |
# coding=utf-8
# Copyright 2025 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/glm4v/test_video_processing_glm4v.py/0 | {
"file_path": "transformers/tests/models/glm4v/test_video_processing_glm4v.py",
"repo_id": "transformers",
"token_count": 6745
} | 587 |
# Copyright 2021 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... | transformers/tests/models/gpt_neo/test_modeling_gpt_neo.py/0 | {
"file_path": "transformers/tests/models/gpt_neo/test_modeling_gpt_neo.py",
"repo_id": "transformers",
"token_count": 10940
} | 588 |
# Copyright 2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/tests/models/granite_speech/test_processing_granite_speech.py/0 | {
"file_path": "transformers/tests/models/granite_speech/test_processing_granite_speech.py",
"repo_id": "transformers",
"token_count": 3355
} | 589 |
# Copyright 2018 The Google AI Language Team Authors, Allegro.pl and 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-... | transformers/tests/models/herbert/test_tokenization_herbert.py/0 | {
"file_path": "transformers/tests/models/herbert/test_tokenization_herbert.py",
"repo_id": "transformers",
"token_count": 2228
} | 590 |
# 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... | transformers/tests/models/idefics/test_processing_idefics.py/0 | {
"file_path": "transformers/tests/models/idefics/test_processing_idefics.py",
"repo_id": "transformers",
"token_count": 3430
} | 591 |
# 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/janus/test_processing_janus.py/0 | {
"file_path": "transformers/tests/models/janus/test_processing_janus.py",
"repo_id": "transformers",
"token_count": 9117
} | 592 |
# 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/llava_onevision/test_processing_llava_onevision.py/0 | {
"file_path": "transformers/tests/models/llava_onevision/test_processing_llava_onevision.py",
"repo_id": "transformers",
"token_count": 2368
} | 593 |
# 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 agreed to in writ... | transformers/tests/models/maskformer/test_image_processing_maskformer.py/0 | {
"file_path": "transformers/tests/models/maskformer/test_image_processing_maskformer.py",
"repo_id": "transformers",
"token_count": 12610
} | 594 |
# 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 required by appl... | transformers/tests/models/mgp_str/test_processing_mgp_str.py/0 | {
"file_path": "transformers/tests/models/mgp_str/test_processing_mgp_str.py",
"repo_id": "transformers",
"token_count": 3122
} | 595 |
# 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 agreed to in writ... | transformers/tests/models/mllama/test_image_processing_mllama.py/0 | {
"file_path": "transformers/tests/models/mllama/test_image_processing_mllama.py",
"repo_id": "transformers",
"token_count": 7357
} | 596 |
# Copyright 2020 The HuggingFace Inc. team, Microsoft Corporation.
#
# 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 ap... | transformers/tests/models/mpnet/test_tokenization_mpnet.py/0 | {
"file_path": "transformers/tests/models/mpnet/test_tokenization_mpnet.py",
"repo_id": "transformers",
"token_count": 1223
} | 597 |
# 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... | transformers/tests/models/mvp/test_tokenization_mvp.py/0 | {
"file_path": "transformers/tests/models/mvp/test_tokenization_mvp.py",
"repo_id": "transformers",
"token_count": 3876
} | 598 |
# Copyright 2025 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | transformers/tests/models/paligemma2/test_modeling_paligemma2.py/0 | {
"file_path": "transformers/tests/models/paligemma2/test_modeling_paligemma2.py",
"repo_id": "transformers",
"token_count": 5231
} | 599 |
# Copyright 2025 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | transformers/tests/models/perception_lm/test_modeling_perception_lm.py/0 | {
"file_path": "transformers/tests/models/perception_lm/test_modeling_perception_lm.py",
"repo_id": "transformers",
"token_count": 8339
} | 600 |
# Copyright 2018 Salesforce and 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 o... | transformers/tests/models/phobert/test_tokenization_phobert.py/0 | {
"file_path": "transformers/tests/models/phobert/test_tokenization_phobert.py",
"repo_id": "transformers",
"token_count": 1286
} | 601 |
# Copyright 2023 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 agreed to in writ... | transformers/tests/models/pop2piano/test_feature_extraction_pop2piano.py/0 | {
"file_path": "transformers/tests/models/pop2piano/test_feature_extraction_pop2piano.py",
"repo_id": "transformers",
"token_count": 4560
} | 602 |
# 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/qwen2_vl/test_processing_qwen2_vl.py/0 | {
"file_path": "transformers/tests/models/qwen2_vl/test_processing_qwen2_vl.py",
"repo_id": "transformers",
"token_count": 6626
} | 603 |
# 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... | transformers/tests/models/regnet/test_modeling_regnet.py/0 | {
"file_path": "transformers/tests/models/regnet/test_modeling_regnet.py",
"repo_id": "transformers",
"token_count": 4153
} | 604 |
# 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/roformer/test_tokenization_roformer.py/0 | {
"file_path": "transformers/tests/models/roformer/test_tokenization_roformer.py",
"repo_id": "transformers",
"token_count": 1644
} | 605 |
# Copyright 2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/tests/models/sam2/test_processor_sam2.py/0 | {
"file_path": "transformers/tests/models/sam2/test_processor_sam2.py",
"repo_id": "transformers",
"token_count": 2263
} | 606 |
# 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 law or agreed ... | transformers/tests/models/siglip/test_tokenization_siglip.py/0 | {
"file_path": "transformers/tests/models/siglip/test_tokenization_siglip.py",
"repo_id": "transformers",
"token_count": 9596
} | 607 |
# 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/speech_to_text/test_processing_speech_to_text.py/0 | {
"file_path": "transformers/tests/models/speech_to_text/test_processing_speech_to_text.py",
"repo_id": "transformers",
"token_count": 2379
} | 608 |
# Copyright 2024 BigCode and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | transformers/tests/models/starcoder2/test_modeling_starcoder2.py/0 | {
"file_path": "transformers/tests/models/starcoder2/test_modeling_starcoder2.py",
"repo_id": "transformers",
"token_count": 3170
} | 609 |
# 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... | transformers/tests/models/time_series_transformer/test_modeling_time_series_transformer.py/0 | {
"file_path": "transformers/tests/models/time_series_transformer/test_modeling_time_series_transformer.py",
"repo_id": "transformers",
"token_count": 10533
} | 610 |
# 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 required by appl... | transformers/tests/models/video_llava/test_modeling_video_llava.py/0 | {
"file_path": "transformers/tests/models/video_llava/test_modeling_video_llava.py",
"repo_id": "transformers",
"token_count": 10056
} | 611 |
# Copyright 2021 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... | transformers/tests/models/visual_bert/test_modeling_visual_bert.py/0 | {
"file_path": "transformers/tests/models/visual_bert/test_modeling_visual_bert.py",
"repo_id": "transformers",
"token_count": 14027
} | 612 |
# 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/pipelines/test_pipelines_image_segmentation.py/0 | {
"file_path": "transformers/tests/pipelines/test_pipelines_image_segmentation.py",
"repo_id": "transformers",
"token_count": 15990
} | 613 |
# 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... | transformers/tests/pipelines/test_pipelines_visual_question_answering.py/0 | {
"file_path": "transformers/tests/pipelines/test_pipelines_visual_question_answering.py",
"repo_id": "transformers",
"token_count": 4193
} | 614 |
# Copyright 2022 The HuggingFace Team Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a clone of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | transformers/tests/quantization/bnb/test_mixed_int8.py/0 | {
"file_path": "transformers/tests/quantization/bnb/test_mixed_int8.py",
"repo_id": "transformers",
"token_count": 18260
} | 615 |
# 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/repo_utils/test_check_copies.py/0 | {
"file_path": "transformers/tests/repo_utils/test_check_copies.py",
"repo_id": "transformers",
"token_count": 7782
} | 616 |
# 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 required by appl... | transformers/tests/test_backbone_common.py/0 | {
"file_path": "transformers/tests/test_backbone_common.py",
"repo_id": "transformers",
"token_count": 4368
} | 617 |
# 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 agreed to in wri... | transformers/tests/tokenization/test_tokenization_utils.py/0 | {
"file_path": "transformers/tests/tokenization/test_tokenization_utils.py",
"repo_id": "transformers",
"token_count": 8251
} | 618 |
import unittest
from transformers.testing_utils import Expectations
class ExpectationsTest(unittest.TestCase):
def test_expectations(self):
# We use the expectations below to make sure the right expectations are found for the right devices.
# Each value is just a unique ID.
expectations =... | transformers/tests/utils/test_expectations.py/0 | {
"file_path": "transformers/tests/utils/test_expectations.py",
"repo_id": "transformers",
"token_count": 648
} | 619 |
# Copyright 2019 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 agreed to in writ... | transformers/tests/utils/test_modeling_utils.py/0 | {
"file_path": "transformers/tests/utils/test_modeling_utils.py",
"repo_id": "transformers",
"token_count": 58665
} | 620 |
# coding=utf-8
# Copyright 2023 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_doctest_list.py/0 | {
"file_path": "transformers/utils/check_doctest_list.py",
"repo_id": "transformers",
"token_count": 1180
} | 621 |
import argparse
import os
past_versions_testing = {
"pytorch": {
"1.13": {
"torch": "1.13.1",
"torchvision": "0.14.1",
"torchaudio": "0.13.1",
"python": 3.9,
"cuda": "cu116",
"install": (
"python3 -m pip install --no-c... | transformers/utils/past_ci_versions.py/0 | {
"file_path": "transformers/utils/past_ci_versions.py",
"repo_id": "transformers",
"token_count": 2774
} | 622 |
from transformers import Wav2Vec2FeatureExtractor
class CustomFeatureExtractor(Wav2Vec2FeatureExtractor):
pass
| transformers/utils/test_module/custom_feature_extraction.py/0 | {
"file_path": "transformers/utils/test_module/custom_feature_extraction.py",
"repo_id": "transformers",
"token_count": 37
} | 623 |
.PHONY: test precommit common_tests slow_tests test_examples tests_gpu
check_dirs := examples tests trl
ACCELERATE_CONFIG_PATH = `pwd`/examples/accelerate_configs
COMMAND_FILES_PATH = `pwd`/commands
test:
pytest -n auto -m "not slow and not low-priority" -s -v --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Time... | trl/Makefile/0 | {
"file_path": "trl/Makefile",
"repo_id": "trl",
"token_count": 434
} | 624 |
# Dataset formats and types
This guide provides an overview of the dataset formats and types supported by each trainer in TRL.
## Overview of the dataset formats and types
- The *format* of a dataset refers to how the data is structured, typically categorized as either *standard* or *conversational*.
- The *type* is... | trl/docs/source/dataset_formats.md/0 | {
"file_path": "trl/docs/source/dataset_formats.md",
"repo_id": "trl",
"token_count": 18062
} | 625 |
# Logging
As reinforcement learning algorithms are historically challenging to debug, it's important to pay careful attention to logging.
By default, TRL trainers like [`PPOTrainer`] and [`GRPOTrainer`] save a lot of relevant information to supported experiment trackers like Weights & Biases (wandb) or TensorBoard.
U... | trl/docs/source/logging.md/0 | {
"file_path": "trl/docs/source/logging.md",
"repo_id": "trl",
"token_count": 2445
} | 626 |
# RLOO Trainer
[](https://huggingface.co/models?other=rloo,trl)
TRL supports training LLMs with REINFORCE Leave-One-Out (RLOO). The idea is that instead of using a value function, RLOO generates K completions for each prompt. For each completion, RLOO uses the mea... | trl/docs/source/rloo_trainer.md/0 | {
"file_path": "trl/docs/source/rloo_trainer.md",
"repo_id": "trl",
"token_count": 9483
} | 627 |
<jupyter_start><jupyter_text>Tune GPT2 to generate controlled sentiment reviews> Optimise GPT2 to produce IMDB movie reviews with controlled sentiment using a BERT sentiment classifier for rewards.**WARNING:** We often experienced loss spikes in this examples which caused model training to fail or slow down. There is a... | trl/examples/notebooks/gpt2-sentiment-control.ipynb/0 | {
"file_path": "trl/examples/notebooks/gpt2-sentiment-control.ipynb",
"repo_id": "trl",
"token_count": 4850
} | 628 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/examples/research_projects/stack_llama_2/scripts/sft_llama2.py/0 | {
"file_path": "trl/examples/research_projects/stack_llama_2/scripts/sft_llama2.py",
"repo_id": "trl",
"token_count": 2894
} | 629 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/examples/scripts/kto.py/0 | {
"file_path": "trl/examples/scripts/kto.py",
"repo_id": "trl",
"token_count": 1384
} | 630 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/examples/scripts/xpo.py/0 | {
"file_path": "trl/examples/scripts/xpo.py",
"repo_id": "trl",
"token_count": 1910
} | 631 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/tests/test_dataset_formatting.py/0 | {
"file_path": "trl/tests/test_dataset_formatting.py",
"repo_id": "trl",
"token_count": 4465
} | 632 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/tests/test_reward_trainer.py/0 | {
"file_path": "trl/tests/test_reward_trainer.py",
"repo_id": "trl",
"token_count": 4510
} | 633 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/trl/models/modeling_base.py/0 | {
"file_path": "trl/trl/models/modeling_base.py",
"repo_id": "trl",
"token_count": 13829
} | 634 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/trl/scripts/vllm_serve.py/0 | {
"file_path": "trl/trl/scripts/vllm_serve.py",
"repo_id": "trl",
"token_count": 11453
} | 635 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/trl/trainer/grpo_config.py/0 | {
"file_path": "trl/trl/trainer/grpo_config.py",
"repo_id": "trl",
"token_count": 14062
} | 636 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/trl/trainer/prm_config.py/0 | {
"file_path": "trl/trl/trainer/prm_config.py",
"repo_id": "trl",
"token_count": 1932
} | 637 |
## Об организации процесса перевода в команде:
0. У нас Холакратия. Координатор команды - не менеджер! Он координирует работу команды. Чтобы все участники команды имели представление об общей картине, все ключевые моменты обсуждаются открыто в Issue.
1. Ставьте реальные сроки (если это возможно). Если это не возможно ... | agents-course/translation_agreements/ru/TRANSLATION_AGREEMENTS.md/0 | {
"file_path": "agents-course/translation_agreements/ru/TRANSLATION_AGREEMENTS.md",
"repo_id": "agents-course",
"token_count": 5294
} | 0 |
# Live 1: How the Course Works and First Q&A
In this first live stream of the Agents Course, we explained how the course **works** (scope, units, challenges, and more) and answered your questions.
<iframe width="560" height="315" src="https://www.youtube.com/embed/iLVyYDbdSmM?si=TCX5Ai3uZuKLXq45" title="YouTube video... | agents-course/units/en/communication/live1.mdx/0 | {
"file_path": "agents-course/units/en/communication/live1.mdx",
"repo_id": "agents-course",
"token_count": 211
} | 1 |
# What are Tools?
<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-check-2.jpg" alt="Unit 1 planning"/>
One crucial aspect of AI Agents is their ability to take **actions**. As we saw, this happens through the use of **Tools**.
In this section, we’ll learn what T... | agents-course/units/en/unit1/tools.mdx/0 | {
"file_path": "agents-course/units/en/unit1/tools.mdx",
"repo_id": "agents-course",
"token_count": 4175
} | 2 |
# Introduction to LlamaIndex
Welcome to this module, where you’ll learn how to build LLM-powered agents using the [LlamaIndex](https://www.llamaindex.ai/) toolkit.
LlamaIndex is **a complete toolkit for creating LLM-powered agents over your data using indexes and workflows**. For this course we'll focus on three main... | agents-course/units/en/unit2/llama-index/introduction.mdx/0 | {
"file_path": "agents-course/units/en/unit2/llama-index/introduction.mdx",
"repo_id": "agents-course",
"token_count": 636
} | 3 |
<CourseFloatingBanner
classNames="absolute z-10 right-0 top-0"
notebooks={[
{label: "Google Colab", value: "https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/unit2/smolagents/vision_agents.ipynb"},
]}
askForHelpUrl="http://hf.co/join/discord" />
# Vision Agents... | agents-course/units/en/unit2/smolagents/vision_agents.mdx/0 | {
"file_path": "agents-course/units/en/unit2/smolagents/vision_agents.mdx",
"repo_id": "agents-course",
"token_count": 3661
} | 4 |
# Conclusión [[conclusion]]
¡Felicidades por terminar esta primera Unidad Bonus 🥳
¡Acabas de **dominar la comprensión de las llamadas a funciones y cómo hacer fine-tuning de tu modelo para realizar llamadas a funciones**!
Si tenemos un consejo ahora, es intentar **hacer fine-tuning de diferentes modelos**. La **mej... | agents-course/units/es/bonus-unit1/conclusion.mdx/0 | {
"file_path": "agents-course/units/es/bonus-unit1/conclusion.mdx",
"repo_id": "agents-course",
"token_count": 325
} | 5 |
# Bienvenido/a al curso de 🤗 Agentes IA [[introduction]]
<figure>
<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit0/thumbnail.jpg" alt="AI Agents Course thumbnail" width="100%"/>
<figcaption>The background of the image was generated using <a href="https://scenario.com/">Scen... | agents-course/units/es/unit0/introduction.mdx/0 | {
"file_path": "agents-course/units/es/unit0/introduction.mdx",
"repo_id": "agents-course",
"token_count": 4085
} | 6 |
# ¿Qué es un Agente?
<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-no-check.jpg" alt="Planificación de la Unidad 1"/>
Al final de esta sección, te sentirás cómodo con el concepto de agentes y sus diversas aplicaciones en la IA.
Para explicar qué es un Agente, ... | agents-course/units/es/unit1/what-are-agents.mdx/0 | {
"file_path": "agents-course/units/es/unit1/what-are-agents.mdx",
"repo_id": "agents-course",
"token_count": 3132
} | 7 |
# Pequeño Quiz (no calificado) [[quiz1]]
Hasta ahora hemos discutido los componentes clave y herramientas utilizadas en LlamaIndex.
Es hora de hacer un pequeño quiz, ya que **probarse a sí mismo** es la mejor manera de aprender y [evitar la ilusi n de competencia](https://www.coursera.org/lecture/learning-how-to-learn... | agents-course/units/es/unit2/llama-index/quiz1.mdx/0 | {
"file_path": "agents-course/units/es/unit2/llama-index/quiz1.mdx",
"repo_id": "agents-course",
"token_count": 1495
} | 8 |
# Finetunons un modèle pour pouvoir faire de l'appel de fonctions
Nous sommes maintenant prêts à finetuner notre premier modèle pour de l'appel de fonctions 🔥.
## Comment entraînons-nous un tel modèle ?
> Réponse : Nous avons besoin de **données**
Un processus d'entraînement peut être divisé en 3 étapes :
1. **Le... | agents-course/units/fr/bonus-unit1/fine-tuning.mdx/0 | {
"file_path": "agents-course/units/fr/bonus-unit1/fine-tuning.mdx",
"repo_id": "agents-course",
"token_count": 1652
} | 9 |
# Embarquement : vos premiers pas ⛵
<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit0/time-to-onboard.jpg" alt="Il est temps de démarrer" width="100%"/>
Maintenant que vous avez tous les détails, commençons ! Nous allons réaliser quatre choses :
1. **Créer votre compte Huggi... | agents-course/units/fr/unit0/onboarding.mdx/0 | {
"file_path": "agents-course/units/fr/unit0/onboarding.mdx",
"repo_id": "agents-course",
"token_count": 1898
} | 10 |
# Qu'est-ce qu'un LLM ?
<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-check-1.jpg" alt="Planification de l'Unité 1"/>
Dans la section précédente, nous avons appris que chaque agent a besoin **de se baser sur un modèle d'IA** et que les LLM sont le type de modèl... | agents-course/units/fr/unit1/what-are-llms.mdx/0 | {
"file_path": "agents-course/units/fr/unit1/what-are-llms.mdx",
"repo_id": "agents-course",
"token_count": 5237
} | 11 |
# Quiz rapide 2 (non noté) [[quiz2]]
Quoi ?! Un autre Quiz ? Nous savons, nous savons, ... 😅 Mais ce court quiz non noté est là pour **vous aider à renforcer les concepts clés que vous venez d'apprendre**.
Ce quiz couvre les *workflows* d'agents et les interactions, composants essentiels pour construire des agents e... | agents-course/units/fr/unit2/llama-index/quiz2.mdx/0 | {
"file_path": "agents-course/units/fr/unit2/llama-index/quiz2.mdx",
"repo_id": "agents-course",
"token_count": 1299
} | 12 |
- title: Раздел 0. Добро пожаловать на курс!
sections:
- local: unit0/introduction
title: Добро пожаловать на курс 🤗
- local: unit0/onboarding
title: Вводная часть
- local: unit0/discord101
title: (Необязательно) Discord 101
- title: Прямой эфир 1. Как работает курс, вопросы и ответы
sections:
... | agents-course/units/ru-RU/_toctree.yml/0 | {
"file_path": "agents-course/units/ru-RU/_toctree.yml",
"repo_id": "agents-course",
"token_count": 1501
} | 13 |
# Получите свой сертификат
<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-unit1sub5DONE.jpg" alt="Раздел 1 планирование"/>
Теперь, когда вы успешно прошли этот тест, **вы можете получить свой сертификат 🎓**.
Чтобы получить этот сертификат, вам необходимо пройт... | agents-course/units/ru-RU/unit1/get-your-certificate.mdx/0 | {
"file_path": "agents-course/units/ru-RU/unit1/get-your-certificate.mdx",
"repo_id": "agents-course",
"token_count": 654
} | 14 |
# Tools là gì?
<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-check-2.jpg" alt="Unit 1 planning"/>
Một khía cạnh quan trọng của AI agents là khả năng thực hiện **hành động**. Như ta đã thấy, điều này xảy ra thông qua việc sử dụng **Tools** (công cụ).
Trong phần... | agents-course/units/vi/unit1/tools.mdx/0 | {
"file_path": "agents-course/units/vi/unit1/tools.mdx",
"repo_id": "agents-course",
"token_count": 7532
} | 15 |
# 直播第一课:课程体系解读与首次答疑会
在本期智能体课程的首场直播中,我们详细解析了课程运行机制(涵盖课程范围、单元结构、实践挑战等核心要素),并针对学员疑问进行现场解答。
<iframe width="560" height="315" src="https://www.youtube.com/embed/iLVyYDbdSmM?si=TCX5Ai3uZuKLXq45" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture... | agents-course/units/zh-CN/communication/live1.mdx/0 | {
"file_path": "agents-course/units/zh-CN/communication/live1.mdx",
"repo_id": "agents-course",
"token_count": 467
} | 16 |
# 思维机制:内部推理与 ReAct 方法
<Tip>
本节将深入探讨 AI 智能体的内部运作机制——其推理与规划能力。我们将解析智能体如何通过内部对话分析信息,将复杂问题分解为可管理的步骤,并决策下一步行动。同时介绍 ReAct 方法,是一种鼓励模型在行动前"逐步思考"的提示技术。
</Tip>
思维(Thought)代表着智能体**解决任务的内部推理与规划过程**。
这利用了智能体的大型语言模型 (LLM) 能力**来分析其 prompt 中的信息**。
可将其视为智能体的内部对话,在此过程中它会考量当前任务并制定应对策略。
智能体的思维负责获取当前观察结果,并决定下一步应采取的行动。
通过这一过程,智能体能够**... | agents-course/units/zh-CN/unit1/thoughts.mdx/0 | {
"file_path": "agents-course/units/zh-CN/unit1/thoughts.mdx",
"repo_id": "agents-course",
"token_count": 2482
} | 17 |
# 结语
恭喜完成第二单元 `llama-index` 模块的学习 🥳
您已掌握 `llama-index` 的核心基础,并学会了如何构建自主式工作流!
现在凭借掌握的 `llama-index` 技能,您可以开始创建解决实际任务的搜索引擎。
在本单元的下个模块中,您将学习**如何用 LangGraph 构建智能体**。
最后,我们诚挚希望**听取您对课程的评价和改进建议**。
如有任何反馈,请👉[填写此表单](https://docs.google.com/forms/d/e/1FAIpQLSe9VaONn0eglax0uTwi29rIn4tM7H2sYmmybmG5jJNlE5v0xA/viewform?usp=di... | agents-course/units/zh-CN/unit2/llama-index/conclusion.mdx/0 | {
"file_path": "agents-course/units/zh-CN/unit2/llama-index/conclusion.mdx",
"repo_id": "agents-course",
"token_count": 436
} | 18 |
<CourseFloatingBanner chapter={2}
classNames="absolute z-10 right-0 top-0"
notebooks={[
{label: "Google Colab", value: "https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/unit2/smolagents/tools.ipynb"},
]} />
# 工具
正如我们在[第一单元](https://huggingface.co/learn/agents-... | agents-course/units/zh-CN/unit2/smolagents/tools.mdx/0 | {
"file_path": "agents-course/units/zh-CN/unit2/smolagents/tools.mdx",
"repo_id": "agents-course",
"token_count": 6379
} | 19 |
[build]
rustflags = ["-C", "target-cpu=native"]
[target.wasm32-unknown-unknown]
rustflags = ["-C", "target-feature=+simd128", "--cfg", 'getrandom_backend="wasm_js"']
[target.x86_64-apple-darwin]
rustflags = ["-C", "target-feature=-avx,-avx2"] | candle/.cargo/config.toml/0 | {
"file_path": "candle/.cargo/config.toml",
"repo_id": "candle",
"token_count": 101
} | 20 |
[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
} | 21 |
# Candle MNIST Tutorial
## Introduction
This tutorial provides an introduction to Candle by implementing and training a neural network for MNIST digit classification from scratch.
Throughout this tutorial, you will learn the basics of:
- Tensor operations and model construction
- Creating and implementing neural n... | candle/candle-book/src/guide/mnist/intro.md/0 | {
"file_path": "candle/candle-book/src/guide/mnist/intro.md",
"repo_id": "candle",
"token_count": 116
} | 22 |
# Training
Training starts with data. We're going to use the huggingface hub and
start with the Hello world dataset of machine learning, MNIST.
Let's start with downloading `MNIST` from [huggingface](https://huggingface.co/datasets/mnist).
This requires [`hf-hub`](https://github.com/huggingface/hf-hub).
```bash
ca... | candle/candle-book/src/training/training.md/0 | {
"file_path": "candle/candle-book/src/training/training.md",
"repo_id": "candle",
"token_count": 361
} | 23 |
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
use anyhow::Result;
use candle_core::{Device, Tensor};
// xs: [1024, 64, 1924], c Tensor[dims 128, 64, 8; f32, cuda:0] Conv1dConfig { padding: 0, stride: 4, dilation: 1, groups: 1 }
fn main() -> Result<()> ... | candle/candle-core/examples/cuda_basics.rs/0 | {
"file_path": "candle/candle-core/examples/cuda_basics.rs",
"repo_id": "candle",
"token_count": 363
} | 24 |
use crate::WithDType;
use cudarc;
use cudarc::cudnn::safe::{ConvForward, Cudnn};
use cudarc::driver::{CudaSlice, CudaView, DeviceRepr, ValidAsZeroBits};
use std::cell::RefCell;
use std::collections::HashMap;
use std::sync::Arc;
// The cudnn handles are stored per thread here rather than on the CudaDevice as they are n... | candle/candle-core/src/cuda_backend/cudnn.rs/0 | {
"file_path": "candle/candle-core/src/cuda_backend/cudnn.rs",
"repo_id": "candle",
"token_count": 4227
} | 25 |
//! Implementation of Backend traits for Metal
//!
use crate::backend::{BackendDevice, BackendStorage};
use crate::conv::{ParamsConv1D, ParamsConv2D, ParamsConvTranspose1D, ParamsConvTranspose2D};
use crate::op::{BinaryOpT, CmpOp, ReduceOp, UnaryOpT};
use crate::{CpuStorage, CpuStorageRef, DType, Layout, Result, Shape}... | candle/candle-core/src/metal_backend/mod.rs/0 | {
"file_path": "candle/candle-core/src/metal_backend/mod.rs",
"repo_id": "candle",
"token_count": 54045
} | 26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.