text
stringlengths
5
424k
id
stringlengths
13
178
metadata
dict
__index_level_0__
int64
0
672
# 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/mask2former/test_modeling_mask2former.py/0
{ "file_path": "transformers/tests/models/mask2former/test_modeling_mask2former.py", "repo_id": "transformers", "token_count": 11394 }
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/mixtral/test_modeling_mixtral.py/0
{ "file_path": "transformers/tests/models/mixtral/test_modeling_mixtral.py", "repo_id": "transformers", "token_count": 4333 }
584
# 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/mobilenet_v1/test_modeling_mobilenet_v1.py/0
{ "file_path": "transformers/tests/models/mobilenet_v1/test_modeling_mobilenet_v1.py", "repo_id": "transformers", "token_count": 3893 }
585
# 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 app...
transformers/tests/models/moshi/test_modeling_moshi.py/0
{ "file_path": "transformers/tests/models/moshi/test_modeling_moshi.py", "repo_id": "transformers", "token_count": 20043 }
586
# 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 app...
transformers/tests/models/musicgen_melody/test_modeling_musicgen_melody.py/0
{ "file_path": "transformers/tests/models/musicgen_melody/test_modeling_musicgen_melody.py", "repo_id": "transformers", "token_count": 27254 }
587
# 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/oneformer/test_processing_oneformer.py/0
{ "file_path": "transformers/tests/models/oneformer/test_processing_oneformer.py", "repo_id": "transformers", "token_count": 15465 }
588
# 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/owlvit/test_modeling_owlvit.py/0
{ "file_path": "transformers/tests/models/owlvit/test_modeling_owlvit.py", "repo_id": "transformers", "token_count": 18294 }
589
# 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/prompt_depth_anything/test_image_processing_prompt_depth_anything.py/0
{ "file_path": "transformers/tests/models/prompt_depth_anything/test_image_processing_prompt_depth_anything.py", "repo_id": "transformers", "token_count": 3665 }
590
# Copyright 2024 The Qwen team, Alibaba Group 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/LICENS...
transformers/tests/models/qwen3_moe/test_modeling_qwen3_moe.py/0
{ "file_path": "transformers/tests/models/qwen3_moe/test_modeling_qwen3_moe.py", "repo_id": "transformers", "token_count": 4536 }
591
# 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/roberta_prelayernorm/test_modeling_roberta_prelayernorm.py/0
{ "file_path": "transformers/tests/models/roberta_prelayernorm/test_modeling_roberta_prelayernorm.py", "repo_id": "transformers", "token_count": 13503 }
592
# 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 agreed to in writ...
transformers/tests/models/sam/test_image_processing_sam.py/0
{ "file_path": "transformers/tests/models/sam/test_image_processing_sam.py", "repo_id": "transformers", "token_count": 5907 }
593
# 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/seamless_m4t/test_processing_seamless_m4t.py/0
{ "file_path": "transformers/tests/models/seamless_m4t/test_processing_seamless_m4t.py", "repo_id": "transformers", "token_count": 2018 }
594
# 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/smolvlm/test_video_processing_smolvlm.py/0
{ "file_path": "transformers/tests/models/smolvlm/test_video_processing_smolvlm.py", "repo_id": "transformers", "token_count": 2515 }
595
# 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/swin/test_modeling_swin.py/0
{ "file_path": "transformers/tests/models/swin/test_modeling_swin.py", "repo_id": "transformers", "token_count": 9027 }
596
# 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/tests/models/tapas/test_modeling_tapas.py/0
{ "file_path": "transformers/tests/models/tapas/test_modeling_tapas.py", "repo_id": "transformers", "token_count": 21615 }
597
# 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/yolos/test_image_processing_yolos.py/0
{ "file_path": "transformers/tests/models/yolos/test_image_processing_yolos.py", "repo_id": "transformers", "token_count": 14287 }
598
# 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_summarization.py/0
{ "file_path": "transformers/tests/pipelines/test_pipelines_summarization.py", "repo_id": "transformers", "token_count": 3086 }
599
# 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/quantization/fbgemm_fp8/test_fbgemm_fp8.py/0
{ "file_path": "transformers/tests/quantization/fbgemm_fp8/test_fbgemm_fp8.py", "repo_id": "transformers", "token_count": 5006 }
600
# 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/test_processing_common.py/0
{ "file_path": "transformers/tests/test_processing_common.py", "repo_id": "transformers", "token_count": 28663 }
601
# 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/trainer/test_trainer_fsdp.py/0
{ "file_path": "transformers/tests/trainer/test_trainer_fsdp.py", "repo_id": "transformers", "token_count": 3184 }
602
# 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/utils/test_cache_utils.py/0
{ "file_path": "transformers/tests/utils/test_cache_utils.py", "repo_id": "transformers", "token_count": 26291 }
603
import os import unittest from pathlib import Path from typing import Callable import pytest from transformers.utils.import_utils import ( Backend, VersionComparison, define_import_structure, spread_import_structure, ) import_structures = Path(__file__).parent / "import_structures" def fetch__all_...
transformers/tests/utils/test_import_structure.py/0
{ "file_path": "transformers/tests/utils/test_import_structure.py", "repo_id": "transformers", "token_count": 4875 }
604
# 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/add_pipeline_model_mapping_to_test.py/0
{ "file_path": "transformers/utils/add_pipeline_model_mapping_to_test.py", "repo_id": "transformers", "token_count": 4970 }
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/utils/collated_reports.py/0
{ "file_path": "transformers/utils/collated_reports.py", "repo_id": "transformers", "token_count": 3020 }
606
# coding=utf-8 # 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 r...
transformers/utils/get_test_reports.py/0
{ "file_path": "transformers/utils/get_test_reports.py", "repo_id": "transformers", "token_count": 4253 }
607
"""A simple script to set flexibly CUDA_VISIBLE_DEVICES in GitHub Actions CI workflow files.""" import argparse import os if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--test_folder", type=str, default=None, help="The test folder name of t...
transformers/utils/set_cuda_devices_for_ci.py/0
{ "file_path": "transformers/utils/set_cuda_devices_for_ci.py", "repo_id": "transformers", "token_count": 338 }
608
{ "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 }
609
repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.11.10 hooks: - id: ruff-check types_or: [ python, pyi ] args: [ --fix ] - id: ruff-format types_or: [ python, pyi ] # - repo: https://github.com/codespell-project/codespell # rev: v2.1.0 # hooks:...
trl/.pre-commit-config.yaml/0
{ "file_path": "trl/.pre-commit-config.yaml", "repo_id": "trl", "token_count": 250 }
610
# Best of N sampling: Alternative ways to get better model output without RL based fine-tuning Within the extras module is the `best-of-n` sampler class that serves as an alternative method of generating better model output. As to how it fares against the RL based fine-tuning, please look in the `examples` directory ...
trl/docs/source/best_of_n.md/0
{ "file_path": "trl/docs/source/best_of_n.md", "repo_id": "trl", "token_count": 860 }
611
# Paper Index <Tip warning={true}> Section under construction. Feel free to contribute! </Tip> ## Group Relative Policy Optimization Papers relating to the [`GRPOTrainer`] ### Group Sequence Policy Optimization **📜 Paper**: https://huggingface.co/papers/2507.18071 GSPO is a GRPO variant that computes importanc...
trl/docs/source/paper_index.md/0
{ "file_path": "trl/docs/source/paper_index.md", "repo_id": "trl", "token_count": 7033 }
612
# Using LLaMA models with TRL We've begun rolling out examples to use Meta's LLaMA models in `trl` (see [Meta's LLaMA release](https://ai.facebook.com/blog/large-language-model-llama-meta-ai/) for the original LLaMA model). ## Efficient training strategies Even training the smallest LLaMA model requires an enormous ...
trl/docs/source/using_llama_models.md/0
{ "file_path": "trl/docs/source/using_llama_models.md", "repo_id": "trl", "token_count": 2915 }
613
# 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/datasets/lm-human-preferences-sentiment.py/0
{ "file_path": "trl/examples/datasets/lm-human-preferences-sentiment.py", "repo_id": "trl", "token_count": 1580 }
614
# 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/layer_skip/scripts/custom_trainer.py/0
{ "file_path": "trl/examples/research_projects/layer_skip/scripts/custom_trainer.py", "repo_id": "trl", "token_count": 800 }
615
# 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/reward_modeling.py/0
{ "file_path": "trl/examples/scripts/reward_modeling.py", "repo_id": "trl", "token_count": 1924 }
616
# 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/scripts/generate_zen_dataset.py/0
{ "file_path": "trl/scripts/generate_zen_dataset.py", "repo_id": "trl", "token_count": 15763 }
617
# 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_best_of_n_sampler.py/0
{ "file_path": "trl/tests/test_best_of_n_sampler.py", "repo_id": "trl", "token_count": 1685 }
618
# 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_nash_md_trainer.py/0
{ "file_path": "trl/tests/test_nash_md_trainer.py", "repo_id": "trl", "token_count": 3838 }
619
# 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/testing_utils.py/0
{ "file_path": "trl/tests/testing_utils.py", "repo_id": "trl", "token_count": 2098 }
620
# 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/activation_offloading.py/0
{ "file_path": "trl/trl/models/activation_offloading.py", "repo_id": "trl", "token_count": 11220 }
621
# 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": 12317 }
622
# 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/kto_config.py/0
{ "file_path": "trl/trl/trainer/kto_config.py", "repo_id": "trl", "token_count": 4253 }
623
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, ...
agents-course/LICENSE/0
{ "file_path": "agents-course/LICENSE", "repo_id": "agents-course", "token_count": 3168 }
0
# AI Agent Observability & Evaluation ![Bonus Unit 2 Thumbnail](https://langfuse.com/images/cookbook/huggingface-agent-course/agent-observability-and-evaluation.png) Welcome to **Bonus Unit 2**! In this chapter, you'll explore advanced strategies for observing, evaluating, and ultimately improving the performance of ...
agents-course/units/en/bonus-unit2/introduction.mdx/0
{ "file_path": "agents-course/units/en/bonus-unit2/introduction.mdx", "repo_id": "agents-course", "token_count": 426 }
1
# Understanding AI Agents through the Thought-Action-Observation Cycle <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-check-3.jpg" alt="Unit 1 planning"/> In the previous sections, we learned: - **How tools are made available to the agent in the system prompt**...
agents-course/units/en/unit1/agent-steps-and-structure.mdx/0
{ "file_path": "agents-course/units/en/unit1/agent-steps-and-structure.mdx", "repo_id": "agents-course", "token_count": 1797 }
2
# Conclusion Congratulations on finishing the `LangGraph` module of this second Unit! 🥳 You've now mastered the fundamentals of building structured workflows with LangGraph which you will be able to send to production. This module is just the beginning of your journey with LangGraph. For more advanced topics, we re...
agents-course/units/en/unit2/langgraph/conclusion.mdx/0
{ "file_path": "agents-course/units/en/unit2/langgraph/conclusion.mdx", "repo_id": "agents-course", "token_count": 299 }
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/code_agents.ipynb"}, ]} askForHelpUrl="http://hf.co/join/discord" /> # Building Agents...
agents-course/units/en/unit2/smolagents/code_agents.mdx/0
{ "file_path": "agents-course/units/en/unit2/smolagents/code_agents.mdx", "repo_id": "agents-course", "token_count": 6112 }
4
# Introduction to Use Case for Agentic RAG ![Agentic RAG banner](https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit3/agentic-rag/thumbnail.jpg) In this unit, we will help Alfred, our friendly agent who is hosting the gala, by using Agentic RAG to create a tool that can be used to answer ...
agents-course/units/en/unit3/agentic-rag/introduction.mdx/0
{ "file_path": "agents-course/units/en/unit3/agentic-rag/introduction.mdx", "repo_id": "agents-course", "token_count": 729 }
5
# Cuestionario: Evaluación de Agentes de IA Vamos a evaluar tu comprensión de los conceptos de rastreo y evaluación de agentes cubiertos en esta unidad extra. Este cuestionario es opcional y no está calificado. ### Q1: ¿A qué se refiere principalmente la observabilidad en los agentes de IA? ¿Qué afirmación describe ...
agents-course/units/es/bonus-unit2/quiz.mdx/0
{ "file_path": "agents-course/units/es/bonus-unit2/quiz.mdx", "repo_id": "agents-course", "token_count": 2117 }
6
# Biblioteca de Agente de Prueba <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-unit1sub3DONE.jpg" alt="Unit 1 planning"/> Este curso es agnóstico en cuanto al framework porque queremos **centrarnos en los conceptos de agentes de IA y evitar perdernos en los det...
agents-course/units/es/unit1/dummy-agent-library.mdx/0
{ "file_path": "agents-course/units/es/unit1/dummy-agent-library.mdx", "repo_id": "agents-course", "token_count": 4505 }
7
# Construyendo Tu Primer LangGraph Ahora que entendemos los componentes básicos, vamos a ponerlos en práctica construyendo nuestro primer grafo funcional. Implementaremos el sistema de procesamiento de correos electrónicos de Alfred, donde necesita: 1. Leer correos electrónicos entrantes 2. Clasificarlos como spam o ...
agents-course/units/es/unit2/langgraph/first_graph.mdx/0
{ "file_path": "agents-course/units/es/unit2/langgraph/first_graph.mdx", "repo_id": "agents-course", "token_count": 5532 }
8
# ¡Hora del Examen! ¡Buen trabajo al estudiar el material sobre `smolagents`! Ya has logrado mucho. Ahora, es momento de poner a prueba tus conocimientos con un cuestionario. 🧠 ## Instrucciones - El cuestionario consiste en preguntas de código. - Se te darán instrucciones para completar fragmentos de código. - Lee ...
agents-course/units/es/unit2/smolagents/final_quiz.mdx/0
{ "file_path": "agents-course/units/es/unit2/smolagents/final_quiz.mdx", "repo_id": "agents-course", "token_count": 403 }
9
# Construyendo e Integrando Herramientas para Tu Agente En esta sección, le daremos a Alfred acceso a la web, permitiéndole encontrar las últimas noticias y actualizaciones globales. Además, tendrá acceso a datos meteorológicos y estadísticas de descargas de modelos de Hugging Face Hub, para que pueda mantener conver...
agents-course/units/es/unit3/agentic-rag/tools.mdx/0
{ "file_path": "agents-course/units/es/unit3/agentic-rag/tools.mdx", "repo_id": "agents-course", "token_count": 5452 }
10
# Quiz final de l'Unité 1 <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-unit1sub4DONE.jpg" alt="Planification de l'Unité 1"/> Bravo d'avoir terminé la première unité ! Testons maintenant votre compréhension des concepts clés abordés jusqu'à présent. Une fois q...
agents-course/units/fr/unit1/final-quiz.mdx/0
{ "file_path": "agents-course/units/fr/unit1/final-quiz.mdx", "repo_id": "agents-course", "token_count": 627 }
11
# Introduction à LangGraph <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/LangGraph/LangGraph.png" alt="Unit 2.3 Thumbnail"/> Bienvenue dans cette nouvelle partie de notre voyage, où vous allez apprendre **comment créer des applications** en utilisant le *framework* [`Lang...
agents-course/units/fr/unit2/langgraph/introduction.mdx/0
{ "file_path": "agents-course/units/fr/unit2/langgraph/introduction.mdx", "repo_id": "agents-course", "token_count": 659 }
12
# Et maintenant ? Quels sujets devrais-je apprendre ? L'IA agentique est un domaine en évolution rapide, et comprendre les protocoles fondamentaux est essentiel pour construire des systèmes intelligents et autonomes. Deux standards importants avec lesquels vous devriez vous familiariser sont : - Le ***Model Context...
agents-course/units/fr/unit4/additional-readings.mdx/0
{ "file_path": "agents-course/units/fr/unit4/additional-readings.mdx", "repo_id": "agents-course", "token_count": 675 }
13
# Unit 1 퀴즈 [[unit-1-quiz]] <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-unit1sub4DONE.jpg" alt="Unit 1 planning"/> 첫 번째 단원을 완료하신 것을 축하합니다! 지금까지 배운 핵심 개념들에 대한 이해도를 테스트해 보겠습니다. 퀴즈를 통과하면 다음 섹션으로 진행하여 수료증을 받을 수 있습니다. 행운을 빕니다! ## 퀴즈 [[quiz]] 여기 인터랙티브 퀴즈가 있습니다....
agents-course/units/ko/unit1/final-quiz.mdx/0
{ "file_path": "agents-course/units/ko/unit1/final-quiz.mdx", "repo_id": "agents-course", "token_count": 1333 }
14
# Live 1: Как работает курс и первые ответы на вопросы В этой первой прямой трансляции курса по Агентам мы рассказали о том, как **работает** курс (объем, разделы, задачи и многое другое), и ответили на ваши вопросы. <iframe width="560" height="315" src="https://www.youtube.com/embed/iLVyYDbdSmM?si=TCX5Ai3uZuKLXq45" ...
agents-course/units/ru-RU/communication/live1.mdx/0
{ "file_path": "agents-course/units/ru-RU/communication/live1.mdx", "repo_id": "agents-course", "token_count": 576 }
15
# Быстрая самопроверка (не оценивается) [[quiz2]] Что?! Еще один тест? Мы знаем, мы знаем, ... 😅 Но эта короткий, не оцениваемый тест поможет вам **закрепить ключевые понятия, которые вы только что выучили**. Этот тест охватывает Большие Языковые Модели (Large Language Model), системы сообщений и инструменты; важн...
agents-course/units/ru-RU/unit1/quiz2.mdx/0
{ "file_path": "agents-course/units/ru-RU/unit1/quiz2.mdx", "repo_id": "agents-course", "token_count": 2951 }
16
# Hành động: Giúp Agent Tương tác với Môi trường <Tip> Trong phần này, chúng ta sẽ khám phá các bước cụ thể mà một AI agent thực hiện để tương tác với môi trường. Ta sẽ tìm hiểu cách biểu diễn hành động (sử dụng JSON hoặc code), tầm quan trọng của phương pháp dừng và phân tích (stop and parse approach), cùng các loại...
agents-course/units/vi/unit1/actions.mdx/0
{ "file_path": "agents-course/units/vi/unit1/actions.mdx", "repo_id": "agents-course", "token_count": 4549 }
17
# AI 智能体可观测性与评估 ## 🔎 什么是可观测性? 可观测性是指通过查看日志、指标和追踪等外部信号来理解你的 AI 智能体内部正在发生什么。对于 AI 智能体而言,这意味着追踪行为、工具使用情况、模型调用和响应,以便调试和改进智能体性能。 ![Observability dashboard](https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/bonus-unit2/langfuse-dashboard.png) ## 🔭 为何智能体可观测性如此重要 没有可观测性,AI 智能体就是“黑匣子”。可观测性工具使智能体...
agents-course/units/zh-CN/bonus_unit2/what-is-agent-observability-and-evaluation.mdx/0
{ "file_path": "agents-course/units/zh-CN/bonus_unit2/what-is-agent-observability-and-evaluation.mdx", "repo_id": "agents-course", "token_count": 6542 }
18
# 快速自测(不计分)[[quiz2]] 什么?!还有测验?我们理解,我们理解... 😅 但这个简短的不计分测验旨在**帮助您巩固刚学习的关键概念**。 本测验涵盖大型语言模型(LLMs)、消息系统和工具——这些是理解和构建 AI 智能体的核心组件。 ### 问题1:以下哪项最能描述 AI 工具? <Question choices={[ { text: "仅生成文本响应的流程", explain: "", }, { text: "允许智能体执行特定任务并与外部环境交互的可执行流程或外部 API", explain: "工具是可执行函数,智能体可用其执行特定任务并与外部环境交互", correct: true }, {...
agents-course/units/zh-CN/unit1/quiz2.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit1/quiz2.mdx", "repo_id": "agents-course", "token_count": 1640 }
19
# LlamaIndex 中的组件是什么? 还记得第一单元中我们那位得力的管家智能体 Alfred 吗? 要有效协助我们,Alfred 需要理解我们的请求,并**准备、查找和使用相关信息来帮助完成任务**。 这正是 LlamaIndex 组件发挥作用的地方。 虽然 LlamaIndex 包含众多组件,但**我们将重点关注 `QueryEngine` 组件**。 为什么?因为它可以作为智能体的检索增强生成(RAG)工具。 那么什么是 RAG?大语言模型通过海量数据训练获得通用知识, 但它们可能缺乏相关且最新的特定领域数据。 RAG 通过从您的数据中检索相关信息并传递给 LLM 来解决这个问题。 ![RAG](https://h...
agents-course/units/zh-CN/unit2/llama-index/components.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit2/llama-index/components.mdx", "repo_id": "agents-course", "token_count": 6545 }
20
<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/tool_calling_agents.ipynb"}, ]} /> # 将操作编写为代码片段或 JSON 结构 <Tip> 您可以通过 <a hr...
agents-course/units/zh-CN/unit2/smolagents/tool_calling_agents.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit2/smolagents/tool_calling_agents.mdx", "repo_id": "agents-course", "token_count": 2069 }
21
# 什么是GAIA? [GAIA](https://huggingface.co/papers/2311.12983) 是一个**用于评估AI助手在需要核心能力组合的真实世界任务上的表现的基准**,这些核心能力包括推理、多模态理解、网页浏览和熟练的工具使用。 此论文介绍了GAIA _"[GAIA: A Benchmark for General AI Assistants](https://huggingface.co/papers/2311.12983)"_。 该基准包含**466个精心策划的问题**,这些问题对人类来说**在概念上简单**,但对当前的AI系统来说却**极具挑战性**。 为了说明差距: - **人类**:约...
agents-course/units/zh-CN/unit4/what-is-gaia.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit4/what-is-gaia.mdx", "repo_id": "agents-course", "token_count": 2365 }
22
# Introduction {{#include ../../README.md:goals}} {{#include ../../README.md:features}} This book will introduce step by step how to use `candle`.
candle/candle-book/src/README.md/0
{ "file_path": "candle/candle-book/src/README.md", "repo_id": "candle", "token_count": 49 }
23
# Candle MNIST Tutorial ## Modeling Open `src/main.rs` in your project folder and insert the following code: ```rust use candle_core::{Device, Result, Tensor}; struct Model { first: Tensor, second: Tensor, } impl Model { fn forward(&self, image: &Tensor) -> Result<Tensor> { let x = image.matmul...
candle/candle-book/src/guide/mnist/modeling.md/0
{ "file_path": "candle/candle-book/src/guide/mnist/modeling.md", "repo_id": "candle", "token_count": 1740 }
24
[package] name = "candle-core" version.workspace = true edition.workspace = true description.workspace = true repository.workspace = true keywords.workspace = true categories.workspace = true license.workspace = true readme = "README.md" [dependencies] accelerate-src = { workspace = true, optional = true } byteorder =...
candle/candle-core/Cargo.toml/0
{ "file_path": "candle/candle-core/Cargo.toml", "repo_id": "candle", "token_count": 668 }
25
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use std::str::FromStr; use anyhow::Result; use candle_core::{Device, Tensor}; fn cos_sin(n: usize, device: &Device) -> Result<Tensor> { let thetas: Vec<_> = (0..n).map(|i| (i as f32 / n as f32)).colle...
candle/candle-core/examples/cuda_sum_benchmark.rs/0
{ "file_path": "candle/candle-core/examples/cuda_sum_benchmark.rs", "repo_id": "candle", "token_count": 827 }
26
use crate::backend::BackendDevice; use crate::{CpuStorage, CpuStorageRef, DType, Layout, Result, Shape}; pub use candle_kernels as kernels; pub use cudarc; use cudarc::driver::CudaFunction; use float8::F8E4M3; use half::{bf16, f16}; use std::collections::HashMap; use std::sync::{Arc, Mutex}; use super::{CudaError, Cud...
candle/candle-core/src/cuda_backend/device.rs/0
{ "file_path": "candle/candle-core/src/cuda_backend/device.rs", "repo_id": "candle", "token_count": 10496 }
27
#![allow(dead_code)] use libc::{c_char, c_double, c_float, c_int}; mod ffi { use super::*; extern "C" { pub fn vsTanh(n: c_int, a: *const c_float, y: *mut c_float); pub fn vdTanh(n: c_int, a: *const c_double, y: *mut c_double); pub fn vsExp(n: c_int, a: *const c_float, y: *mut c_float);...
candle/candle-core/src/mkl.rs/0
{ "file_path": "candle/candle-core/src/mkl.rs", "repo_id": "candle", "token_count": 6463 }
28
//! Module to load `safetensor` files into CPU/GPU memory. //! //! There are multiple ways to load tensors from safetensor files: //! - `load` function for loading directly into memory and returning a HashMap of tensors //! - `MmapedSafetensors` for memory mapping files and avoiding full allocation //! - `SliceSafetens...
candle/candle-core/src/safetensors.rs/0
{ "file_path": "candle/candle-core/src/safetensors.rs", "repo_id": "candle", "token_count": 8785 }
29
#![allow(clippy::approx_constant)] use anyhow::{Context, Result}; use candle_core::{test_device, test_utils, DType, Device, Shape, Tensor, Var}; fn simple_grad(device: &Device) -> Result<()> { let x = Var::new(&[3f32, 1., 4.], device)?; let x = x.as_tensor(); let y = (((x * x)? + x * 5f64)? + 4f64)?; l...
candle/candle-core/tests/grad_tests.rs/0
{ "file_path": "candle/candle-core/tests/grad_tests.rs", "repo_id": "candle", "token_count": 9586 }
30
# candle-datasets
candle/candle-datasets/README.md/0
{ "file_path": "candle/candle-datasets/README.md", "repo_id": "candle", "token_count": 7 }
31
//! BEiT: BERT Pre-Training of Image Transformers //! https://github.com/microsoft/unilm/tree/master/beit #[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use clap::Parser; use candle::{DType, Device, IndexOp, Result, Tensor, D}; use candle_nn::{Module,...
candle/candle-examples/examples/beit/main.rs/0
{ "file_path": "candle/candle-examples/examples/beit/main.rs", "repo_id": "candle", "token_count": 1178 }
32
use anyhow::{Error as E, Result}; use candle::{DType, Device, Tensor}; use candle_nn::VarBuilder; use candle_transformers::models::colpali::Model; use candle_transformers::models::{colpali, paligemma}; use clap::Parser; use hf_hub::{api::sync::Api, Repo, RepoType}; use image::DynamicImage; use pdf2image::{RenderOptions...
candle/candle-examples/examples/colpali/main.rs/0
{ "file_path": "candle/candle-examples/examples/colpali/main.rs", "repo_id": "candle", "token_count": 3864 }
33
#[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_transformers::models::deepseek2::{DeepSeekV2, DeepSeekV2Config}; use candle::{DType, Device, Tensor}; use candle_examples::token_output_strea...
candle/candle-examples/examples/deepseekv2/main.rs/0
{ "file_path": "candle/candle-examples/examples/deepseekv2/main.rs", "repo_id": "candle", "token_count": 4196 }
34
# candle-granite LLMs from IBM Research [Granite](https://www.ibm.com/granite) is a family of Large Language Models built for business, to help drive trust and scalability in AI-driven applications. ## Running the example ```bash $ cargo run --example granite --features metal -r -- --model-type "granite7b-instruct" ...
candle/candle-examples/examples/granite/README.md/0
{ "file_path": "candle/candle-examples/examples/granite/README.md", "repo_id": "candle", "token_count": 371 }
35
pub const DEFAULT_IMAGE_TOKEN: &str = "<image>"; pub const DEFAULT_IM_START_TOKEN: &str = "<im_start>"; pub const DEFAULT_IM_END_TOKEN: &str = "<im_end>"; pub const IMAGE_PLACEHOLDER: &str = "<image-placeholder>";
candle/candle-examples/examples/llava/constants.rs/0
{ "file_path": "candle/candle-examples/examples/llava/constants.rs", "repo_id": "candle", "token_count": 86 }
36
# candle-mimi [Mimi](https://huggingface.co/kyutai/mimi) is a state of the art audio compression model using an encoder/decoder architecture with residual vector quantization. The candle implementation supports streaming meaning that it's possible to encode or decode a stream of audio tokens on the flight to provide l...
candle/candle-examples/examples/mimi/README.md/0
{ "file_path": "candle/candle-examples/examples/mimi/README.md", "repo_id": "candle", "token_count": 228 }
37
use std::path::PathBuf; use anyhow::{Error as E, Result}; use candle::{Device, Tensor}; use candle_nn::VarBuilder; use candle_transformers::models::modernbert; use clap::{Parser, ValueEnum}; use hf_hub::{api::sync::Api, Repo, RepoType}; use tokenizers::{PaddingParams, Tokenizer}; #[derive(Debug, Clone, ValueEnum)] en...
candle/candle-examples/examples/modernbert/main.rs/0
{ "file_path": "candle/candle-examples/examples/modernbert/main.rs", "repo_id": "candle", "token_count": 2425 }
38
#[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, IndexOp, Tensor}; use candle_nn::VarBuilder; use candle_transformers::models::llama::{Cache, Llama, LlamaConfig}; use candle_...
candle/candle-examples/examples/orpheus/main.rs/0
{ "file_path": "candle/candle-examples/examples/orpheus/main.rs", "repo_id": "candle", "token_count": 5468 }
39
# candle-quantized-qwen3 [Qwen3]((https://qwenlm.github.io/blog/qwen3/)) is an upgraded version of Qwen2.5, released by Alibaba Cloud. ## Running the example ```bash cargo run --example quantized-qwen3 --release -- --prompt "Write a function to count prime numbers up to N." ``` 0.6b is used by default, 1.7b, 4b, 8...
candle/candle-examples/examples/quantized-qwen3/README.md/0
{ "file_path": "candle/candle-examples/examples/quantized-qwen3/README.md", "repo_id": "candle", "token_count": 186 }
40
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use candle::Result; use clap::{Parser, Subcommand}; mod gym_env; mod vec_gym_env; mod ddpg; mod dqn; mod policy_gradient; #[derive(Parser)] struct Args { #[command(subcommand)] command: Command, ...
candle/candle-examples/examples/reinforcement-learning/main.rs/0
{ "file_path": "candle/candle-examples/examples/reinforcement-learning/main.rs", "repo_id": "candle", "token_count": 277 }
41
use anyhow::{Ok, Result}; use candle::{DType, IndexOp, Tensor}; use candle_transformers::models::flux; use candle_transformers::models::mmdit::model::MMDiT; pub struct SkipLayerGuidanceConfig { pub scale: f64, pub start: f64, pub end: f64, pub layers: Vec<usize>, } #[allow(clippy::too_many_arguments)...
candle/candle-examples/examples/stable-diffusion-3/sampling.rs/0
{ "file_path": "candle/candle-examples/examples/stable-diffusion-3/sampling.rs", "repo_id": "candle", "token_count": 1404 }
42
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use anyhow::Error as E; use clap::{Parser, ValueEnum}; use candle::{DType, Tensor}; use candle_examples::token_output_stream::TokenOutputStream; use candle_nn::VarBuilder; use candle_transformers::models::...
candle/candle-examples/examples/trocr/main.rs/0
{ "file_path": "candle/candle-examples/examples/trocr/main.rs", "repo_id": "candle", "token_count": 2167 }
43
// https://github.com/openai/whisper/blob/main/whisper/model.py/rgs // TODO: // - Batch size greater than 1. // - More token filters (SuppressBlanks, ApplyTimestampRules). #[cfg(feature = "accelerate")] extern crate accelerate_src; #[cfg(feature = "mkl")] extern crate intel_mkl_src; use anyhow::{Error as E, Result};...
candle/candle-examples/examples/whisper/main.rs/0
{ "file_path": "candle/candle-examples/examples/whisper/main.rs", "repo_id": "candle", "token_count": 14388 }
44
# candle-yolo-v8: Object Detection and Pose Estimation This is a port of [Ultralytics YOLOv8](https://github.com/ultralytics/ultralytics). The implementation is based on the [tinygrad version](https://github.com/tinygrad/tinygrad/blob/master/examples/yolov8.py) and on the model architecture described in this [issue](h...
candle/candle-examples/examples/yolo-v8/README.md/0
{ "file_path": "candle/candle-examples/examples/yolo-v8/README.md", "repo_id": "candle", "token_count": 562 }
45
# candle-flash-attn
candle/candle-flash-attn/README.md/0
{ "file_path": "candle/candle-flash-attn/README.md", "repo_id": "candle", "token_count": 8 }
46
// Copyright (c) 2024, 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::bfloat16_t, 192, true>(Flash_fwd_params &params, cudaStream_t st...
candle/candle-flash-attn/kernels/flash_fwd_hdim192_bf16_causal_sm80.cu/0
{ "file_path": "candle/candle-flash-attn/kernels/flash_fwd_hdim192_bf16_causal_sm80.cu", "repo_id": "candle", "token_count": 142 }
47
// Pytorch also has an implementation of Philox RNG: https://github.com/pytorch/pytorch/blob/8ca3c881db3e3510fcb7725389f6a0633c9b992c/torch/csrc/jit/tensorexpr/cuda_random.h #pragma once // Philox CUDA. namespace flash { struct ull2 { unsigned long long x; unsigned long long y; }; __forceinline__ __device__ ...
candle/candle-flash-attn/kernels/philox.cuh/0
{ "file_path": "candle/candle-flash-attn/kernels/philox.cuh", "repo_id": "candle", "token_count": 770 }
48
#include "cuda_utils.cuh" #include<stdint.h> // Naive implementation of conv1d. template <typename T, typename A> __device__ void conv1d( const size_t src_numel, const size_t l_out, const size_t stride, const size_t padding, const size_t dilation, const size_t *info, const T *src, const...
candle/candle-kernels/src/conv.cu/0
{ "file_path": "candle/candle-kernels/src/conv.cu", "repo_id": "candle", "token_count": 12097 }
49
use crate::linear_split; use crate::utils::{BufferOffset, EncoderProvider}; use crate::{set_params, Buffer, ComputeCommandEncoder, Device, Kernels, MetalKernelError, Source}; use objc2_metal::MTLResourceUsage; #[allow(clippy::too_many_arguments)] pub fn call_affine( device: &Device, ep: impl EncoderProvider, ...
candle/candle-metal-kernels/src/kernels/affine.rs/0
{ "file_path": "candle/candle-metal-kernels/src/kernels/affine.rs", "repo_id": "candle", "token_count": 2331 }
50
pub mod err; pub mod kernel; pub mod kernels; pub mod metal; pub mod source; pub mod utils; pub use err::MetalKernelError; pub use kernel::Kernels; pub use kernels::{ affine::*, call_binary_contiguous, call_binary_strided, call_mlx_gemm, cast::*, convolution::*, fill::*, indexing::*, quantized::*, random::*, r...
candle/candle-metal-kernels/src/lib.rs/0
{ "file_path": "candle/candle-metal-kernels/src/lib.rs", "repo_id": "candle", "token_count": 516 }
51
// The implementation below comes from MLX. // https://github.com/ml-explore/mlx/blob/0cea88bcc5e98e81a24d92eed8870a6976999f05/mlx/backend/metal/kernels/sort.h // Copyright © 2023-2024 Apple Inc. #define MLX_MTL_CONST static constant constexpr const #define MLX_MTL_LOOP_UNROLL _Pragma("clang loop unroll(full)") #incl...
candle/candle-metal-kernels/src/metal_src/mlx_sort.metal/0
{ "file_path": "candle/candle-metal-kernels/src/metal_src/mlx_sort.metal", "repo_id": "candle", "token_count": 12675 }
52
use crate::benchmarks::{BenchDevice, BenchDeviceHandler}; use candle::{DType, Device, Module, Tensor}; use candle_nn::LayerNorm; use criterion::{black_box, criterion_group, Criterion}; use std::time::Instant; fn run(input: &Tensor, weight: &Tensor, bias: &Tensor) { let _ = LayerNorm::new(weight.clone(), bias.clone...
candle/candle-nn/benches/benchmarks/layer_norm.rs/0
{ "file_path": "candle/candle-nn/benches/benchmarks/layer_norm.rs", "repo_id": "candle", "token_count": 676 }
53
//! candle-nn //! //! ## Other Crates //! //! Candle consists of a number of crates. This crate holds structs and functions //! that allow you to build and train neural nets. You may wish //! to look at the docs for the other crates which can be found here: //! //! - [candle-core](https://docs.rs/candle-core/). Core Da...
candle/candle-nn/src/lib.rs/0
{ "file_path": "candle/candle-nn/src/lib.rs", "repo_id": "candle", "token_count": 819 }
54
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use candle::test_utils::to_vec0_round; use candle::{Device, Result, Tensor}; /* Equivalent python code: import torch import torch.nn.functional as F input = torch.tensor([ [ 1.1050, 0.3013, -1.5394, -...
candle/candle-nn/tests/loss.rs/0
{ "file_path": "candle/candle-nn/tests/loss.rs", "repo_id": "candle", "token_count": 1344 }
55
from .module import Module from typing import Optional, Tuple, Any from candle import Tensor import candle class Embedding(Module): """A simple lookup table that stores embeddings of a fixed dictionary and size. This module is often used to store word embeddings and retrieve them using indices. The input...
candle/candle-pyo3/py_src/candle/nn/sparse.py/0
{ "file_path": "candle/candle-pyo3/py_src/candle/nn/sparse.py", "repo_id": "candle", "token_count": 590 }
56
//! Implementation of BLIP text encoder/decoder. //! //! - 📝 [Paper](https://arxiv.org/abs/2201.12086). BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation" //! //! - ⚡ [Interactive Wasm Example](https://huggingface.co/spaces/radames/Candle-BLIP-Image-Captioning) //...
candle/candle-transformers/src/models/blip_text.rs/0
{ "file_path": "candle/candle-transformers/src/models/blip_text.rs", "repo_id": "candle", "token_count": 7345 }
57
//! Implementation of the Depth Anything model from FAIR. //! //! See: //! - ["Depth Anything: Unleashing the Power of Large-Scale Unlabeled Data"](https://github.com/LiheYoung/Depth-Anything) //! use std::sync::Arc; use candle::D::Minus1; use candle::{Module, Result, Tensor}; use candle_nn::ops::Identity; use candle...
candle/candle-transformers/src/models/depth_anything_v2.rs/0
{ "file_path": "candle/candle-transformers/src/models/depth_anything_v2.rs", "repo_id": "candle", "token_count": 9268 }
58