text stringlengths 5 424k | id stringlengths 13 178 | metadata dict | __index_level_0__ int64 0 672 |
|---|---|---|---|
# 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_common.py/0 | {
"file_path": "transformers/tests/pipelines/test_pipelines_common.py",
"repo_id": "transformers",
"token_count": 16509
} | 610 |
# 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_table_question_answering.py/0 | {
"file_path": "transformers/tests/pipelines/test_pipelines_table_question_answering.py",
"repo_id": "transformers",
"token_count": 7888
} | 611 |
# 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/autoawq/test_awq.py/0 | {
"file_path": "transformers/tests/quantization/autoawq/test_awq.py",
"repo_id": "transformers",
"token_count": 9306
} | 612 |
# Copyright 2025 Advanced Micro Devices, Inc. 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/quantization/quark_integration/test_quark.py/0 | {
"file_path": "transformers/tests/quantization/quark_integration/test_quark.py",
"repo_id": "transformers",
"token_count": 2323
} | 613 |
import json
import logging
import os
import subprocess
from argparse import ArgumentParser
logger = logging.getLogger(__name__)
def parse_args():
parser = ArgumentParser()
parsed, unknown = parser.parse_known_args()
for arg in unknown:
if arg.startswith(("-", "--")):
parser.add_argum... | transformers/tests/sagemaker/scripts/pytorch/run_ddp.py/0 | {
"file_path": "transformers/tests/sagemaker/scripts/pytorch/run_ddp.py",
"repo_id": "transformers",
"token_count": 694
} | 614 |
# 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/test_sequence_feature_extraction_common.py/0 | {
"file_path": "transformers/tests/test_sequence_feature_extraction_common.py",
"repo_id": "transformers",
"token_count": 7322
} | 615 |
# 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/trainer/test_trainer_seq2seq.py/0 | {
"file_path": "transformers/tests/trainer/test_trainer_seq2seq.py",
"repo_id": "transformers",
"token_count": 3777
} | 616 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/tests/utils/test_chat_template_utils.py/0 | {
"file_path": "transformers/tests/utils/test_chat_template_utils.py",
"repo_id": "transformers",
"token_count": 8910
} | 617 |
import sys
from transformers.testing_utils import run_test_using_subprocess
from transformers.utils.import_utils import clear_import_cache
@run_test_using_subprocess
def test_clear_import_cache():
"""Test the clear_import_cache function."""
# Save initial state
initial_modules = {name: mod for name, mod... | transformers/tests/utils/test_import_utils.py/0 | {
"file_path": "transformers/tests/utils/test_import_utils.py",
"repo_id": "transformers",
"token_count": 303
} | 618 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... | transformers/utils/check_bad_commit.py/0 | {
"file_path": "transformers/utils/check_bad_commit.py",
"repo_id": "transformers",
"token_count": 3137
} | 619 |
# 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/compare_test_runs.py/0 | {
"file_path": "transformers/utils/compare_test_runs.py",
"repo_id": "transformers",
"token_count": 1348
} | 620 |
# List here the models to always test.
IMPORTANT_MODELS = [
"auto",
"bert",
"gpt2",
"t5",
"modernbert",
"vit",
"clip",
"detr",
"table_transformer",
"got_ocr2",
"whisper",
"wav2vec2",
"qwen2_audio",
"speech_t5",
"csm",
"llama",
"gemma3",
"qwen2",
... | transformers/utils/important_files.py/0 | {
"file_path": "transformers/utils/important_files.py",
"repo_id": "transformers",
"token_count": 259
} | 621 |
# coding=utf-8
# Copyright 2021 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/update_metadata.py/0 | {
"file_path": "transformers/utils/update_metadata.py",
"repo_id": "transformers",
"token_count": 5818
} | 622 |
cff-version: 1.2.0
title: 'TRL: Transformer Reinforcement Learning'
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Leandro
family-names: von Werra
- given-names: Younes
family-names: Belkada
- given-names: Lewis
family... | trl/CITATION.cff/0 | {
"file_path": "trl/CITATION.cff",
"repo_id": "trl",
"token_count": 371
} | 623 |
# Callbacks
## SyncRefModelCallback
[[autodoc]] SyncRefModelCallback
## RichProgressCallback
[[autodoc]] RichProgressCallback
## WinRateCallback
[[autodoc]] WinRateCallback
## LogCompletionsCallback
[[autodoc]] LogCompletionsCallback
## MergeModelCallback
[[autodoc]] MergeModelCallback
## BEMACallback
[[aut... | trl/docs/source/callbacks.md/0 | {
"file_path": "trl/docs/source/callbacks.md",
"repo_id": "trl",
"token_count": 126
} | 624 |
<div style="text-align: center">
<img src="https://huggingface.co/datasets/trl-lib/documentation-images/resolve/main/trl_banner_dark.png">
</div>
# TRL - Transformer Reinforcement Learning
TRL is a full stack library where we provide a set of tools to train transformer language models with methods like Supervised Fin... | trl/docs/source/index.md/0 | {
"file_path": "trl/docs/source/index.md",
"repo_id": "trl",
"token_count": 2548
} | 625 |
# Examples of using peft with trl to finetune 8-bit models with Low Rank Adaption (LoRA)
The notebooks and scripts in these examples show how to use Low Rank Adaptation (LoRA) to fine-tune models in a memory efficient manner. Most of PEFT methods supported in peft library but note that some PEFT methods such as Prompt... | trl/docs/source/peft_integration.md/0 | {
"file_path": "trl/docs/source/peft_integration.md",
"repo_id": "trl",
"token_count": 2079
} | 626 |
# vLLM Integration
This document will guide you through the process of using vLLM with TRL for faster generation in online methods like GRPO and Online DPO. We first summarize a tl;dr on how to use vLLM with TRL, and then we will go into the details of how it works under the hood. Let's go! 🔥
<Tip warning={true}>
T... | trl/docs/source/vllm_integration.md/0 | {
"file_path": "trl/docs/source/vllm_integration.md",
"repo_id": "trl",
"token_count": 4468
} | 627 |
# 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/math_shepherd.py/0 | {
"file_path": "trl/examples/datasets/math_shepherd.py",
"repo_id": "trl",
"token_count": 2318
} | 628 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/examples/research_projects/layer_skip/scripts/layer_skip_sft.py/0 | {
"file_path": "trl/examples/research_projects/layer_skip/scripts/layer_skip_sft.py",
"repo_id": "trl",
"token_count": 1277
} | 629 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/examples/scripts/dpo_vlm.py/0 | {
"file_path": "trl/examples/scripts/dpo_vlm.py",
"repo_id": "trl",
"token_count": 2383
} | 630 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/examples/scripts/rloo.py/0 | {
"file_path": "trl/examples/scripts/rloo.py",
"repo_id": "trl",
"token_count": 2496
} | 631 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/scripts/generate_zen_image_dataset.py/0 | {
"file_path": "trl/scripts/generate_zen_image_dataset.py",
"repo_id": "trl",
"token_count": 10049
} | 632 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/tests/test_callbacks.py/0 | {
"file_path": "trl/tests/test_callbacks.py",
"repo_id": "trl",
"token_count": 9355
} | 633 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/tests/test_online_dpo_trainer.py/0 | {
"file_path": "trl/tests/test_online_dpo_trainer.py",
"repo_id": "trl",
"token_count": 9925
} | 634 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/trl/__init__.py/0 | {
"file_path": "trl/trl/__init__.py",
"repo_id": "trl",
"token_count": 2568
} | 635 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/trl/experimental/gfpo/gfpo_config.py/0 | {
"file_path": "trl/trl/experimental/gfpo/gfpo_config.py",
"repo_id": "trl",
"token_count": 463
} | 636 |
# Copyright 2020-2025 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | trl/trl/models/modeling_base.py/0 | {
"file_path": "trl/trl/models/modeling_base.py",
"repo_id": "trl",
"token_count": 13829
} | 637 |
---
{{ card_data }}
---
# Model Card for {{ model_name }}
This model is a fine-tuned version of [{{ base_model }}](https://huggingface.co/{{ base_model }}){% if dataset_name %} on the [{{ dataset_name }}](https://huggingface.co/datasets/{{ dataset_name }}) dataset{% endif %}.
It has been trained using [TRL](https://g... | trl/trl/templates/lm_model_card.md/0 | {
"file_path": "trl/trl/templates/lm_model_card.md",
"repo_id": "trl",
"token_count": 753
} | 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/trl/trainer/kto_trainer.py/0 | {
"file_path": "trl/trl/trainer/kto_trainer.py",
"repo_id": "trl",
"token_count": 38067
} | 639 |
# 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/sft_config.py/0 | {
"file_path": "trl/trl/trainer/sft_config.py",
"repo_id": "trl",
"token_count": 4943
} | 640 |
# What is Function Calling?
Function-calling is a **way for an LLM to take actions on its environment**. It was first [introduced in GPT-4](https://openai.com/index/function-calling-and-other-api-updates/), and was later reproduced in other models.
Just like the tools of an Agent, function-calling gives the model the... | agents-course/units/en/bonus-unit1/what-is-function-calling.mdx/0 | {
"file_path": "agents-course/units/en/bonus-unit1/what-is-function-calling.mdx",
"repo_id": "agents-course",
"token_count": 1138
} | 0 |
# Actions: Enabling the Agent to Engage with Its Environment
<Tip>
In this section, we explore the concrete steps an AI agent takes to interact with its environment.
We’ll cover how actions are represented (using JSON or code), the importance of the stop and parse approach, and introduce different types of agents... | agents-course/units/en/unit1/actions.mdx/0 | {
"file_path": "agents-course/units/en/unit1/actions.mdx",
"repo_id": "agents-course",
"token_count": 1912
} | 1 |
# Building Blocks of LangGraph
To build applications with LangGraph, you need to understand its core components. Let's explore the fundamental building blocks that make up a LangGraph application.
<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/LangGraph/Building_blocks.png... | agents-course/units/en/unit2/langgraph/building_blocks.mdx/0 | {
"file_path": "agents-course/units/en/unit2/langgraph/building_blocks.mdx",
"repo_id": "agents-course",
"token_count": 1207
} | 2 |
# Creating agentic workflows in LlamaIndex
A workflow in LlamaIndex provides a structured way to organize your code into sequential and manageable steps.
Such a workflow is created by defining `Steps` which are triggered by `Events`, and themselves emit `Events` to trigger further steps.
Let's take a look at Alfred s... | agents-course/units/en/unit2/llama-index/workflows.mdx/0 | {
"file_path": "agents-course/units/en/unit2/llama-index/workflows.mdx",
"repo_id": "agents-course",
"token_count": 2976
} | 3 |
# Conclusion
In this unit, we've learned how to create an agentic RAG system to help Alfred, our friendly neighborhood agent, prepare for and manage an extravagant gala.
The combination of RAG with agentic capabilities demonstrates how powerful AI assistants can become when they have:
- Access to structured knowledge... | agents-course/units/en/unit3/agentic-rag/conclusion.mdx/0 | {
"file_path": "agents-course/units/en/unit3/agentic-rag/conclusion.mdx",
"repo_id": "agents-course",
"token_count": 231
} | 4 |
<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/bonus-unit2/monitoring-and-evaluating-agents.ipynb"},
]} />
# Unidad Extra 2: Observabilidad... | agents-course/units/es/bonus-unit2/monitoring-and-evaluating-agents-notebook.mdx/0 | {
"file_path": "agents-course/units/es/bonus-unit2/monitoring-and-evaluating-agents-notebook.mdx",
"repo_id": "agents-course",
"token_count": 7626
} | 5 |
# Conclusión [[conclusion]]
¡Felicitaciones por terminar esta primera Unidad 🥳
¡Acabas de **dominar los fundamentos de los Agentes** y has creado tu primer Agente de IA!
Es **normal si todavía te sientes confundido por algunos de estos elementos**. Los Agentes son un tema complejo y es común que tome tiempo compren... | agents-course/units/es/unit1/conclusion.mdx/0 | {
"file_path": "agents-course/units/es/unit1/conclusion.mdx",
"repo_id": "agents-course",
"token_count": 496
} | 6 |
# Grafo de Análisis de Documentos
Alfred a su servicio. Como mayordomo de confianza del Sr. Wayne, me he tomado la libertad de documentar cómo asisto al Sr. Wayne con sus diversas necesidades documentales. Mientras él está fuera atendiendo sus... actividades nocturnas, me aseguro de que todos sus documentos, horarios ... | agents-course/units/es/unit2/langgraph/document_analysis_agent.mdx/0 | {
"file_path": "agents-course/units/es/unit2/langgraph/document_analysis_agent.mdx",
"repo_id": "agents-course",
"token_count": 3748
} | 7 |
# Conclusión
¡Felicitaciones por terminar el módulo de `smolagents` de esta segunda Unidad 🥳
¡Acabas de dominar los fundamentos de `smolagents` y has construido tu propio Agente! Ahora que tienes habilidades en `smolagents`, puedes comenzar a crear Agentes que resolverán tareas que te interesen.
En el próximo módul... | agents-course/units/es/unit2/smolagents/conclusion.mdx/0 | {
"file_path": "agents-course/units/es/unit2/smolagents/conclusion.mdx",
"repo_id": "agents-course",
"token_count": 289
} | 8 |
# Creando una Herramienta RAG para Historias de Invitados
Alfred, tu agente de confianza, está preparando la gala más extravagante del siglo. Para asegurar que el evento transcurra sin problemas, Alfred necesita acceso rápido a información actualizada sobre cada invitado. Ayudemos a Alfred creando una herramienta per... | agents-course/units/es/unit3/agentic-rag/invitees.mdx/0 | {
"file_path": "agents-course/units/es/unit3/agentic-rag/invitees.mdx",
"repo_id": "agents-course",
"token_count": 7173
} | 9 |
# Quiz : évaluation des agents
Évaluons votre compréhension des concepts de traçage et d'évaluation des agents abordés dans cette unité bonus.
Ce quiz est optionnel et non noté.
### Q1 : À quoi l'observabilité dans les agents fait-elle principalement référence ?
Quelle déclaration décrit avec précision le but de l'o... | agents-course/units/fr/bonus-unit2/quiz.mdx/0 | {
"file_path": "agents-course/units/fr/bonus-unit2/quiz.mdx",
"repo_id": "agents-course",
"token_count": 2076
} | 10 |
# Bibliothèque d'agents factices
<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-unit1sub3DONE.jpg" alt="Planification de l'Unité 1"/>
Ce cours est indépendant de tout framework car nous souhaitons **nous concentrer sur les concepts des agents et éviter de nous e... | agents-course/units/fr/unit1/dummy-agent-library.mdx/0 | {
"file_path": "agents-course/units/fr/unit1/dummy-agent-library.mdx",
"repo_id": "agents-course",
"token_count": 4590
} | 11 |
# Construire votre premier LangGraph
Maintenant que nous comprenons les composants de base, mettons-les en pratique en construisant notre premier graphe fonctionnel. Nous implémenterons le système de traitement des emails reçus par Alfred, où il doit :
1. Lire les emails entrants
2. Les classifier comme spam ou légit... | agents-course/units/fr/unit2/langgraph/first_graph.mdx/0 | {
"file_path": "agents-course/units/fr/unit2/langgraph/first_graph.mdx",
"repo_id": "agents-course",
"token_count": 5565
} | 12 |
# C'est l'heure de l'examen !
Bravo d'avoir suivi sur le matériel sur `smolagents` ! Vous en avez déjà fait beaucoup. Maintenant, il est temps de mettre vos connaissances à l'épreuve avec un quiz. 🧠
## Instructions
- Le quiz consiste en des questions de code.
- Vous recevrez des instructions pour compléter les extr... | agents-course/units/fr/unit2/smolagents/final_quiz.mdx/0 | {
"file_path": "agents-course/units/fr/unit2/smolagents/final_quiz.mdx",
"repo_id": "agents-course",
"token_count": 396
} | 13 |
# Création et intégration d'outils pour votre agent
Dans cette section, nous allons donner à Alfred l'accès au web, lui permettant de trouver les dernières nouvelles et mises à jour mondiales.
De plus, il aura accès aux données météorologiques et aux statistiques de téléchargement des modèles du Hub d'Hugging Face Hu... | agents-course/units/fr/unit3/agentic-rag/tools.mdx/0 | {
"file_path": "agents-course/units/fr/unit3/agentic-rag/tools.mdx",
"repo_id": "agents-course",
"token_count": 5593
} | 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 |
# 测验:评估 AI 智能体
让我们评估一下你对本附加单元中所涵盖的智能体追踪和评估概念的理解。
本次测验为可选,不计分。
### Q1: AI 智能体中的可观测性主要指的是什么?
哪个陈述准确地描述了 AI 智能体可观测性的目的?
<Question
choices={[
{
text: "它涉及通过日志、指标和跨度(spans)追踪内部操作,以理解智能体行为。",
explain: "正确!可观测性意味着使用日志、指标和跨度来揭示智能体的内部运作。",
correct: true
},
{
text: "它仅仅专注于降低运行智能体的财务成本。",
explain: "可... | agents-course/units/zh-CN/bonus_unit2/quiz.mdx/0 | {
"file_path": "agents-course/units/zh-CN/bonus_unit2/quiz.mdx",
"repo_id": "agents-course",
"token_count": 2975
} | 19 |
# 小测验(不计分)[[quiz1]]
至此您已理解智能体的整体概念,包括其定义和工作原理。现在进行一个简短测验,因为**自我测试**是最佳学习方式,[可避免能力错觉](https://www.coursera.org/lecture/learning-how-to-learn/illusions-of-competence-BuFzf)。这将帮助您发现**需要加强的知识领域**。
本测验为可选项目,不计入评分。
### 问题1:什么是智能体?
以下哪项最能描述AI智能体?
<Question
choices={[
{
text: "仅处理静态文本且永不与环境交互的系统",
explain: "智能体必须具备执行行动并与环... | agents-course/units/zh-CN/unit1/quiz1.mdx/0 | {
"file_path": "agents-course/units/zh-CN/unit1/quiz1.mdx",
"repo_id": "agents-course",
"token_count": 3496
} | 20 |
# 在 LlamaIndex 中使用智能体
还记得我们之前那位得力的管家智能体 Alfred 吗?现在他要迎来重大升级了!
在了解了 LlamaIndex 中的工具后,我们可以赋予 Alfred 新的能力来更好地服务我们。
不过在继续之前,让我们先回顾一下智能体(如 Alfred)的核心机制。
在第一单元中我们学习到:
> 智能体是一个利用 AI 模型与环境交互以实现用户定义目标的系统。它通过结合推理、规划和动作执行(通常通过外部工具)来完成各种任务。
LlamaIndex 支持**三种主要类型的推理智能体**:
.
This requires [`hf-hub`](https://github.com/huggingface/hf-hub).
```bash
ca... | candle/candle-book/src/training/training.md/0 | {
"file_path": "candle/candle-book/src/training/training.md",
"repo_id": "candle",
"token_count": 361
} | 26 |
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
use anyhow::Result;
use candle_core::{Device, Tensor};
// xs: [1024, 64, 1924], c Tensor[dims 128, 64, 8; f32, cuda:0] Conv1dConfig { padding: 0, stride: 4, dilation: 1, groups: 1 }
fn main() -> Result<()> ... | candle/candle-core/examples/cuda_basics.rs/0 | {
"file_path": "candle/candle-core/examples/cuda_basics.rs",
"repo_id": "candle",
"token_count": 363
} | 27 |
use crate::WithDType;
use cudarc;
use cudarc::cudnn::safe::{ConvForward, Cudnn};
use cudarc::driver::{CudaSlice, CudaView, DeviceRepr, ValidAsZeroBits};
use std::cell::RefCell;
use std::collections::HashMap;
use std::sync::Arc;
// The cudnn handles are stored per thread here rather than on the CudaDevice as they are n... | candle/candle-core/src/cuda_backend/cudnn.rs/0 | {
"file_path": "candle/candle-core/src/cuda_backend/cudnn.rs",
"repo_id": "candle",
"token_count": 4227
} | 28 |
//! Implementation of Backend traits for Metal
//!
use crate::backend::{BackendDevice, BackendStorage};
use crate::conv::{ParamsConv1D, ParamsConv2D, ParamsConvTranspose1D, ParamsConvTranspose2D};
use crate::op::{BinaryOpT, CmpOp, ReduceOp, UnaryOpT};
use crate::{CpuStorage, CpuStorageRef, DType, Layout, Result, Shape}... | candle/candle-core/src/metal_backend/mod.rs/0 | {
"file_path": "candle/candle-core/src/metal_backend/mod.rs",
"repo_id": "candle",
"token_count": 54052
} | 29 |
use crate::Result;
pub(super) fn nearest_int(v: f32) -> i32 {
v.round() as i32
}
/// Validates that the input and output are the right size and returns an iterator which maps each
/// input region `xs` to its corresponding output block in `ys`. Each output region is guaranteed
/// to be `T::BLCK_SIZE` long.
pub(s... | candle/candle-core/src/quantized/utils.rs/0 | {
"file_path": "candle/candle-core/src/quantized/utils.rs",
"repo_id": "candle",
"token_count": 5775
} | 30 |
[package]
name = "candle-datasets"
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]
byteorder = { workspace = true }
candle = { workspace = true }... | candle/candle-datasets/Cargo.toml/0 | {
"file_path": "candle/candle-datasets/Cargo.toml",
"repo_id": "candle",
"token_count": 201
} | 31 |
# candle-beit
[Beit](https://arxiv.org/abs/2106.08254) is a computer vision model.
In this example, it is used as an ImageNet classifier: the model returns the
probability for the image to belong to each of the 1000 ImageNet categories.
## Running some example
```bash
cargo run --example beit --release -- --image ca... | candle/candle-examples/examples/beit/README.md/0 | {
"file_path": "candle/candle-examples/examples/beit/README.md",
"repo_id": "candle",
"token_count": 261
} | 32 |
# Colpali
[HuggingFace Model Card](https://huggingface.co/vidore/colpali-v1.2-merged)
```
wget https://arxiv.org/pdf/1706.03762.pdf
cargo run --features cuda,pdf2image --release --example colpali -- --prompt "What is Positional Encoding" --pdf "1706.03762.pdf"
```
```
Prompt: what is position encoding?
top 3 page nu... | candle/candle-examples/examples/colpali/README.md/0 | {
"file_path": "candle/candle-examples/examples/colpali/README.md",
"repo_id": "candle",
"token_count": 153
} | 33 |
# DeepSeek V2
DeepSeek V2 an MoE model featuring MLA (Multi-Latent Attention). There is a lite (16B) and a full (236B) model.
- Context length of **32k tokens** (Lite model), **128k tokens** (full model)
- 64 routed experts (Lite model), 160 routed experts (full model)
## Running the example
```bash
$ cargo run --e... | candle/candle-examples/examples/deepseekv2/README.md/0 | {
"file_path": "candle/candle-examples/examples/deepseekv2/README.md",
"repo_id": "candle",
"token_count": 316
} | 34 |
use anyhow::{Context, Result};
use std::sync::{Arc, Mutex};
pub const SAMPLE_RATE: usize = 24_000;
pub(crate) struct AudioOutputData_ {
resampled_data: std::collections::VecDeque<f32>,
resampler: rubato::FastFixedIn<f32>,
output_buffer: Vec<f32>,
input_buffer: Vec<f32>,
input_len: usize,
}
impl A... | candle/candle-examples/examples/encodec/audio_io.rs/0 | {
"file_path": "candle/candle-examples/examples/encodec/audio_io.rs",
"repo_id": "candle",
"token_count": 4796
} | 35 |
use candle::{DType, Device, Tensor};
use candle_nn::VarBuilder;
use candle_transformers::generation::LogitsProcessor;
use candle_transformers::models::glm4::{Config as ConfigOld, EosTokenId, Model as ModelOld};
use candle_transformers::models::glm4_new::{Config as ConfigNew, ModelForCausalLM as ModelNew};
use clap::Pa... | candle/candle-examples/examples/glm4/main.rs/0 | {
"file_path": "candle/candle-examples/examples/glm4/main.rs",
"repo_id": "candle",
"token_count": 4770
} | 36 |
use candle::backend::BackendStorage;
use candle::{CpuStorage, CustomOp1, DType, Device, IndexOp, Layout, Result, Shape, Tensor, D};
use candle_nn::var_builder::ShardedVarBuilder as VarBuilder;
use candle_nn::{Embedding, Linear, Module, RmsNorm};
use cudarc::nccl::safe::{Comm, ReduceOp};
use std::rc::Rc;
use std::sync::... | candle/candle-examples/examples/llama_multiprocess/model.rs/0 | {
"file_path": "candle/candle-examples/examples/llama_multiprocess/model.rs",
"repo_id": "candle",
"token_count": 7294
} | 37 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use anyhow::Result;
use clap::Parser;
use std::io::Write;
use candle_transformers::generation::LogitsProcessor;
use candle_transformers::models::encodec;
use candle_transformers::models::metavoice::{adapte... | candle/candle-examples/examples/metavoice/main.rs/0 | {
"file_path": "candle/candle-examples/examples/metavoice/main.rs",
"repo_id": "candle",
"token_count": 4561
} | 38 |
# candle-modernbert
ModernBERT is a bidirectional encoder-only language model. In this example it is used for the fill-mask task:
## Usage
```bash
cargo run --example modernbert --release -- --model modern-bert-large --prompt 'The capital of France is [MASK].'
```
```markdown
Sentence: 1 : The capital of France is ... | candle/candle-examples/examples/modernbert/README.md/0 | {
"file_path": "candle/candle-examples/examples/modernbert/README.md",
"repo_id": "candle",
"token_count": 102
} | 39 |
# Orpheus
Orpheus is a 3B text-to-speech model based on Llama.
- Weights on HuggingFace
[canopylabs/orpheus-3b-0.1-ft](https://huggingface.co/canopylabs/orpheus-3b-0.1-ft).
- Code on GitHub [canopyai/Orpheus-TTS](https://github.com/canopyai/Orpheus-TTS).
```bash
cargo run --example orpheus --features cuda -r
```
... | candle/candle-examples/examples/orpheus/README.md/0 | {
"file_path": "candle/candle-examples/examples/orpheus/README.md",
"repo_id": "candle",
"token_count": 135
} | 40 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use clap::{Parser, ValueEnum};
use std::io::Write;
use tokenizers::Tokenizer;
use candle::quantized::gguf_file;
use candle::Tensor;
use candle_transformers::generation::{LogitsProcessor, Sampling};
use ca... | candle/candle-examples/examples/quantized-qwen2-instruct/main.rs/0 | {
"file_path": "candle/candle-examples/examples/quantized-qwen2-instruct/main.rs",
"repo_id": "candle",
"token_count": 5570
} | 41 |
//! Wrappers around the Python API of Gymnasium (the new version of OpenAI gym)
use candle::{Device, Result, Tensor};
use pyo3::prelude::*;
use pyo3::types::PyDict;
/// The return value for a step.
#[derive(Debug)]
pub struct Step<A> {
pub state: Tensor,
pub action: A,
pub reward: f64,
pub terminated: ... | candle/candle-examples/examples/reinforcement-learning/gym_env.rs/0 | {
"file_path": "candle/candle-examples/examples/reinforcement-learning/gym_env.rs",
"repo_id": "candle",
"token_count": 1743
} | 42 |
# candle-segment-anything: Segment-Anything Model
This example is based on Meta AI [Segment-Anything
Model](https://github.com/facebookresearch/segment-anything). This model
provides a robust and fast image segmentation pipeline that can be tweaked via
some prompting (requesting some points to be in the target mask, r... | candle/candle-examples/examples/segment-anything/README.md/0 | {
"file_path": "candle/candle-examples/examples/segment-anything/README.md",
"repo_id": "candle",
"token_count": 575
} | 43 |
mod clip;
mod sampling;
mod vae;
use candle::{DType, IndexOp, Tensor};
use candle_transformers::models::mmdit::model::{Config as MMDiTConfig, MMDiT};
use crate::clip::StableDiffusion3TripleClipWithTokenizer;
use crate::vae::{build_sd3_vae_autoencoder, sd3_vae_vb_rename};
use anyhow::{Ok, Result};
use clap::Parser;
... | candle/candle-examples/examples/stable-diffusion-3/main.rs/0 | {
"file_path": "candle/candle-examples/examples/stable-diffusion-3/main.rs",
"repo_id": "candle",
"token_count": 4715
} | 44 |
use image::{DynamicImage, ImageBuffer};
use serde::Deserialize;
use std::collections::HashMap;
use candle::{DType, Device, Result, Tensor};
#[derive(Debug, Clone, PartialEq, Deserialize)]
pub struct ProcessorConfig {
do_resize: bool,
height: u32,
width: u32,
do_rescale: bool,
do_normalize: bool,
... | candle/candle-examples/examples/trocr/image_processor.rs/0 | {
"file_path": "candle/candle-examples/examples/trocr/image_processor.rs",
"repo_id": "candle",
"token_count": 2273
} | 45 |
# Get the checkpoint from
# https://openaipublic.azureedge.net/main/whisper/models/d3dd57d32accea0b295c96e26691aa14d8822fac7d9d27d5dc00b4ca2826dd03/tiny.en.pt
import torch
from safetensors.torch import save_file
data = torch.load("tiny.en.pt")
weights = {}
for k, v in data["model_state_dict"].items():
weights[k] ... | candle/candle-examples/examples/whisper/extract_weights.py/0 | {
"file_path": "candle/candle-examples/examples/whisper/extract_weights.py",
"repo_id": "candle",
"token_count": 183
} | 46 |
[net]
# Testing
batch=1
subdivisions=1
# Training
# batch=64
# subdivisions=16
width= 416
height = 416
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1
learning_rate=0.001
burn_in=1000
max_batches = 500200
policy=steps
steps=400000,450000
scales=.1,.1
[convolutional]
batch_normaliz... | candle/candle-examples/examples/yolo-v3/yolo-v3.cfg/0 | {
"file_path": "candle/candle-examples/examples/yolo-v3/yolo-v3.cfg",
"repo_id": "candle",
"token_count": 3586
} | 47 |
[package]
name = "candle-flash-attn"
version = "0.9.1"
edition = "2021"
description = "Flash attention layer for the candle ML framework."
repository = "https://github.com/huggingface/candle"
keywords = ["blas", "tensor", "machine-learning"]
categories = ["science"]
license = "MIT OR Apache-2.0"
readme = "README.md"
... | candle/candle-flash-attn/Cargo.toml/0 | {
"file_path": "candle/candle-flash-attn/Cargo.toml",
"repo_id": "candle",
"token_count": 288
} | 48 |
// 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::half_t, 160, false>(Flash_fwd_params ¶ms, cudaStream_t strea... | candle/candle-flash-attn/kernels/flash_fwd_hdim160_fp16_sm80.cu/0 | {
"file_path": "candle/candle-flash-attn/kernels/flash_fwd_hdim160_fp16_sm80.cu",
"repo_id": "candle",
"token_count": 138
} | 49 |
/******************************************************************************
* Copyright (c) 2024, Tri Dao.
******************************************************************************/
#pragma once
#include <cute/tensor.hpp>
namespace flash {
using namespace cute;
template <typename Engine, typename Layout... | candle/candle-flash-attn/kernels/mask.h/0 | {
"file_path": "candle/candle-flash-attn/kernels/mask.h",
"repo_id": "candle",
"token_count": 6254
} | 50 |
#include "cuda_fp16.h"
#include "cuda_bf16.h"
#include "cuda_fp8.h"
// Table showing which features are supported on which compute capability
// https://docs.nvidia.com/cuda/cuda-c-programming-guide/#features-and-technical-specifications
// FIXME: the minimum compute capabilities are just guesses since the table is n... | candle/candle-kernels/src/compatibility.cuh/0 | {
"file_path": "candle/candle-kernels/src/compatibility.cuh",
"repo_id": "candle",
"token_count": 2748
} | 51 |
use crate::source::{
AFFINE, BINARY, CAST, CONV, FILL, INDEXING, MLX_GEMM, MLX_SORT, QUANTIZED, RANDOM, REDUCE,
SDPA, SORT, TERNARY, UNARY,
};
use crate::{
ComputePipeline, ConstantValues, Device, Function, Library, MTLCompileOptions, MTLMathMode,
MetalKernelError, Source,
};
use std::collections::HashM... | candle/candle-metal-kernels/src/kernel.rs/0 | {
"file_path": "candle/candle-metal-kernels/src/kernel.rs",
"repo_id": "candle",
"token_count": 2476
} | 52 |
use crate::kernels::macros::ops;
use crate::utils::{BufferOffset, EncoderProvider};
use crate::{get_block_dims, linear_split};
use crate::{
set_params, Buffer, ComputeCommandEncoder, Device, EncoderParam, Kernels, MetalKernelError,
Source,
};
use objc2_metal::{MTLResourceUsage, MTLSize};
ops!(
cos, sin, ex... | candle/candle-metal-kernels/src/kernels/unary.rs/0 | {
"file_path": "candle/candle-metal-kernels/src/kernels/unary.rs",
"repo_id": "candle",
"token_count": 2945
} | 53 |
// MLX Kernel extracted from:
// https://github.com/ml-explore/mlx/blob/main/mlx/backend/metal/kernels/steel/gemm
// Copyright © 2024 Apple Inc.
#include <metal_simdgroup>
#include <metal_simdgroup_matrix>
#include <metal_stdlib>
#define STEEL_CONST static constant constexpr const
#define STEEL_PRAGMA_UNROLL _Pragma(... | candle/candle-metal-kernels/src/metal_src/mlx_gemm.metal/0 | {
"file_path": "candle/candle-metal-kernels/src/metal_src/mlx_gemm.metal",
"repo_id": "candle",
"token_count": 20230
} | 54 |
use crate::benchmarks::{BenchDevice, BenchDeviceHandler};
use candle::{DType, Device, Module, Tensor};
use candle_nn::{Conv2d, Conv2dConfig};
use criterion::{black_box, criterion_group, Criterion};
use std::time::Instant;
const B: usize = 1;
const C: usize = 1;
const M: usize = 128;
const K: usize = 128;
const K_SIZE:... | candle/candle-nn/benches/benchmarks/conv.rs/0 | {
"file_path": "candle/candle-nn/benches/benchmarks/conv.rs",
"repo_id": "candle",
"token_count": 808
} | 55 |
//! Layer Normalization.
//!
//! This layer applies Layer Normalization over a mini-batch of inputs as described in [`Layer
//! Normalization`]. The input is expected to have three dimensions: a batch dimension, a length,
//! and a hidden size, the normalization is applied over the last dimension.
//!
//! # Example
//!... | candle/candle-nn/src/layer_norm.rs/0 | {
"file_path": "candle/candle-nn/src/layer_norm.rs",
"repo_id": "candle",
"token_count": 2656
} | 56 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use anyhow::Result;
use candle::{test_utils, Device, Tensor};
use candle_nn::{LayerNorm, Module};
#[test]
fn layer_norm() -> Result<()> {
let device = &Device::Cpu;
let w = Tensor::new(&[3f32], dev... | candle/candle-nn/tests/layer_norm.rs/0 | {
"file_path": "candle/candle-nn/tests/layer_norm.rs",
"repo_id": "candle",
"token_count": 892
} | 57 |
## Installation
From the `candle-pyo3` directory, enable a virtual env where you will want the
candle package to be installed then run.
```bash
maturin develop -r
python test.py
```
## Generating Stub Files for Type Hinting
For type hinting support, the `candle-pyo3` package requires `*.pyi` files. You can automa... | candle/candle-pyo3/README.md/0 | {
"file_path": "candle/candle-pyo3/README.md",
"repo_id": "candle",
"token_count": 190
} | 58 |
import candle
from candle import Tensor
from .module import Module
from typing import Union, List, Tuple, Optional, Any
_shape_t = Union[int, List[int]]
import numbers
class LayerNorm(Module):
r"""Applies Layer Normalization over a mini-batch of inputs as described in
the paper `Layer Normalization <https://... | candle/candle-pyo3/py_src/candle/nn/normalization.py/0 | {
"file_path": "candle/candle-pyo3/py_src/candle/nn/normalization.py",
"repo_id": "candle",
"token_count": 803
} | 59 |
import candle
import torch
# convert from candle tensor to torch tensor
t = candle.randn((3, 512, 512))
torch_tensor = t.to_torch()
print(torch_tensor)
print(type(torch_tensor))
# convert from torch tensor to candle tensor
t = torch.randn((3, 512, 512))
candle_tensor = candle.Tensor(t)
print(candle_tensor)
print(type... | candle/candle-pyo3/test_pytorch.py/0 | {
"file_path": "candle/candle-pyo3/test_pytorch.py",
"repo_id": "candle",
"token_count": 126
} | 60 |
//! Based on the BLIP paper from Salesforce Research.
//!
//! The blip-image-captioning model can generate captions for an input image.
//!
//! - ⚡ [Interactive Wasm Example](https://huggingface.co/spaces/radames/Candle-BLIP-Image-Captioning)
//! - 💻 [GH Link](https://github.com/salesforce/BLIP)
//! - 🤗 [HF Link](htt... | candle/candle-transformers/src/models/blip.rs/0 | {
"file_path": "candle/candle-transformers/src/models/blip.rs",
"repo_id": "candle",
"token_count": 4762
} | 61 |
#![allow(clippy::cast_possible_truncation, clippy::cast_precision_loss)]
use std::{f32::consts::PI, sync::Arc};
use candle::{
shape::Dim, CpuStorage, CustomOp1, DType, Device, Error, IndexOp, Layout, Result, Shape,
Tensor, WithDType, D,
};
use candle_nn::{embedding, rms_norm, Activation, Embedding, Linear, Mo... | candle/candle-transformers/src/models/deepseek2.rs/0 | {
"file_path": "candle/candle-transformers/src/models/deepseek2.rs",
"repo_id": "candle",
"token_count": 18564
} | 62 |
//! Gemma inference implementation.
//!
//! See ["Gemma: Open Models Based on Gemini Technology"](https://blog.google/technology/developers/gemma-open-ai-model/)
//!
//! Based on implementation from Google and PyTorch
use std::sync::Arc;
use candle::{DType, Device, Module, Result, Tensor, D};
use candle_nn::{linear_b... | candle/candle-transformers/src/models/gemma.rs/0 | {
"file_path": "candle/candle-transformers/src/models/gemma.rs",
"repo_id": "candle",
"token_count": 7496
} | 63 |
//! Marian Neural Machine Translation
//!
//! See "Marian: Fast Neural Machine Translation in C++" Junczys-Dowmunt et al. 2018
//! - [ACL Anthology](https://aclanthology.org/P18-4020/)
//! - [GitHub](https://github.com/marian-nmt/marian)
//!
use super::with_tracing::{linear, Embedding, Linear};
use candle::{Result, Ten... | candle/candle-transformers/src/models/marian.rs/0 | {
"file_path": "candle/candle-transformers/src/models/marian.rs",
"repo_id": "candle",
"token_count": 11296
} | 64 |
//! Mobile CLIP model, combining a lightweight vision encoder with a text encoder
//!
//! A mobile-optimized CLIP implementation that uses:
//! - FastViT as the vision encoder
//! - OpenCLIP text encoder
//! - Projection layers to align the feature spaces
//!
//! See model details at:
//! - [FastViT](https://arxiv.org/... | candle/candle-transformers/src/models/mobileclip.rs/0 | {
"file_path": "candle/candle-transformers/src/models/mobileclip.rs",
"repo_id": "candle",
"token_count": 1499
} | 65 |
//! Persimmon Model
//!
//! A transformer language model for efficient inference and general-purpose tasks. The model uses a standard transformer architecture with:
//! - Layer normalization for Q/K attention
//! - RoPE embeddings with partial rotary factor
//! - ReLU activation
//! - Separate number of attention heads... | candle/candle-transformers/src/models/persimmon.rs/0 | {
"file_path": "candle/candle-transformers/src/models/persimmon.rs",
"repo_id": "candle",
"token_count": 1045
} | 66 |
//! Phi2 model implementation with quantization support.
//!
//! Phi2 is a 2.7B parameter language model using scaled-up Transformer decoder architecture.
//! This implementation provides quantization for reduced memory and compute usage.
//!
//! Key characteristics:
//! - Partial attention with learned mixing to reduc... | candle/candle-transformers/src/models/quantized_phi.rs/0 | {
"file_path": "candle/candle-transformers/src/models/quantized_phi.rs",
"repo_id": "candle",
"token_count": 5545
} | 67 |
//! RWKV v5 model implementation.
//!
//! The [RWKV model](https://wiki.rwkv.com/) is a recurrent neural network model
//! with performance on par with transformer architectures. Several variants are
//! available, candle implements the v5 and v6 versions and can be used with
//! Eagle 7B([blog post](https://blog.rwkv.... | candle/candle-transformers/src/models/rwkv_v5.rs/0 | {
"file_path": "candle/candle-transformers/src/models/rwkv_v5.rs",
"repo_id": "candle",
"token_count": 8119
} | 68 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.