text
stringlengths
5
631k
id
stringlengths
14
178
metadata
dict
__index_level_0__
int64
0
647
# coding=utf-8 # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/sam_hq/test_modeling_sam_hq.py/0
{ "file_path": "transformers/tests/models/sam_hq/test_modeling_sam_hq.py", "repo_id": "transformers", "token_count": 20267 }
587
# 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/seggpt/test_modeling_seggpt.py/0
{ "file_path": "transformers/tests/models/seggpt/test_modeling_seggpt.py", "repo_id": "transformers", "token_count": 8736 }
588
# Copyright 2025 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
transformers/tests/models/smollm3/test_modeling_smollm3.py/0
{ "file_path": "transformers/tests/models/smollm3/test_modeling_smollm3.py", "repo_id": "transformers", "token_count": 3954 }
589
# 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/speecht5/test_processing_speecht5.py/0
{ "file_path": "transformers/tests/models/speecht5/test_processing_speecht5.py", "repo_id": "transformers", "token_count": 2818 }
590
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/superpoint/test_image_processing_superpoint.py/0
{ "file_path": "transformers/tests/models/superpoint/test_image_processing_superpoint.py", "repo_id": "transformers", "token_count": 3424 }
591
# Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/umt5/test_modeling_umt5.py/0
{ "file_path": "transformers/tests/models/umt5/test_modeling_umt5.py", "repo_id": "transformers", "token_count": 14821 }
592
# 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/vit_mae/test_modeling_vit_mae.py/0
{ "file_path": "transformers/tests/models/vit_mae/test_modeling_vit_mae.py", "repo_id": "transformers", "token_count": 7608 }
593
# 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/wav2vec2_conformer/test_modeling_wav2vec2_conformer.py/0
{ "file_path": "transformers/tests/models/wav2vec2_conformer/test_modeling_wav2vec2_conformer.py", "repo_id": "transformers", "token_count": 17473 }
594
# Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
transformers/tests/peft_integration/test_peft_integration.py/0
{ "file_path": "transformers/tests/peft_integration/test_peft_integration.py", "repo_id": "transformers", "token_count": 18968 }
595
# 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_object_detection.py/0
{ "file_path": "transformers/tests/pipelines/test_pipelines_object_detection.py", "repo_id": "transformers", "token_count": 6407 }
596
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/quantization/eetq_integration/test_eetq.py/0
{ "file_path": "transformers/tests/quantization/eetq_integration/test_eetq.py", "repo_id": "transformers", "token_count": 2640 }
597
import importlib def is_sagemaker_available(): return importlib.util.find_spec("sagemaker") is not None
transformers/tests/sagemaker/__init__.py/0
{ "file_path": "transformers/tests/sagemaker/__init__.py", "repo_id": "transformers", "token_count": 36 }
598
# Copyright 2022 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
transformers/tests/test_image_transforms.py/0
{ "file_path": "transformers/tests/test_image_transforms.py", "repo_id": "transformers", "token_count": 12214 }
599
# 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/trainer/test_trainer_distributed.py/0
{ "file_path": "transformers/tests/trainer/test_trainer_distributed.py", "repo_id": "transformers", "token_count": 3336 }
600
# Copyright 2023 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
transformers/tests/utils/test_audio_utils.py/0
{ "file_path": "transformers/tests/utils/test_audio_utils.py", "repo_id": "transformers", "token_count": 46035 }
601
# 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/utils/test_hub_utils.py/0
{ "file_path": "transformers/tests/utils/test_hub_utils.py", "repo_id": "transformers", "token_count": 3904 }
602
# coding=utf-8 # Copyright 2025 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/tests/utils/test_video_utils.py/0
{ "file_path": "transformers/tests/utils/test_video_utils.py", "repo_id": "transformers", "token_count": 6471 }
603
import re from transformers.pipelines import SUPPORTED_TASKS, Pipeline HEADER = """ # fmt: off # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # The part of the file below was automatically generated from the code. # Do...
transformers/utils/check_pipeline_typing.py/0
{ "file_path": "transformers/utils/check_pipeline_typing.py", "repo_id": "transformers", "token_count": 2097 }
604
# coding=utf-8 # 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...
transformers/utils/get_modified_files.py/0
{ "file_path": "transformers/utils/get_modified_files.py", "repo_id": "transformers", "token_count": 448 }
605
# 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/utils/process_circleci_workflow_test_reports.py/0
{ "file_path": "transformers/utils/process_circleci_workflow_test_reports.py", "repo_id": "transformers", "token_count": 1573 }
606
from transformers import BertTokenizer class CustomTokenizer(BertTokenizer): pass
transformers/utils/test_module/custom_tokenization.py/0
{ "file_path": "transformers/utils/test_module/custom_tokenization.py", "repo_id": "transformers", "token_count": 25 }
607
# Unsloth Integration <Tip warning={true}> Section under construction. Feel free to contribute! </Tip> Unsloth is an open‑source framework for fine‑tuning and reinforcement learning that trains LLMs (like Llama, Mistral, Gemma, DeepSeek, and more) up to 2× faster with up to 70% less VRAM, while providing a streamli...
trl/docs/source/unsloth_integration.md/0
{ "file_path": "trl/docs/source/unsloth_integration.md", "repo_id": "trl", "token_count": 1037 }
608
# Copyright 2020-2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
trl/examples/datasets/lm-human-preferences-descriptiveness.py/0
{ "file_path": "trl/examples/datasets/lm-human-preferences-descriptiveness.py", "repo_id": "trl", "token_count": 1690 }
609
# 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/config.py/0
{ "file_path": "trl/examples/research_projects/layer_skip/scripts/config.py", "repo_id": "trl", "token_count": 348 }
610
# 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/bco.py/0
{ "file_path": "trl/examples/scripts/bco.py", "repo_id": "trl", "token_count": 2270 }
611
# 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/ppo/ppo_tldr.py/0
{ "file_path": "trl/examples/scripts/ppo/ppo_tldr.py", "repo_id": "trl", "token_count": 2781 }
612
# 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_tiny_models.py/0
{ "file_path": "trl/scripts/generate_tiny_models.py", "repo_id": "trl", "token_count": 4792 }
613
# Copyright 2020-2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
trl/tests/test_activation_offloading.py/0
{ "file_path": "trl/tests/test_activation_offloading.py", "repo_id": "trl", "token_count": 2572 }
614
# Copyright 2020-2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
trl/tests/test_iterative_sft_trainer.py/0
{ "file_path": "trl/tests/test_iterative_sft_trainer.py", "repo_id": "trl", "token_count": 2049 }
615
# Copyright 2020-2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
trl/tests/test_trainers_args.py/0
{ "file_path": "trl/tests/test_trainers_args.py", "repo_id": "trl", "token_count": 8553 }
616
# Copyright 2020-2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
trl/trl/data_utils.py/0
{ "file_path": "trl/trl/data_utils.py", "repo_id": "trl", "token_count": 13663 }
617
# Copyright 2020-2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
trl/trl/trainer/bco_config.py/0
{ "file_path": "trl/trl/trainer/bco_config.py", "repo_id": "trl", "token_count": 3736 }
618
# Copyright 2020-2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
trl/trl/trainer/kto_config.py/0
{ "file_path": "trl/trl/trainer/kto_config.py", "repo_id": "trl", "token_count": 4307 }
619
# Copyright 2020-2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
trl/trl/trainer/rloo_trainer.py/0
{ "file_path": "trl/trl/trainer/rloo_trainer.py", "repo_id": "trl", "token_count": 17101 }
620
# Introduction <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/bonus-unit3/pokemon_thumbnail.png" alt="Bonus Unit 3 AI in Games"/> 🎶I want to be the very best ... 🎶 Welcome to this **bonus unit**, where you'll explore the exciting intersection of **AI Agents and games**! 🎮🤖 ...
agents-course/units/en/bonus-unit3/introduction.mdx/0
{ "file_path": "agents-course/units/en/bonus-unit3/introduction.mdx", "repo_id": "agents-course", "token_count": 516 }
0
### Q1: What is an Agent? Which of the following best describes an AI Agent? <Question choices={[ { text: "An AI model that can reason, plan, and use tools to interact with its environment to achieve a specific goal.", explain: "This definition captures the essential characteristics of an Agent.", correct: true }, { t...
agents-course/units/en/unit1/quiz1.mdx/0
{ "file_path": "agents-course/units/en/unit1/quiz1.mdx", "repo_id": "agents-course", "token_count": 1562 }
1
# Using Agents in LlamaIndex Remember Alfred, our helpful butler agent from earlier? Well, he's about to get an upgrade! Now that we understand the tools available in LlamaIndex, we can give Alfred new capabilities to serve us better. But before we continue, let's remind ourselves what makes an agent like Alfred tick...
agents-course/units/en/unit2/llama-index/agents.mdx/0
{ "file_path": "agents-course/units/en/unit2/llama-index/agents.mdx", "repo_id": "agents-course", "token_count": 2112 }
2
<CourseFloatingBanner classNames="absolute z-10 right-0 top-0" notebooks={[ {label: "Google Colab", value: "https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/unit2/smolagents/retrieval_agents.ipynb"}, ]} askForHelpUrl="http://hf.co/join/discord" /> # Building A...
agents-course/units/en/unit2/smolagents/retrieval_agents.mdx/0
{ "file_path": "agents-course/units/en/unit2/smolagents/retrieval_agents.mdx", "repo_id": "agents-course", "token_count": 2404 }
3
# Welcome to the final Unit [[introduction]] <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit4/thumbnail.jpg" alt="AI Agents Course thumbnail" width="100%"/> Welcome to the final unit of the course! 🎉 So far, you’ve **built a strong foundation in AI Agents**, from understan...
agents-course/units/en/unit4/introduction.mdx/0
{ "file_path": "agents-course/units/en/unit4/introduction.mdx", "repo_id": "agents-course", "token_count": 433 }
4
# El Estado del Arte en el Uso de LLMs en Juegos Para darte una idea de cuánto se ha avanzado en este campo, examinemos tres demos tecnológicas y un juego publicado que muestran la integración de LLMs en los videojuegos. ## 🕵️‍♂️ Covert Protocol por NVIDIA e Inworld AI <img src="https://huggingface.co/datasets/agen...
agents-course/units/es/bonus-unit3/state-of-art.mdx/0
{ "file_path": "agents-course/units/es/bonus-unit3/state-of-art.mdx", "repo_id": "agents-course", "token_count": 1184 }
5
# Pensamiento: Razonamiento Interno y el Enfoque Re-Act <Tip> En esta sección, profundizamos en el funcionamiento interno de un agente de IA—su capacidad para razonar y planificar. Exploraremos cómo el agente aprovecha su diálogo interno para analizar información, desglosar problemas complejos en pasos manejables y d...
agents-course/units/es/unit1/thoughts.mdx/0
{ "file_path": "agents-course/units/es/unit1/thoughts.mdx", "repo_id": "agents-course", "token_count": 1519 }
6
# Conclusión !Felicidades por terminar el módulo `llama-index` de esta segunda Unidad 🥳 Acabas de dominar los fundamentos de `llama-index` y has visto como construir tus propias flujos de trabajo agentivos! Ahora que tienes habilidades en `llama-index`, puedes empezar a crear motores de búsqueda que resolveran tarea...
agents-course/units/es/unit2/llama-index/conclusion.mdx/0
{ "file_path": "agents-course/units/es/unit2/llama-index/conclusion.mdx", "repo_id": "agents-course", "token_count": 377 }
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/tools.ipynb"}, ]} /> # Herramientas Como exploramos en la [unidad 1](htt...
agents-course/units/es/unit2/smolagents/tools.mdx/0
{ "file_path": "agents-course/units/es/unit2/smolagents/tools.mdx", "repo_id": "agents-course", "token_count": 5480 }
8
# ¿Qué es GAIA? [GAIA](https://huggingface.co/papers/2311.12983) es un **benchmark diseñado para evaluar asistentes de IA en tareas del mundo real** que requieren una combinación de capacidades centrales, como razonamiento, comprensión multimodal, navegación web y uso competente de herramientas. Fue introducido en el...
agents-course/units/es/unit4/what-is-gaia.mdx/0
{ "file_path": "agents-course/units/es/unit4/what-is-gaia.mdx", "repo_id": "agents-course", "token_count": 1674 }
9
# Que sont les outils ? <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-check-2.jpg" alt="Planification de l'Unité 1"/> Un aspect crucial des agents est leur capacité à prendre des **actions**. Comme nous l'avons vu, cela se fait par l'utilisation d'**outils**. ...
agents-course/units/fr/unit1/tools.mdx/0
{ "file_path": "agents-course/units/fr/unit1/tools.mdx", "repo_id": "agents-course", "token_count": 6144 }
10
<CourseFloatingBanner classNames="absolute z-10 right-0 top-0" notebooks={[ {label: "Google Colab", value: "https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/fr/unit2/smolagents/vision_agents.ipynb"}, ]} askForHelpUrl="http://hf.co/join/discord" /> # Agents vis...
agents-course/units/fr/unit2/smolagents/vision_agents.mdx/0
{ "file_path": "agents-course/units/fr/unit2/smolagents/vision_agents.mdx", "repo_id": "agents-course", "token_count": 5099 }
11
# (선택 섹션) Discord 101 [[discord-101]] <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit0/discord-etiquette.jpg" alt="The Discord Etiquette" width="100%"/> 이 가이드는 게임 및 머신러닝(Machine Learning) 커뮤니티에서 인기 있는 무료 채팅 플랫폼, 디스코드(Discord)를 처음 사용하는 분들을 위한 안내서입니다. Hugging Face 커뮤니티 Discor...
agents-course/units/ko/unit0/discord101.mdx/0
{ "file_path": "agents-course/units/ko/unit0/discord101.mdx", "repo_id": "agents-course", "token_count": 2269 }
12
# smolagents로 첫 번째 에이전트 만들기 [[lets-create-our-first-agent-using-smolagents]] 앞 섹션에서 우리는 Python 코드로 에이전트를 처음부터 만드는 방법을 배웠고, **이 과정이 얼마나 번거로울 수 있는지** 직접 확인했습니다. 다행히도 많은 에이전트 라이브러리들이 **복잡한 작업들을 자동화하여** 이 과정을 훨씬 간단하게 만들어줍니다. 이 튜토리얼에서는 **여러분의 첫 번째 에이전트를 만들게 됩니다**. 이 에이전트는 이미지 생성, 웹 검색, 시간대 확인 등 다양한 작업을 수행할 수 있습니다! 또한 여러분...
agents-course/units/ko/unit1/tutorial.mdx/0
{ "file_path": "agents-course/units/ko/unit1/tutorial.mdx", "repo_id": "agents-course", "token_count": 7468 }
13
# Заключение [[conclusion]] Поздравляем с завершением этого первого раздела 🥳. Вы только что **овладели основами работы агентов** и создали своего первого AI Агента! Это **нормально, если вы все еще чувствуете себя сбитым с толку некоторыми из этих элементов**. Агенты - сложная тема, и обычно требуется время, чтобы...
agents-course/units/ru-RU/unit1/conclusion.mdx/0
{ "file_path": "agents-course/units/ru-RU/unit1/conclusion.mdx", "repo_id": "agents-course", "token_count": 1128 }
14
# Hãy fine-Tune model của bạn cho chức năng function-calling Chúng ta đã sẵn sàng để fine-tune (tinh chỉnh) model đầu tiên cho function-calling rồi đây 🔥. ## Làm thế nào để training model cho function-calling? > Câu trả lời: Ta cần **data** Quá trình training model có thể chia thành 3 bước: 1. **Model được pretra...
agents-course/units/vi/bonus-unit1/fine-tuning.mdx/0
{ "file_path": "agents-course/units/vi/bonus-unit1/fine-tuning.mdx", "repo_id": "agents-course", "token_count": 2479 }
15
--- ### Q1: Agent (tác nhân) là gì? Lựa chọn nào sau đây mô tả đúng nhất về AI agent? <Question choices={[ { text: "Hệ thống chỉ xử lý văn bản tĩnh, không có cơ chế tương tác động với môi trường xung quanh hay thực hiện hành động có ý nghĩa.", explain: "Agent phải có khả năng thực hiện hành động và tương tác với môi t...
agents-course/units/vi/unit1/quiz1.mdx/0
{ "file_path": "agents-course/units/vi/unit1/quiz1.mdx", "repo_id": "agents-course", "token_count": 4826 }
16
<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"}, ]} /> # 附加单元 2:AI 智能体(AI Agent)的可观测性与评...
agents-course/units/zh-CN/bonus_unit2/monitoring-and-evaluating-agents-notebook.mdx/0
{ "file_path": "agents-course/units/zh-CN/bonus_unit2/monitoring-and-evaluating-agents-notebook.mdx", "repo_id": "agents-course", "token_count": 9851 }
17
# Observe: 整合反馈以反思和调整 Observations(观察)是**智能体感知其行动结果的方式**。 它们提供关键信息,为智能体的思考过程提供燃料并指导未来行动。 这些是**来自环境的信号**——无论是 API 返回的数据、错误信息还是系统日志——它们指导着下一轮的思考循环。 在观察阶段,智能体会: - **收集反馈**:接收数据或确认其行动是否成功 - **附加结果**:将新信息整合到现有上下文中,有效更新记忆 - **调整策略**:使用更新后的上下文来优化后续思考和行动 例如,当天气 API 返回数据*"partly cloudy, 15°C, 60% humidity"*(局部多云,15°C,60% ...
agents-course/units/zh-CN/unit1/observations.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit1/observations.mdx", "repo_id": "agents-course", "token_count": 1851 }
18
# 目录 此 LlamaIndex 框架大纲是课程第 2 单元的一部分。您可以在 hf.co/learn 上访问有关 LlamaIndex 的第 2 单元 👉 <a href="https://hf.co/learn/agents-course/unit2/llama-index/introduction">这里</a> | 标题 | 描述 | | -------------------------------- | ------...
agents-course/units/zh-CN/unit2/llama-index/README.md/0
{ "file_path": "agents-course/units/zh-CN/unit2/llama-index/README.md", "repo_id": "agents-course", "token_count": 1137 }
19
# 小测验(不计分)[[quiz2]] 现在该测试您对*代码智能体*、*工具调用智能体*和*工具*章节的理解了。本测验为可选且不计分。 --- ### Q1: 使用 `@tool` 装饰器创建工具与创建 `Tool` 的子类之间的主要区别是什么? 以下哪个陈述最能描述这两种定义工具方法的区别? <Question choices={[ { text: "使用 <code>@tool</code> 装饰器是检索类工具的强制要求,而 <code>Tool</code> 的子类仅用于文本生成任务", explain: "两种方法都适用于任何类型的工具,包括检索类和文本生成类工具。", }, { ...
agents-course/units/zh-CN/unit2/smolagents/quiz2.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit2/smolagents/quiz2.mdx", "repo_id": "agents-course", "token_count": 3839 }
20
# 动手实践 现在你已经准备好更深入地创建你的最终智能体了,让我们看看如何提交它以供评审。 ## 数据集 此排行榜使用的数据集包含从 GAIA **验证**集的一级问题中所提取的 20 个问题。 这些问题是根据回答问题所需的工具和步骤数量进行筛选的。 根据 GAIA 基准目前的状况,我们认为让你尝试在一级问题中达到 30% 的准确率是一个相对好的测试。 <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit4/leaderboard%20GAIA%2024%3A04%3A2025.png" alt...
agents-course/units/zh-CN/unit4/hands-on.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit4/hands-on.mdx", "repo_id": "agents-course", "token_count": 2053 }
21
# Pytorch cheatsheet {{#include ../../../README.md:cheatsheet}}
candle/candle-book/src/guide/cheatsheet.md/0
{ "file_path": "candle/candle-book/src/guide/cheatsheet.md", "repo_id": "candle", "token_count": 26 }
22
# MNIST So we now have downloaded the MNIST parquet files, let's put them in a simple struct. ```rust,ignore {{#include ../lib.rs:book_training_3}} ``` The parsing of the file and putting it into single tensors requires the dataset to fit the entire memory. It is quite rudimentary, but simple enough for a small data...
candle/candle-book/src/training/mnist.md/0
{ "file_path": "candle/candle-book/src/training/mnist.md", "repo_id": "candle", "token_count": 93 }
23
use crate::benchmarks::{BenchDevice, BenchDeviceHandler}; use candle_core::{DType, Device, Tensor}; use criterion::{black_box, criterion_group, Criterion, Throughput}; use std::time::Instant; fn run(a: &Tensor) { a.sqrt().unwrap(); } fn run_unary_benchmark(c: &mut Criterion, device: &Device, dtype: DType, name: &...
candle/candle-core/benches/benchmarks/unary.rs/0
{ "file_path": "candle/candle-core/benches/benchmarks/unary.rs", "repo_id": "candle", "token_count": 656 }
24
use super::Cpu; use core::arch::wasm32::*; pub struct CurrentCpu {} const STEP: usize = 16; const EPR: usize = 4; const ARR: usize = STEP / EPR; impl Cpu<ARR> for CurrentCpu { type Unit = v128; type Array = [v128; ARR]; const STEP: usize = STEP; const EPR: usize = EPR; fn n() -> usize { ...
candle/candle-core/src/cpu/simd128.rs/0
{ "file_path": "candle/candle-core/src/cpu/simd128.rs", "repo_id": "candle", "token_count": 839 }
25
//! Tensor Layouts including contiguous or sparse strides use crate::{Error, Result, Shape}; #[derive(Debug, PartialEq, Eq, Clone)] pub struct Layout { shape: Shape, // The strides are given in number of elements and not in bytes. stride: Vec<usize>, start_offset: usize, } impl Layout { pub fn new...
candle/candle-core/src/layout.rs/0
{ "file_path": "candle/candle-core/src/layout.rs", "repo_id": "candle", "token_count": 4460 }
26
//! Code for GGML and GGUF files use crate::{Context, CpuStorage, DType, Device, Result, Shape, Storage, Tensor}; use k_quants::*; use std::borrow::Cow; #[cfg(target_feature = "avx2")] pub mod avx; mod dummy_cuda; mod dummy_metal; pub mod ggml_file; pub mod gguf_file; pub mod k_quants; #[cfg(feature = "metal")] pub mo...
candle/candle-core/src/quantized/mod.rs/0
{ "file_path": "candle/candle-core/src/quantized/mod.rs", "repo_id": "candle", "token_count": 9685 }
27
use anyhow::Result; use candle_core::{test_device, test_utils, Device, IndexOp, Tensor}; /* This test is based on the following script. import torch torch.manual_seed(4242) t = torch.randn((1, 4, 5)) w = torch.randn((2, 4, 3)) print(t.flatten()) print(w.flatten()) res = torch.nn.functional.conv1d(t, w) print(res.flat...
candle/candle-core/tests/conv_tests.rs/0
{ "file_path": "candle/candle-core/tests/conv_tests.rs", "repo_id": "candle", "token_count": 23453 }
28
#![allow(unused)] use anyhow::{Context, Result}; use std::io::Write; use std::path::PathBuf; struct KernelDirectories { kernel_glob: &'static str, rust_target: &'static str, include_dirs: &'static [&'static str], } const KERNEL_DIRS: [KernelDirectories; 1] = [KernelDirectories { kernel_glob: "examples...
candle/candle-examples/build.rs/0
{ "file_path": "candle/candle-examples/build.rs", "repo_id": "candle", "token_count": 391 }
29
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use anyhow::Error as E; use clap::Parser; use candle::{DType, Device, Tensor}; use candle_nn::{ops::softmax, VarBuilder}; use candle_transformers::models::clip; use tokenizers::Tokenizer; #[derive(Parser...
candle/candle-examples/examples/clip/main.rs/0
{ "file_path": "candle/candle-examples/examples/clip/main.rs", "repo_id": "candle", "token_count": 2490 }
30
// This example illustrates how to implement custom operations. These operations can provide their // own forward pass (CPU and GPU versions) as well as their backward pass. // // In this example we add the RMS normalization operation and implement it for f32. #[cfg(feature = "mkl")] extern crate intel_mkl_src; #[rus...
candle/candle-examples/examples/custom-ops/main.rs/0
{ "file_path": "candle/candle-examples/examples/custom-ops/main.rs", "repo_id": "candle", "token_count": 1534 }
31
# candle-efficientvit [EfficientViT: Memory Efficient Vision Transformer with Cascaded Group Attention](https://arxiv.org/abs/2305.07027). This candle implementation uses a pre-trained EfficientViT (from Microsoft Research Asia) network for inference. The classification head has been trained on the ImageNet dataset and...
candle/candle-examples/examples/efficientvit/README.md/0
{ "file_path": "candle/candle-examples/examples/efficientvit/README.md", "repo_id": "candle", "token_count": 273 }
32
# candle-gemma: 2b and 7b LLMs from Google DeepMind [Gemma](https://ai.google.dev/gemma/docs) is a collection of lightweight open models published by Google Deepmind with a 2b and a 7b variant for the first version, and a 2b and a 9b variant for v2. ## Running the example ```bash $ cargo run --example gemma --featur...
candle/candle-examples/examples/gemma/README.md/0
{ "file_path": "candle/candle-examples/examples/gemma/README.md", "repo_id": "candle", "token_count": 441 }
33
// https://github.com/karpathy/llama2.c #[cfg(feature = "accelerate")] extern crate accelerate_src; #[cfg(feature = "mkl")] extern crate intel_mkl_src; use candle_transformers::models::llama2_c as model; use candle_transformers::models::llama2_c_weights as weights; use candle_transformers::models::quantized_llama2_c...
candle/candle-examples/examples/llama2-c/main.rs/0
{ "file_path": "candle/candle-examples/examples/llama2-c/main.rs", "repo_id": "candle", "token_count": 6082 }
34
from pathlib import Path import warnings from transformers import AutoTokenizer from transformers.convert_slow_tokenizer import SpmConverter, requires_backends, import_protobuf class MarianConverter(SpmConverter): def __init__(self, *args, index: int = 0): requires_backends(self, "protobuf") supe...
candle/candle-examples/examples/marian-mt/python/convert_slow_tokenizer.py/0
{ "file_path": "candle/candle-examples/examples/marian-mt/python/convert_slow_tokenizer.py", "repo_id": "candle", "token_count": 990 }
35
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use clap::{Parser, ValueEnum}; use candle::{DType, IndexOp, D}; use candle_nn::{Module, VarBuilder}; use candle_transformers::models::mobilenetv4; #[derive(Clone, Copy, Debug, ValueEnum)] enum Which { ...
candle/candle-examples/examples/mobilenetv4/main.rs/0
{ "file_path": "candle/candle-examples/examples/mobilenetv4/main.rs", "repo_id": "candle", "token_count": 1442 }
36
## Using ONNX models in Candle This example demonstrates how to run [ONNX](https://github.com/onnx/onnx) based models in Candle. It contains small variants of two models, [SqueezeNet](https://arxiv.org/pdf/1602.07360.pdf) (default) and [EfficientNet](https://arxiv.org/pdf/1905.11946.pdf). You can run the examples wi...
candle/candle-examples/examples/onnx/README.md/0
{ "file_path": "candle/candle-examples/examples/onnx/README.md", "repo_id": "candle", "token_count": 832 }
37
# candle-quantized-phi Candle implementation of various quantized Phi models. ## Running an example ```bash $ cargo run --example quantized-phi --release -- --prompt "The best thing about coding in rust is " > - it's memory safe (without you having to worry too much) > - the borrow checker is really smart and will...
candle/candle-examples/examples/quantized-phi/README.md/0
{ "file_path": "candle/candle-examples/examples/quantized-phi/README.md", "repo_id": "candle", "token_count": 251 }
38
import gymnasium as gym import numpy as np from collections import deque from PIL import Image from multiprocessing import Process, Pipe # atari_wrappers.py class NoopResetEnv(gym.Wrapper): def __init__(self, env, noop_max=30): """Sample initial states by taking random number of no-ops on reset. No...
candle/candle-examples/examples/reinforcement-learning/atari_wrappers.py/0
{ "file_path": "candle/candle-examples/examples/reinforcement-learning/atari_wrappers.py", "repo_id": "candle", "token_count": 4740 }
39
# candle-segformer - [HuggingFace Segformer Model Card][segformer] - [`mit-b0` - An encoder only pretrained model][encoder] - [`segformer-b0-finetuned-ade-512-512` - A fine tuned model for segmentation][ade512] ## How to run the example If you want you can use the example images from this [pull request][pr], downloa...
candle/candle-examples/examples/segformer/README.md/0
{ "file_path": "candle/candle-examples/examples/segformer/README.md", "repo_id": "candle", "token_count": 383 }
40
# candle-stable-diffusion-3: Candle Implementation of Stable Diffusion 3/3.5 ![](assets/stable-diffusion-3.jpg) *A cute rusty robot holding a candle torch in its hand, with glowing neon text \"LETS GO RUSTY\" displayed on its chest, bright background, high quality, 4k*, generated by Stable Diffusion 3 Medium Stable ...
candle/candle-examples/examples/stable-diffusion-3/README.md/0
{ "file_path": "candle/candle-examples/examples/stable-diffusion-3/README.md", "repo_id": "candle", "token_count": 1343 }
41
#[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::t5; use anyhow::{Error as E, Result}; use candle::{DType, Device, Tensor}; use candle_nn::VarBuilder; use candle_transformers::g...
candle/candle-examples/examples/t5/main.rs/0
{ "file_path": "candle/candle-examples/examples/t5/main.rs", "repo_id": "candle", "token_count": 6911 }
42
#[cfg(feature = "accelerate")] extern crate accelerate_src; #[cfg(feature = "mkl")] extern crate intel_mkl_src; use anyhow::{Error as E, Result}; use candle::{Device, IndexOp, Tensor}; use candle_nn::{ops::softmax, VarBuilder}; use clap::{Parser, ValueEnum}; use hf_hub::{api::sync::Api, Repo, RepoType}; use rand::{di...
candle/candle-examples/examples/whisper-microphone/main.rs/0
{ "file_path": "candle/candle-examples/examples/whisper-microphone/main.rs", "repo_id": "candle", "token_count": 12460 }
43
use candle::{DType, Device, IndexOp, Result, Tensor}; use candle_nn::{batch_norm, conv2d, conv2d_no_bias, Func, Module, VarBuilder}; use std::collections::BTreeMap; use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::Path; #[derive(Debug)] struct Block { block_type: String, parameters: BTreeMa...
candle/candle-examples/examples/yolo-v3/darknet.rs/0
{ "file_path": "candle/candle-examples/examples/yolo-v3/darknet.rs", "repo_id": "candle", "token_count": 5418 }
44
pub mod audio; pub mod bs1770; pub mod coco_classes; pub mod imagenet; pub mod token_output_stream; pub mod wav; use candle::utils::{cuda_is_available, metal_is_available}; use candle::{Device, Result, Tensor}; pub fn device(cpu: bool) -> Result<Device> { if cpu { Ok(Device::Cpu) } else if cuda_is_avai...
candle/candle-examples/src/lib.rs/0
{ "file_path": "candle/candle-examples/src/lib.rs", "repo_id": "candle", "token_count": 2878 }
45
/****************************************************************************** * Copyright (c) 2024, Tri Dao. ******************************************************************************/ #pragma once #include "cute/tensor.hpp" #include "cutlass/cutlass.h" #include "cutlass/layout/layout.h" #include <cutlass/nu...
candle/candle-flash-attn/kernels/kernel_traits.h/0
{ "file_path": "candle/candle-flash-attn/kernels/kernel_traits.h", "repo_id": "candle", "token_count": 7903 }
46
#include "binary_op_macros.cuh" #include<stdint.h> #if __CUDA_ARCH__ >= 800 BINARY_OP(__nv_bfloat16, badd_bf16, x + y) BINARY_OP(__nv_bfloat16, bdiv_bf16, x / y) BINARY_OP(__nv_bfloat16, bmul_bf16, x * y) BINARY_OP(__nv_bfloat16, bsub_bf16, x - y) BINARY_OP(__nv_bfloat16, bmaximum_bf16, maxg(x, y)) BINARY_OP(__nv_bflo...
candle/candle-kernels/src/binary.cu/0
{ "file_path": "candle/candle-kernels/src/binary.cu", "repo_id": "candle", "token_count": 2950 }
47
# candle-metal-kernels This crate contains Metal kernels used from candle.
candle/candle-metal-kernels/README.md/0
{ "file_path": "candle/candle-metal-kernels/README.md", "repo_id": "candle", "token_count": 18 }
48
// Imported from https://github.com/ggerganov/llama.cpp/blob/master/ggml-metal.metal #include <metal_stdlib> using namespace metal; #define SWAP(x, y) { auto tmp = (x); (x) = (y); (y) = tmp; } #define SORT_ASC 1 #define SORT_DESC 0 template<int order, typename T> METAL_FUNC void argsort( device const T ...
candle/candle-metal-kernels/src/sort.metal/0
{ "file_path": "candle/candle-metal-kernels/src/sort.metal", "repo_id": "candle", "token_count": 1748 }
49
pub(crate) mod conv; pub(crate) mod layer_norm; pub(crate) mod softmax; use candle::{Device, Result}; pub(crate) trait BenchDevice { fn sync(&self) -> Result<()>; fn bench_name<S: Into<String>>(&self, name: S) -> String; } impl BenchDevice for Device { fn sync(&self) -> Result<()> { match self {...
candle/candle-nn/benches/benchmarks/mod.rs/0
{ "file_path": "candle/candle-nn/benches/benchmarks/mod.rs", "repo_id": "candle", "token_count": 1006 }
50
//! Loss Calculations //! use candle::{Result, Tensor}; /// The negative log likelihood loss. /// /// Arguments /// /// * [inp]: The input tensor of dimensions `N, C` where `N` is the batch size and `C` the number /// of categories. This is expected to contain log probabilities. /// * [target]: The ground truth labe...
candle/candle-nn/src/loss.rs/0
{ "file_path": "candle/candle-nn/src/loss.rs", "repo_id": "candle", "token_count": 1021 }
51
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use candle::test_utils::{to_vec0_round, to_vec2_round}; use anyhow::Result; use candle::{DType, Device, Tensor, Var}; use candle_nn::{AdamW, Linear, Module, Optimizer, ParamsAdamW, SGD}; #[test] fn sgd_op...
candle/candle-nn/tests/optim.rs/0
{ "file_path": "candle/candle-nn/tests/optim.rs", "repo_id": "candle", "token_count": 2568 }
52
from candle.utils import load_safetensors, save_gguf, load_gguf from candle.models.bert import BertModel, Config import json from candle import Tensor from tqdm import tqdm from dataclasses import fields import os import time from huggingface_hub import hf_hub_download from transformers import BertTokenizer, AutoModel...
candle/candle-pyo3/e5.py/0
{ "file_path": "candle/candle-pyo3/e5.py", "repo_id": "candle", "token_count": 1778 }
53
import candle from candle import Tensor _UNSIGNED_DTYPES = set([str(candle.u8), str(candle.u32)]) def _assert_tensor_metadata( actual: Tensor, expected: Tensor, check_device: bool = True, check_dtype: bool = True, check_layout: bool = True, check_stride: bool = False, ): if check_device:...
candle/candle-pyo3/py_src/candle/testing/__init__.py/0
{ "file_path": "candle/candle-pyo3/py_src/candle/testing/__init__.py", "repo_id": "candle", "token_count": 854 }
54
import candle from candle import Tensor from candle.testing import assert_equal, assert_almost_equal import pytest @pytest.mark.parametrize("dtype", [candle.f32, candle.f64, candle.f16, candle.u32, candle.u8, candle.i64]) def test_assert_equal_asserts_correctly(dtype: candle.DType): a = Tensor([1, 2, 3]).to(dtype...
candle/candle-pyo3/tests/bindings/test_testing.py/0
{ "file_path": "candle/candle-pyo3/tests/bindings/test_testing.py", "repo_id": "candle", "token_count": 476 }
55
//! Chinese contrastive Language-Image Pre-Training //! //! Chinese contrastive Language-Image Pre-Training (CLIP) is an architecture trained on //! pairs of images with related texts. //! //! - 💻 [Chinese-CLIP](https://github.com/OFA-Sys/Chinese-CLIP) //! - 💻 [HF](https://github.com/huggingface/transformers/blob/5af...
candle/candle-transformers/src/models/chinese_clip/text_model.rs/0
{ "file_path": "candle/candle-transformers/src/models/chinese_clip/text_model.rs", "repo_id": "candle", "token_count": 9007 }
56
//! Implementation of DistilBert, a distilled version of BERT. //! //! See: //! - ["DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter"](https://arxiv.org/abs/1910.01108) //! use super::with_tracing::{layer_norm, linear, LayerNorm, Linear}; use candle::{DType, Device, Result, Tensor}; use can...
candle/candle-transformers/src/models/distilbert.rs/0
{ "file_path": "candle/candle-transformers/src/models/distilbert.rs", "repo_id": "candle", "token_count": 7003 }
57
use crate::models::glm4::EosTokenId; use crate::{ models::with_tracing::{linear_b, linear_no_bias, Linear, RmsNorm}, utils::repeat_kv, }; use candle::{DType, Device, IndexOp, Module, Result, Tensor, D}; use candle_nn::{kv_cache::KvCache, Activation, VarBuilder}; use std::sync::Arc; #[derive(Debug, Clone, serde...
candle/candle-transformers/src/models/glm4_new.rs/0
{ "file_path": "candle/candle-transformers/src/models/glm4_new.rs", "repo_id": "candle", "token_count": 6724 }
58
//! mimi model //! //! [Mimi](https://huggingface.co/kyutai/mimi) is a state of the art audio //! compression model using an encoder/decoder architecture with residual vector //! quantization. The candle implementation supports streaming meaning that it's //! possible to encode or decode a stream of audio tokens on the...
candle/candle-transformers/src/models/mimi/mod.rs/0
{ "file_path": "candle/candle-transformers/src/models/mimi/mod.rs", "repo_id": "candle", "token_count": 480 }
59
//! ModernBERT //! //! ModernBERT is a modernized bidirectional encoder-only Transformer model. //! - [Arxiv](https://arxiv.org/abs/2412.13663) "Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference" //! - Upstream [Github repo](https://git...
candle/candle-transformers/src/models/modernbert.rs/0
{ "file_path": "candle/candle-transformers/src/models/modernbert.rs", "repo_id": "candle", "token_count": 7630 }
60
//! Recurrent Gemma model implementation with quantization support. //! //! Gemma is a large language model optimized for efficiency. //! This implementation provides quantization for reduced memory and compute. //! //! Key characteristics: //! - Recurrent blocks with gated recurrent units //! - Convolution and attenti...
candle/candle-transformers/src/models/quantized_recurrent_gemma.rs/0
{ "file_path": "candle/candle-transformers/src/models/quantized_recurrent_gemma.rs", "repo_id": "candle", "token_count": 7858 }
61
use candle::{IndexOp, Result, Tensor}; use candle_nn::{Module, VarBuilder}; use super::transformer::TwoWayTransformer; #[derive(Debug)] struct MlpMaskDecoder { layers: Vec<super::Linear>, sigmoid_output: bool, span: tracing::Span, } impl MlpMaskDecoder { fn new( input_dim: usize, hidd...
candle/candle-transformers/src/models/segment_anything/mask_decoder.rs/0
{ "file_path": "candle/candle-transformers/src/models/segment_anything/mask_decoder.rs", "repo_id": "candle", "token_count": 4213 }
62
#![allow(dead_code)] //! # Diffusion pipelines and models //! //! Noise schedulers can be used to set the trade-off between //! inference speed and quality. use candle::{Result, Tensor}; pub trait SchedulerConfig: std::fmt::Debug + Send + Sync { fn build(&self, inference_steps: usize) -> Result<Box<dyn Scheduler>>...
candle/candle-transformers/src/models/stable_diffusion/schedulers.rs/0
{ "file_path": "candle/candle-transformers/src/models/stable_diffusion/schedulers.rs", "repo_id": "candle", "token_count": 940 }
63
pub mod text_generation;
candle/candle-transformers/src/pipelines/mod.rs/0
{ "file_path": "candle/candle-transformers/src/pipelines/mod.rs", "repo_id": "candle", "token_count": 7 }
64
## Running [BLIP Image Captioning](https://huggingface.co/Salesforce/blip-image-captioning-large) Example ### Vanilla JS and WebWorkers To build and test the UI made in Vanilla JS and WebWorkers, first we need to build the WASM library: ```bash sh build-lib.sh ``` This will bundle the library under `./build` and we ...
candle/candle-wasm-examples/blip/README.md/0
{ "file_path": "candle/candle-wasm-examples/blip/README.md", "repo_id": "candle", "token_count": 220 }
65