text
stringlengths
5
631k
id
stringlengths
14
178
metadata
dict
__index_level_0__
int64
0
647
# 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/swinv2/test_modeling_swinv2.py/0
{ "file_path": "transformers/tests/models/swinv2/test_modeling_swinv2.py", "repo_id": "transformers", "token_count": 9462 }
613
# Copyright 2023 The Intel Team Authors, 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 # #...
transformers/tests/models/tvp/test_modeling_tvp.py/0
{ "file_path": "transformers/tests/models/tvp/test_modeling_tvp.py", "repo_id": "transformers", "token_count": 5911 }
614
# 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/vitpose/test_modeling_vitpose.py/0
{ "file_path": "transformers/tests/models/vitpose/test_modeling_vitpose.py", "repo_id": "transformers", "token_count": 5525 }
615
# Copyright 2021 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/wav2vec2/test_processing_wav2vec2.py/0
{ "file_path": "transformers/tests/models/wav2vec2/test_processing_wav2vec2.py", "repo_id": "transformers", "token_count": 2838 }
616
# 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/whisper/test_processing_whisper.py/0
{ "file_path": "transformers/tests/models/whisper/test_processing_whisper.py", "repo_id": "transformers", "token_count": 10043 }
617
# 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/zamba2/test_modeling_zamba2.py/0
{ "file_path": "transformers/tests/models/zamba2/test_modeling_zamba2.py", "repo_id": "transformers", "token_count": 14984 }
618
# 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/pipelines/test_pipelines_image_feature_extraction.py/0
{ "file_path": "transformers/tests/pipelines/test_pipelines_image_feature_extraction.py", "repo_id": "transformers", "token_count": 2384 }
619
# 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_video_classification.py/0
{ "file_path": "transformers/tests/pipelines/test_pipelines_video_classification.py", "repo_id": "transformers", "token_count": 2024 }
620
# 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_4bit.py/0
{ "file_path": "transformers/tests/quantization/bnb/test_4bit.py", "repo_id": "transformers", "token_count": 14869 }
621
# 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/quantization/gptq/test_gptq.py/0
{ "file_path": "transformers/tests/quantization/gptq/test_gptq.py", "repo_id": "transformers", "token_count": 8880 }
622
import os import sys import unittest ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) sys.path.append(os.path.join(ROOT_DIR, "utils")) import create_dependency_mapping # noqa: E402 # This is equivalent to `all` in the current library state (as of 09/01/2025) MODEL_ROOT = os....
transformers/tests/repo_utils/modular/test_conversion_order.py/0
{ "file_path": "transformers/tests/repo_utils/modular/test_conversion_order.py", "repo_id": "transformers", "token_count": 1690 }
623
# 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/tensor_parallel/test_tensor_parallel.py/0
{ "file_path": "transformers/tests/tensor_parallel/test_tensor_parallel.py", "repo_id": "transformers", "token_count": 6028 }
624
# 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/tokenization/test_tokenization_fast.py/0
{ "file_path": "transformers/tests/tokenization/test_tokenization_fast.py", "repo_id": "transformers", "token_count": 5894 }
625
# 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/utils/test_dynamic_module_utils.py/0
{ "file_path": "transformers/tests/utils/test_dynamic_module_utils.py", "repo_id": "transformers", "token_count": 918 }
626
# 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/utils/test_modeling_rope_utils.py/0
{ "file_path": "transformers/tests/utils/test_modeling_rope_utils.py", "repo_id": "transformers", "token_count": 10355 }
627
# 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_docstrings.py/0
{ "file_path": "transformers/utils/check_docstrings.py", "repo_id": "transformers", "token_count": 25528 }
628
"""Script for downloading all GLUE data. Original source: https://gist.github.com/W4ngatang/60c2bdb54d156a41194446737ce03e2e Note: for legal reasons, we are unable to host MRPC. You can either use the version hosted by the SentEval team, which is already tokenized, or you can download the original data from (https://d...
transformers/utils/download_glue_data.py/0
{ "file_path": "transformers/utils/download_glue_data.py", "repo_id": "transformers", "token_count": 3943 }
629
# 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/utils/notification_service_doc_tests.py/0
{ "file_path": "transformers/utils/notification_service_doc_tests.py", "repo_id": "transformers", "token_count": 6464 }
630
from transformers import PretrainedConfig class CustomConfig(PretrainedConfig): model_type = "custom" def __init__(self, attribute=1, **kwargs): self.attribute = attribute super().__init__(**kwargs)
transformers/utils/test_module/custom_configuration.py/0
{ "file_path": "transformers/utils/test_module/custom_configuration.py", "repo_id": "transformers", "token_count": 80 }
631
include LICENSE include CONTRIBUTING.md include README.md recursive-exclude * __pycache__ include trl/templates/*.md include trl/accelerate_configs/*.yaml
trl/MANIFEST.in/0
{ "file_path": "trl/MANIFEST.in", "repo_id": "trl", "token_count": 53 }
632
# Data Utilities ## prepare_multimodal_messages [[autodoc]] prepare_multimodal_messages ## is_conversational [[autodoc]] is_conversational ## is_conversational_from_value [[autodoc]] is_conversational_from_value ## apply_chat_template [[autodoc]] apply_chat_template ## maybe_apply_chat_template [[autodoc]] ma...
trl/docs/source/data_utils.md/0
{ "file_path": "trl/docs/source/data_utils.md", "repo_id": "trl", "token_count": 296 }
633
# Liger Kernel Integration <Tip warning={true}> Section under construction. Feel free to contribute! </Tip> [Liger Kernel](https://github.com/linkedin/Liger-Kernel) is a collection of Triton kernels designed specifically for LLM training. It can effectively increase multi-GPU training throughput by 20% and reduce m...
trl/docs/source/liger_kernel_integration.md/0
{ "file_path": "trl/docs/source/liger_kernel_integration.md", "repo_id": "trl", "token_count": 513 }
634
# Reward Functions This module contains some useful reward functions, primarily intended for use with the [`GRPOTrainer`]. ## Format rewards ### think_format_reward [[autodoc]] rewards.think_format_reward ## Other rewards ### get_soft_overlong_punishment [[autodoc]] rewards.get_soft_overlong_punishment
trl/docs/source/rewards.md/0
{ "file_path": "trl/docs/source/rewards.md", "repo_id": "trl", "token_count": 93 }
635
# Requires accelerate 1.7.0 or higher compute_environment: LOCAL_MACHINE debug: false distributed_type: FSDP downcast_bf16: 'no' enable_cpu_affinity: false fsdp_config: fsdp_activation_checkpointing: false fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP fsdp_cpu_ram_efficient_loading: true fsdp_offload_params: fa...
trl/examples/accelerate_configs/fsdp2.yaml/0
{ "file_path": "trl/examples/accelerate_configs/fsdp2.yaml", "repo_id": "trl", "token_count": 248 }
636
<jupyter_start><jupyter_text>**Best-of-n sampling as an alternative to RLHF**This notebook compares reward-model scores of prompt based responses from 1. a base model (`gpt2-imdb`)2. `RLHF` tuned model based on this base-model 3. the base-model again from which we sample n responses to each prompt, score them and take ...
trl/examples/notebooks/best_of_n.ipynb/0
{ "file_path": "trl/examples/notebooks/best_of_n.ipynb", "repo_id": "trl", "token_count": 1998 }
637
# 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/gspo_vlm.py/0
{ "file_path": "trl/examples/scripts/gspo_vlm.py", "repo_id": "trl", "token_count": 2986 }
638
# 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/sft_vlm_gemma3.py/0
{ "file_path": "trl/examples/scripts/sft_vlm_gemma3.py", "repo_id": "trl", "token_count": 2727 }
639
{%- if tools %} {{- '<|im_start|>system\n' }} {%- if messages[0].role == 'system' %} {{- messages[0].content + '\n\n' }} {%- endif %} {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<...
trl/tests/data/template.jinja/0
{ "file_path": "trl/tests/data/template.jinja", "repo_id": "trl", "token_count": 2029 }
640
# 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_data_utils.py/0
{ "file_path": "trl/tests/test_data_utils.py", "repo_id": "trl", "token_count": 18808 }
641
# 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_prm_trainer.py/0
{ "file_path": "trl/tests/test_prm_trainer.py", "repo_id": "trl", "token_count": 7464 }
642
compute_environment: LOCAL_MACHINE debug: false distributed_type: "NO" downcast_bf16: 'no' gpu_ids: all machine_rank: 0 main_training_function: main mixed_precision: 'bf16' num_machines: 1 num_processes: 8 rdzv_backend: static same_network: true tpu_env: [] tpu_use_cluster: false tpu_use_sudo: false use_cpu: false
trl/trl/accelerate_configs/single_gpu.yaml/0
{ "file_path": "trl/trl/accelerate_configs/single_gpu.yaml", "repo_id": "trl", "token_count": 128 }
643
# 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/auxiliary_modules.py/0
{ "file_path": "trl/trl/models/auxiliary_modules.py", "repo_id": "trl", "token_count": 1380 }
644
# 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/utils.py/0
{ "file_path": "trl/trl/scripts/utils.py", "repo_id": "trl", "token_count": 7267 }
645
# 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/gkd_trainer.py/0
{ "file_path": "trl/trl/trainer/gkd_trainer.py", "repo_id": "trl", "token_count": 6674 }
646
# 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/ppo_trainer.py/0
{ "file_path": "trl/trl/trainer/ppo_trainer.py", "repo_id": "trl", "token_count": 19773 }
647
# Introduction ![Bonus Unit 1 Thumbnail](https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/bonus-unit1/thumbnail.jpg) Welcome to this first **Bonus Unit**, where you'll learn to **fine-tune a Large Language Model (LLM) for function calling**. In terms of LLMs, function calling is quickly be...
agents-course/units/en/bonus-unit1/introduction.mdx/0
{ "file_path": "agents-course/units/en/bonus-unit1/introduction.mdx", "repo_id": "agents-course", "token_count": 773 }
0
# Table of Contents You can access Unit 1 on hf.co/learn 👉 <a href="https://hf.co/learn/agents-course/unit1/introduction">here</a> <!-- | Title | Description | |-------|-------------| | [Definition of an Agent](1_definition_of_an_agent.md) | General example of what agents can do without technical jargon. | | [Expla...
agents-course/units/en/unit1/README.md/0
{ "file_path": "agents-course/units/en/unit1/README.md", "repo_id": "agents-course", "token_count": 420 }
1
# Introduction to Agentic Frameworks <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/thumbnail.jpg" alt="Thumbnail"/> Welcome to this second unit, where **we'll explore different agentic frameworks** that can be used to build powerful agentic applications. We will study: ...
agents-course/units/en/unit2/introduction.mdx/0
{ "file_path": "agents-course/units/en/unit2/introduction.mdx", "repo_id": "agents-course", "token_count": 780 }
2
# Using Tools in LlamaIndex **Defining a clear set of Tools is crucial to performance.** As we discussed in [unit 1](../../unit1/tools), clear tool interfaces are easier for LLMs to use. Much like a software API interface for human engineers, they can get more out of the tool if it's easy to understand how it works. ...
agents-course/units/en/unit2/llama-index/tools.mdx/0
{ "file_path": "agents-course/units/en/unit2/llama-index/tools.mdx", "repo_id": "agents-course", "token_count": 2037 }
3
# Agentic Retrieval Augmented Generation (RAG) In this unit, we'll be taking a look at how we can use Agentic RAG to help Alfred prepare for the amazing gala. <Tip>We know we've already discussed Retrieval Augmented Generation (RAG) and agentic RAG in the previous unit, so feel free to skip ahead if you're already fa...
agents-course/units/en/unit3/agentic-rag/agentic-rag.mdx/0
{ "file_path": "agents-course/units/en/unit3/agentic-rag/agentic-rag.mdx", "repo_id": "agents-course", "token_count": 474 }
4
# Observabilidad y Evaluación de Agentes de IA ![Bonus Unit 2 Thumbnail](https://langfuse.com/images/cookbook/huggingface-agent-course/agent-observability-and-evaluation.png) ¡Bienvenido a la **Unidad Extra 2**! En este capítulo, explorarás estrategias avanzadas para observar, evaluar y, en última instancia, mejorar ...
agents-course/units/es/bonus-unit2/introduction.mdx/0
{ "file_path": "agents-course/units/es/bonus-unit2/introduction.mdx", "repo_id": "agents-course", "token_count": 729 }
5
# Entendiendo los Agentes de IA a través del Ciclo Pensamiento-Acción-Observación <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-check-3.jpg" alt="Planificación de la Unidad 1"/> En las secciones anteriores, aprendimos: - **Cómo las herramientas se ponen a disp...
agents-course/units/es/unit1/agent-steps-and-structure.mdx/0
{ "file_path": "agents-course/units/es/unit1/agent-steps-and-structure.mdx", "repo_id": "agents-course", "token_count": 2625 }
6
# Conclusión ¡Felicidades por terminar el módulo de `LangGraph` de esta segunda Unidad! 🥳 Ahora has dominado los fundamentos para construir flujos de trabajo estructurados con LangGraph que podrás llevar a producción. Este módulo es solo el comienzo de tu viaje con LangGraph. Para temas más avanzados, recomendamos:...
agents-course/units/es/unit2/langgraph/conclusion.mdx/0
{ "file_path": "agents-course/units/es/unit2/langgraph/conclusion.mdx", "repo_id": "agents-course", "token_count": 420 }
7
<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/code_agents.ipynb"}, ]} /> # Construcción de Agentes que Usan Código Los a...
agents-course/units/es/unit2/smolagents/code_agents.mdx/0
{ "file_path": "agents-course/units/es/unit2/smolagents/code_agents.mdx", "repo_id": "agents-course", "token_count": 7738 }
8
# Introducción al Caso de Uso para RAG Agéntico ![Banner de RAG Agéntico](https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit3/agentic-rag/thumbnail.jpg) En esta unidad, ayudaremos a Alfred, nuestro amigable agente que está organizando la gala, utilizando RAG Agéntico para crear una herra...
agents-course/units/es/unit3/agentic-rag/introduction.mdx/0
{ "file_path": "agents-course/units/es/unit3/agentic-rag/introduction.mdx", "repo_id": "agents-course", "token_count": 1191 }
9
<CourseFloatingBanner chapter={2} classNames="absolute z-10 right-0 top-0" notebooks={[ {label: "Google Colab", value: "https://colab.research.google.com/#fileId=https%3A//huggingface.co/agents-course/notebooks/blob/main/fr/bonus-unit2/monitoring-and-evaluating-agents.ipynb"}, ]} /> # Observer et évaluer des a...
agents-course/units/fr/bonus-unit2/monitoring-and-evaluating-agents-notebook.mdx/0
{ "file_path": "agents-course/units/fr/bonus-unit2/monitoring-and-evaluating-agents-notebook.mdx", "repo_id": "agents-course", "token_count": 7618 }
10
# Conclusion [[conclusion]] Félicitations pour avoir terminé cette première Unité 🥳 Vous **maîtrisez les fondamentaux** et avez créé votre premier agent ! Il est **normal que vous soyez encore un peu confus par certains éléments**. Les agents sont un sujet complexe et il est courant de mettre un certain temps à tou...
agents-course/units/fr/unit1/conclusion.mdx/0
{ "file_path": "agents-course/units/fr/unit1/conclusion.mdx", "repo_id": "agents-course", "token_count": 513 }
11
# Graphe d'analyse de documents Alfred à votre service. En tant que majordome de confiance de M. Wayne, j'ai pris la liberté de documenter comment j'aide M. Wayne avec ses divers besoins documentaires. Pendant qu'il s'occupe de ses... activités nocturnes, je m'assure que tous ses papiers, programmes d'entraînement et ...
agents-course/units/fr/unit2/langgraph/document_analysis_agent.mdx/0
{ "file_path": "agents-course/units/fr/unit2/langgraph/document_analysis_agent.mdx", "repo_id": "agents-course", "token_count": 4065 }
12
# Conclusion Félicitations d'avoir terminé le module `smolagents` de cette deuxième unité 🥳 Vous **maîtrisez les fondamentaux** de `smolagents` et vous avez construit votre propre agent ! A présent que vous avez des compétences sur `smolagents`, vous pouvez maintenant commencer à créer des agents qui résoudront des ...
agents-course/units/fr/unit2/smolagents/conclusion.mdx/0
{ "file_path": "agents-course/units/fr/unit2/smolagents/conclusion.mdx", "repo_id": "agents-course", "token_count": 305 }
13
# Création d'un RAG pour converser avec les invités Alfred, votre agent de confiance, se prépare pour le gala le plus extravagant du siècle. Pour s'assurer que l'événement se déroule sans encombre, il a besoin d'un accès rapide à des informations à jour sur chaque invité. Aidons le en créant un outil RAG alimenté par ...
agents-course/units/fr/unit3/agentic-rag/invitees.mdx/0
{ "file_path": "agents-course/units/fr/unit3/agentic-rag/invitees.mdx", "repo_id": "agents-course", "token_count": 7170 }
14
# 더미 에이전트 라이브러리 [[dummy-agent-library]] <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-unit1sub3DONE.jpg" alt="Unit 1 planning"/> 이 코스는 특정 프레임워크에 종속되지 않도록 설계되었습니다. 그 이유는 **AI 에이전트의 개념에 집중하고 특정 프레임워크의 세부 사항에 매몰되지 않기 위함입니다**. 또한, 학생들이 이 강의에서 배운 개념을 원하는 프레임워크를 사용해...
agents-course/units/ko/unit1/dummy-agent-library.mdx/0
{ "file_path": "agents-course/units/ko/unit1/dummy-agent-library.mdx", "repo_id": "agents-course", "token_count": 6652 }
15
# Что такое вызов функции? Вызов функций - это **способ, с помощью которого LLM может выполнять действия в своем окружении**. Впервые он был [введен в GPT-4](https://openai.com/index/function-calling-and-other-api-updates/), и затем был воспроизведен в других моделях. Как и инструменты агента, вызов функций дает моде...
agents-course/units/ru-RU/bonus-unit1/what-is-function-calling.mdx/0
{ "file_path": "agents-course/units/ru-RU/bonus-unit1/what-is-function-calling.mdx", "repo_id": "agents-course", "token_count": 3361 }
16
# Небольшой тест (не оценивается) [[quiz1]] До этого момента вы понимали общую картину Агентов, что они собой представляют и как работают. Пришло время провести небольшой тест, поскольку **проверка себя** - это лучший способ учиться и [избежать иллюзии компетентности](https://www.coursera.org/lecture/learning-how-to-...
agents-course/units/ru-RU/unit1/quiz1.mdx/0
{ "file_path": "agents-course/units/ru-RU/unit1/quiz1.mdx", "repo_id": "agents-course", "token_count": 6529 }
17
# Làm quen: Những bước đầu tiên ⛵ <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit0/time-to-onboard.jpg" alt="Đến lúc làm quen" width="100%"/> Giờ bạn đã nắm rõ thông tin, hãy bắt đầu thôi! Chúng mình sẽ thực hiện 4 bước sau: 1. **Tạo tài khoản Hugging Face** nếu chưa có 2. ...
agents-course/units/vi/unit0/onboarding.mdx/0
{ "file_path": "agents-course/units/vi/unit0/onboarding.mdx", "repo_id": "agents-course", "token_count": 1752 }
18
# 启航准备:开启学习之旅 ⛵ <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit0/time-to-onboard.jpg" alt="启程时刻" width="100%"/> 万事俱备,即刻启程!请完成以下四个步骤: 1. **注册 Hugging Face 账户**(如未完成) 2. **加入 Discord 社区并自我介绍**(无需拘谨 🤗) 3. **在 Hub 平台关注智能体课程** 4. **助力课程推广** ### 步骤一:创建 Hugging Face 账户 (如未注册)请点...
agents-course/units/zh-CN/unit0/onboarding.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit0/onboarding.mdx", "repo_id": "agents-course", "token_count": 2404 }
19
# 什么是大语言模型(LLMs)? <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-check-1.jpg" alt="Unit 1 planning"/> 在上一节中,我们了解到每个智能体都需要一个核心的人工智能模型,而大语言模型 (LLM) 是实现这一目标最常见的 AI 模型类型。 现在,我们将学习什么是大语言模型,以及它们如何为智能体提供动力。 本节将提供一个简洁的技术解释,说明大语言模型的用途。如果你想更深入地了解相关内容,可以参考我们的 <a href="ht...
agents-course/units/zh-CN/unit1/what-are-llms.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit1/what-are-llms.mdx", "repo_id": "agents-course", "token_count": 7759 }
20
# 快速自测(不计分)[[quiz2]] 什么?!又是测验?我们知道,我们知道...😅但这个简短的不计分测验是为了**帮助您巩固刚学到的关键概念**。 本测验涵盖智能体工作流程和交互——这些是构建高效AI智能体的核心组件。 ### Q1: AgentWorkflow 在 LlamaIndex 中的主要作用是什么? <Question choices={[ { text: "运行一个或多个带有工具的智能体", explain: "正确,AgentWorkflow 是快速创建包含一个或多个智能体的系统的主要方式。", correct: true }, { text: "创建没有记忆功能的单一数据查询智能体", explain:...
agents-course/units/zh-CN/unit2/llama-index/quiz2.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit2/llama-index/quiz2.mdx", "repo_id": "agents-course", "token_count": 1632 }
21
# 创建你的 Gala 智能体 现在我们已经为 Alfred 构建了所有必要组件,是时候将它们整合成一个完整的智能体来协助举办我们的奢华盛会了。 在本节中,我们将把宾客信息检索、网络搜索、天气信息和 Hub 统计工具整合成一个强大的智能体。 ## 组装 Alfred:完整智能体 我们不需要重新实现之前章节创建的所有工具,只需从保存的tools.py和retriever.py模块中导入它们即可。 <Tip> 如果你尚未实现这些工具,请返回<a href="./tools">工具</a>和<a href="./invitees">检索器</a>章节进行实现,并将它们添加到`tools.py`和`retriever.py`文件中...
agents-course/units/zh-CN/unit3/agentic-rag/agent.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit3/agentic-rag/agent.mdx", "repo_id": "agents-course", "token_count": 8411 }
22
# Creating apps
candle/candle-book/src/apps/README.md/0
{ "file_path": "candle/candle-book/src/apps/README.md", "repo_id": "candle", "token_count": 4 }
23
# Advanced Cuda usage
candle/candle-book/src/inference/cuda/README.md/0
{ "file_path": "candle/candle-book/src/inference/cuda/README.md", "repo_id": "candle", "token_count": 6 }
24
mod benchmarks; use criterion::criterion_main; criterion_main!( benchmarks::affine::benches, benchmarks::copy::benches, benchmarks::conv_transpose2d::benches, benchmarks::matmul::benches, benchmarks::qmatmul::benches, benchmarks::random::benches, benchmarks::reduce::benches, benchmarks...
candle/candle-core/benches/bench_main.rs/0
{ "file_path": "candle/candle-core/benches/bench_main.rs", "repo_id": "candle", "token_count": 138 }
25
//! Traits to Define Backend Behavior //! use crate::op::{BinaryOpT, CmpOp, ReduceOp, UnaryOpT}; use crate::{CpuStorage, DType, Layout, Result, Shape}; pub trait BackendStorage: Sized { type Device: BackendDevice; fn try_clone(&self, _: &Layout) -> Result<Self>; fn dtype(&self) -> DType; fn device(&...
candle/candle-core/src/backend.rs/0
{ "file_path": "candle/candle-core/src/backend.rs", "repo_id": "candle", "token_count": 2241 }
26
/// Helper functions to plug cuda kernels in candle. use crate::{Layout, Result, WithDType}; pub use cudarc; use cudarc::driver::{CudaSlice, DeviceRepr, ValidAsZeroBits}; use super::{CudaDevice, CudaError, WrapErr}; pub type S = super::CudaStorageSlice; pub trait Map1 { fn f<T: DeviceRepr + WithDType + ValidAsZe...
candle/candle-core/src/cuda_backend/utils.rs/0
{ "file_path": "candle/candle-core/src/cuda_backend/utils.rs", "repo_id": "candle", "token_count": 4127 }
27
//! Just enough pickle support to be able to read PyTorch checkpoints. // This hardcodes objects that are required for tensor reading, we may want to make this a bit more // composable/tensor agnostic at some point. use crate::{Context, DType, Error as E, Layout, Result, Tensor}; use byteorder::{LittleEndian, ReadBytes...
candle/candle-core/src/pickle.rs/0
{ "file_path": "candle/candle-core/src/pickle.rs", "repo_id": "candle", "token_count": 14742 }
28
use crate::{Result, Tensor}; use rayon::prelude::*; #[derive(Debug, Clone, Copy)] struct ArgSort { asc: bool, last_dim: usize, } impl ArgSort { fn asort<T: crate::WithDType>(&self, vs: &[T], layout: &crate::Layout) -> Vec<u32> { #[allow(clippy::uninit_vec)] // Safety: indexes are set later...
candle/candle-core/src/sort.rs/0
{ "file_path": "candle/candle-core/src/sort.rs", "repo_id": "candle", "token_count": 4992 }
29
use candle_core::{test_device, DType, Device, IndexOp, Result, Tensor}; fn matmul(device: &Device) -> Result<()> { let data = vec![1.0f32, 2.0, 3.0, 4.0]; let a = Tensor::from_slice(&data, (2, 2), device)?; let data = vec![1.0f32, 2.0, 3.0, 4.0]; let b = Tensor::from_slice(&data, (2, 2), device)?; ...
candle/candle-core/tests/matmul_tests.rs/0
{ "file_path": "candle/candle-core/tests/matmul_tests.rs", "repo_id": "candle", "token_count": 2675 }
30
//! Datasets & Dataloaders for Candle pub mod batcher; pub mod hub; pub mod nlp; pub mod vision; pub use batcher::Batcher;
candle/candle-datasets/src/lib.rs/0
{ "file_path": "candle/candle-datasets/src/lib.rs", "repo_id": "candle", "token_count": 45 }
31
# candle-starcoder: code generation model [StarCoder/BigCode](https://huggingface.co/bigcode/starcoderbase-1b) is a LLM model specialized to code generation. The initial model was trained on 80 programming languages. ## Running some example ```bash cargo run --example bigcode --release -- --prompt "fn fact(n: u64) -...
candle/candle-examples/examples/bigcode/README.md/0
{ "file_path": "candle/candle-examples/examples/bigcode/README.md", "repo_id": "candle", "token_count": 180 }
32
# candle-convnext [A ConvNet for the 2020s](https://arxiv.org/abs/2201.03545) and [ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders](https://arxiv.org/abs/2301.00808). This candle implementation uses a pre-trained ConvNeXt network for inference. The classification head has been trained on the I...
candle/candle-examples/examples/convnext/README.md/0
{ "file_path": "candle/candle-examples/examples/convnext/README.md", "repo_id": "candle", "token_count": 293 }
33
//! Depth Anything V2 //! https://huggingface.co/spaces/depth-anything/Depth-Anything-V2 #[cfg(feature = "accelerate")] extern crate accelerate_src; #[cfg(feature = "mkl")] extern crate intel_mkl_src; use clap::Parser; use std::{ffi::OsString, path::PathBuf, sync::Arc}; use candle::DType::{F32, U8}; use candle::{DTy...
candle/candle-examples/examples/depth_anything_v2/main.rs/0
{ "file_path": "candle/candle-examples/examples/depth_anything_v2/main.rs", "repo_id": "candle", "token_count": 2544 }
34
//! EVA-02: Explore the limits of Visual representation at scAle //! https://github.com/baaivision/EVA #[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, Va...
candle/candle-examples/examples/eva2/main.rs/0
{ "file_path": "candle/candle-examples/examples/eva2/main.rs", "repo_id": "candle", "token_count": 1221 }
35
#[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::qwen2::{Config, Model}; use candle::{DType, Tensor}; use candle_nn::VarBuilder; use hf_hub::{api::sync::Api, Repo, Repo...
candle/candle-examples/examples/gte-qwen/main.rs/0
{ "file_path": "candle/candle-examples/examples/gte-qwen/main.rs", "repo_id": "candle", "token_count": 2613 }
36
pub mod constants; pub mod conversation; pub mod image_processor; use candle_transformers::generation::{LogitsProcessor, Sampling}; use candle_transformers::models::llama::Cache; use anyhow::{bail, Error as E, Result}; use candle::{DType, Device, IndexOp, Tensor}; use candle_nn::VarBuilder; use candle_transformers::m...
candle/candle-examples/examples/llava/main.rs/0
{ "file_path": "candle/candle-examples/examples/llava/main.rs", "repo_id": "candle", "token_count": 5082 }
37
# candle-mistral: 7b LLM with Apache 2.0 licensed weights Mistral-7B-v0.1 is a pretrained generative LLM with 7 billion parameters. It outperforms all the publicly available 13b models as of 2023-09-28. Weights (and the original Python model code) are released under the permissive Apache 2.0 license. - [Blog post](ht...
candle/candle-examples/examples/mistral/README.md/0
{ "file_path": "candle/candle-examples/examples/mistral/README.md", "repo_id": "candle", "token_count": 829 }
38
# candle-musicgen Candle implementation of musicgen from [Simple and Controllable Music Generation](https://arxiv.org/pdf/2306.05284). ## Running an example ```bash $ cargo run --example musicgen -- --prompt "90s rock song with loud guitars and heavy drums" > tokens: [2777, 7, 2480, 2324, 28, 8002, 5507, 7, 11, 243...
candle/candle-examples/examples/musicgen/README.md/0
{ "file_path": "candle/candle-examples/examples/musicgen/README.md", "repo_id": "candle", "token_count": 400 }
39
# candle-parler-tts [Parler-TTS](https://huggingface.co/parler-tts/parler-tts-large-v1) is a large text-to-speech model with 2.2B parameters trained on ~45K hours of audio data. The voice can be controlled by a text prompt. ## Run an example ```bash cargo run --example parler-tts -r -- \ --prompt "Hey, how are you...
candle/candle-examples/examples/parler-tts/README.md/0
{ "file_path": "candle/candle-examples/examples/parler-tts/README.md", "repo_id": "candle", "token_count": 260 }
40
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use std::io::Write; use std::path::PathBuf; use candle_transformers::models::quantized_t5 as t5; use anyhow::{Error as E, Result}; use candle::{Device, Tensor}; use candle_transformers::generation::LogitsP...
candle/candle-examples/examples/quantized-t5/main.rs/0
{ "file_path": "candle/candle-examples/examples/quantized-t5/main.rs", "repo_id": "candle", "token_count": 3631 }
41
# candle-replit-code: code completion specialized model. [replit-code-v1_5-3b](https://huggingface.co/replit/replit-code-v1_5-3b) is a language model specialized for code completion. This model uses 3.3B parameters in `bfloat16` (so the GPU version will only work on recent nvidia cards). ## Running some example ```b...
candle/candle-examples/examples/replit-code/README.md/0
{ "file_path": "candle/candle-examples/examples/replit-code/README.md", "repo_id": "candle", "token_count": 426 }
42
//! SAM: Segment Anything Model //! https://github.com/facebookresearch/segment-anything #[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use candle::DType; use candle_nn::VarBuilder; use candle_transformers::models::segment_anything::sam; use clap::Pars...
candle/candle-examples/examples/segment-anything/main.rs/0
{ "file_path": "candle/candle-examples/examples/segment-anything/main.rs", "repo_id": "candle", "token_count": 3137 }
43
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use candle::{DType, IndexOp, D}; use candle_nn::{ModuleT, VarBuilder}; use candle_transformers::models::vgg::{Models, Vgg}; use clap::{Parser, ValueEnum}; #[derive(Clone, Copy, Debug, ValueEnum)] enum Whic...
candle/candle-examples/examples/vgg/main.rs/0
{ "file_path": "candle/candle-examples/examples/vgg/main.rs", "repo_id": "candle", "token_count": 967 }
44
use candle::{IndexOp, Result, Tensor, D}; use tokenizers::Tokenizer; const LANGUAGES: [(&str, &str); 99] = [ ("en", "english"), ("zh", "chinese"), ("de", "german"), ("es", "spanish"), ("ru", "russian"), ("ko", "korean"), ("fr", "french"), ("ja", "japanese"), ("pt", "portuguese"), ...
candle/candle-examples/examples/whisper/multilingual.rs/0
{ "file_path": "candle/candle-examples/examples/whisper/multilingual.rs", "repo_id": "candle", "token_count": 1846 }
45
/****************************************************************************** * Copyright (c) 2023, Tri Dao. ******************************************************************************/ #pragma once namespace flash { /////////////////////////////////////////////////////////////////////////////////////////////...
candle/candle-flash-attn/kernels/block_info.h/0
{ "file_path": "candle/candle-flash-attn/kernels/block_info.h", "repo_id": "candle", "token_count": 930 }
46
// Inspired by // https://github.com/NVIDIA/DALI/blob/main/include/dali/core/static_switch.h // and https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/Dispatch.h #pragma once /// @param COND - a boolean expression to switch by /// @param CONST_NAME - a name given for the constexpr bool variable. /// @...
candle/candle-flash-attn/kernels/static_switch.h/0
{ "file_path": "candle/candle-flash-attn/kernels/static_switch.h", "repo_id": "candle", "token_count": 2335 }
47
// WARNING: THIS IS ONLY VALID ASSUMING THAT inp IS CONTIGUOUS! // TODO: proper error reporting when ids are larger than v_size. #include "cuda_utils.cuh" #include<stdint.h> template <typename T> __host__ __device__ constexpr T max_value(); template <> __host__ __device__ constexpr int64_t max_value<int64_t>() { ...
candle/candle-kernels/src/indexing.cu/0
{ "file_path": "candle/candle-kernels/src/indexing.cu", "repo_id": "candle", "token_count": 8193 }
48
#include <metal_stdlib> using namespace metal; template <typename T> inline T max_value(); template <> inline int64_t max_value<int64_t>() { return 0x7FFFFFFFFFFFFFFF; } template <> inline uint32_t max_value<uint32_t>() { return 0xFFFFFFFFu; } template <> inline uint8_t max_value<uint8_t>() { return 0xF...
candle/candle-metal-kernels/src/indexing.metal/0
{ "file_path": "candle/candle-metal-kernels/src/indexing.metal", "repo_id": "candle", "token_count": 5472 }
49
use candle_metal_kernels::{call_affine, Kernels}; use metal::objc::rc::autoreleasepool; use metal::{Device, MTLResourceOptions}; use rand; use std::any::type_name; use std::time::Instant; fn main() { let device = Device::system_default().unwrap(); let kernels = Kernels::new(); let f32_1k = (0..1000).map(|...
candle/candle-metal-kernels/tmp/affine.rs/0
{ "file_path": "candle/candle-metal-kernels/tmp/affine.rs", "repo_id": "candle", "token_count": 1154 }
50
//! Embedding Layer. use candle::{Result, Tensor}; #[derive(Clone, Debug)] pub struct Embedding { embeddings: Tensor, hidden_size: usize, } impl Embedding { pub fn new(embeddings: Tensor, hidden_size: usize) -> Self { Self { embeddings, hidden_size, } } pub...
candle/candle-nn/src/embedding.rs/0
{ "file_path": "candle/candle-nn/src/embedding.rs", "repo_id": "candle", "token_count": 571 }
51
//! A `VarBuilder` for variable retrieval from models //! //! A `VarBuilder` is used to retrieve variables used by a model. These variables can either come //! from a pre-trained checkpoint, e.g. using `VarBuilder::from_mmaped_safetensors`, or initialized //! for training, e.g. using `VarBuilder::from_varmap`. use crat...
candle/candle-nn/src/var_builder.rs/0
{ "file_path": "candle/candle-nn/src/var_builder.rs", "repo_id": "candle", "token_count": 11054 }
52
use candle::Result; use prost::Message; pub mod onnx { include!(concat!(env!("OUT_DIR"), "/onnx.rs")); } pub mod eval; pub use eval::{dtype, simple_eval}; pub fn read_file<P: AsRef<std::path::Path>>(p: P) -> Result<onnx::ModelProto> { let buf = std::fs::read(p)?; onnx::ModelProto::decode(buf.as_slice())....
candle/candle-onnx/src/lib.rs/0
{ "file_path": "candle/candle-onnx/src/lib.rs", "repo_id": "candle", "token_count": 154 }
53
from .module import Module from .container import Sequential, ModuleList, ModuleDict from .sparse import Embedding from .normalization import LayerNorm from .linear import Linear
candle/candle-pyo3/py_src/candle/nn/__init__.py/0
{ "file_path": "candle/candle-pyo3/py_src/candle/nn/__init__.py", "repo_id": "candle", "token_count": 43 }
54
use std::collections::HashMap; use crate::utils::wrap_err; use crate::{PyDType, PyTensor}; use candle_onnx::eval::{dtype, get_tensor, simple_eval}; use candle_onnx::onnx::tensor_proto::DataType; use candle_onnx::onnx::tensor_shape_proto::dimension::Value; use candle_onnx::onnx::type_proto::{Tensor as ONNXTensor, Value...
candle/candle-pyo3/src/onnx.rs/0
{ "file_path": "candle/candle-pyo3/src/onnx.rs", "repo_id": "candle", "token_count": 3268 }
55
pub mod generation; pub mod models; pub mod object_detection; pub mod pipelines; pub mod quantized_nn; pub mod quantized_var_builder; pub mod utils;
candle/candle-transformers/src/lib.rs/0
{ "file_path": "candle/candle-transformers/src/lib.rs", "repo_id": "candle", "token_count": 47 }
56
//! ConvMixer implementation. //! //! See "Patches Are All You Need?" by Trockman et al. 2022 //! //! - 📝 [Arxiv](https://arxiv.org/abs/2201.09792) //! - 💻 [Github](https://github.com/locuslab/convmixer) //! use candle::Result; use candle_nn::{batch_norm, Conv2dConfig, Module, VarBuilder}; #[allow(clippy::many_singl...
candle/candle-transformers/src/models/convmixer.rs/0
{ "file_path": "candle/candle-transformers/src/models/convmixer.rs", "repo_id": "candle", "token_count": 1504 }
57
use candle::{Result, Tensor, D}; use candle_nn::{conv2d, group_norm, Conv2d, GroupNorm, VarBuilder}; // https://github.com/black-forest-labs/flux/blob/727e3a71faf37390f318cf9434f0939653302b60/src/flux/modules/autoencoder.py#L9 #[derive(Debug, Clone)] pub struct Config { pub resolution: usize, pub in_channels: ...
candle/candle-transformers/src/models/flux/autoencoder.rs/0
{ "file_path": "candle/candle-transformers/src/models/flux/autoencoder.rs", "repo_id": "candle", "token_count": 7145 }
58
//! Llama2 inference implementation. //! //! See ["LLaMA 2: Open Foundation and Fine-Tuned Chat Models"](https://arxiv.org/abs/2307.09288) //! //! Based on the [llama2.c](https://github.com/karpathy/llama2.c) implementation use byteorder::{LittleEndian, ReadBytesExt}; use candle::{DType, Device, IndexOp, Result, Shape...
candle/candle-transformers/src/models/llama2_c_weights.rs/0
{ "file_path": "candle/candle-transformers/src/models/llama2_c_weights.rs", "repo_id": "candle", "token_count": 3405 }
59
use candle::{Module, Result, Tensor, D}; use candle_nn as nn; use super::projections::{AttnProjections, Mlp, Qkv, QkvOnlyAttnProjections}; pub struct ModulateIntermediates { gate_msa: Tensor, shift_mlp: Tensor, scale_mlp: Tensor, gate_mlp: Tensor, } pub struct DiTBlock { norm1: LayerNormNoAffine,...
candle/candle-transformers/src/models/mmdit/blocks.rs/0
{ "file_path": "candle/candle-transformers/src/models/mmdit/blocks.rs", "repo_id": "candle", "token_count": 8057 }
60
//! Quantized MetaVoice model implementation. //! //! MetaVoice is a conditional text-to-speech model based on a transformer architecture. //! This implementation provides quantization for reduced memory and compute. //! //! Key characteristics: //! - Transformer-based autoregressive decoder //! - Speaker conditioning ...
candle/candle-transformers/src/models/quantized_metavoice.rs/0
{ "file_path": "candle/candle-transformers/src/models/quantized_metavoice.rs", "repo_id": "candle", "token_count": 5192 }
61
use crate::{ models::with_tracing::{linear_b, linear_no_bias, Linear, RmsNorm}, utils::repeat_kv, }; use candle::{DType, Device, Module, Result, Tensor}; use candle_nn::{kv_cache::KvCache, Activation, VarBuilder}; use std::sync::Arc; #[derive(Debug, Clone, PartialEq, serde::Deserialize)] pub struct Config { ...
candle/candle-transformers/src/models/qwen3.rs/0
{ "file_path": "candle/candle-transformers/src/models/qwen3.rs", "repo_id": "candle", "token_count": 6411 }
62
#![allow(unused)] //! Implementation of the Multi-Scale Neural Audio Codec (SNAC) //! //! See: [SNAC](https://github.com/hubertsiuzdak/snac) //! /// Multi-Scale Neural Audio Codec (SNAC) compresses audio into discrete codes at a low bitrate. /// For more information, read the paper: https://arxiv.org/abs/2410.14411 ///...
candle/candle-transformers/src/models/snac.rs/0
{ "file_path": "candle/candle-transformers/src/models/snac.rs", "repo_id": "candle", "token_count": 12742 }
63
use candle::{DType, Module, Result, Tensor, D}; use candle_nn::VarBuilder; // https://github.com/huggingface/diffusers/blob/19edca82f1ff194c07317369a92b470dbae97f34/src/diffusers/pipelines/wuerstchen/modeling_wuerstchen_common.py#L22 #[derive(Debug)] pub struct WLayerNorm { eps: f64, } impl WLayerNorm { pub f...
candle/candle-transformers/src/models/wuerstchen/common.rs/0
{ "file_path": "candle/candle-transformers/src/models/wuerstchen/common.rs", "repo_id": "candle", "token_count": 3219 }
64