text
stringlengths
5
631k
id
stringlengths
14
178
metadata
dict
__index_level_0__
int64
0
647
# 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/qwen2_audio/test_modeling_qwen2_audio.py/0
{ "file_path": "transformers/tests/models/qwen2_audio/test_modeling_qwen2_audio.py", "repo_id": "transformers", "token_count": 7775 }
566
# 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/models/rag/test_tokenization_rag.py/0
{ "file_path": "transformers/tests/models/rag/test_tokenization_rag.py", "repo_id": "transformers", "token_count": 3143 }
567
# Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
transformers/tests/models/seamless_m4t/test_modeling_seamless_m4t.py/0
{ "file_path": "transformers/tests/models/seamless_m4t/test_modeling_seamless_m4t.py", "repo_id": "transformers", "token_count": 20993 }
568
# Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
transformers/tests/models/smolvlm/test_processing_smolvlm.py/0
{ "file_path": "transformers/tests/models/smolvlm/test_processing_smolvlm.py", "repo_id": "transformers", "token_count": 11855 }
569
# Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
transformers/tests/models/timm_wrapper/test_modeling_timm_wrapper.py/0
{ "file_path": "transformers/tests/models/timm_wrapper/test_modeling_timm_wrapper.py", "repo_id": "transformers", "token_count": 7732 }
570
# Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
transformers/tests/models/unispeech_sat/test_modeling_unispeech_sat.py/0
{ "file_path": "transformers/tests/models/unispeech_sat/test_modeling_unispeech_sat.py", "repo_id": "transformers", "token_count": 17217 }
571
# Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
transformers/tests/models/vipllava/test_modeling_vipllava.py/0
{ "file_path": "transformers/tests/models/vipllava/test_modeling_vipllava.py", "repo_id": "transformers", "token_count": 5162 }
572
# Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
transformers/tests/models/vitdet/test_modeling_vitdet.py/0
{ "file_path": "transformers/tests/models/vitdet/test_modeling_vitdet.py", "repo_id": "transformers", "token_count": 5109 }
573
# coding=utf-8 # Copyright 2025 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/vjepa2/test_modeling_vjepa2.py/0
{ "file_path": "transformers/tests/models/vjepa2/test_modeling_vjepa2.py", "repo_id": "transformers", "token_count": 5524 }
574
# Copyright 2021 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/wav2vec2_with_lm/test_processing_wav2vec2_with_lm.py/0
{ "file_path": "transformers/tests/models/wav2vec2_with_lm/test_processing_wav2vec2_with_lm.py", "repo_id": "transformers", "token_count": 9099 }
575
# 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/models/xlm/test_modeling_xlm.py/0
{ "file_path": "transformers/tests/models/xlm/test_modeling_xlm.py", "repo_id": "transformers", "token_count": 8956 }
576
# 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/yolos/test_modeling_yolos.py/0
{ "file_path": "transformers/tests/models/yolos/test_modeling_yolos.py", "repo_id": "transformers", "token_count": 6843 }
577
# 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": 17111 }
578
# 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_text2text_generation.py/0
{ "file_path": "transformers/tests/pipelines/test_pipelines_text2text_generation.py", "repo_id": "transformers", "token_count": 2284 }
579
# Copyright 2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/quantization/finegrained_fp8/test_fp8.py/0
{ "file_path": "transformers/tests/quantization/finegrained_fp8/test_fp8.py", "repo_id": "transformers", "token_count": 4902 }
580
#!/usr/bin/env python # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
transformers/tests/sagemaker/scripts/pytorch/run_glue_model_parallelism.py/0
{ "file_path": "transformers/tests/sagemaker/scripts/pytorch/run_glue_model_parallelism.py", "repo_id": "transformers", "token_count": 9566 }
581
# 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 }
582
# 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 }
583
# 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 }
584
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 }
585
#!/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 }
586
# Copyright 2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/utils/collated_reports.py/0
{ "file_path": "transformers/utils/collated_reports.py", "repo_id": "transformers", "token_count": 3047 }
587
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/utils/get_test_info.py/0
{ "file_path": "transformers/utils/get_test_info.py", "repo_id": "transformers", "token_count": 2737 }
588
"""A simple script to set flexibly CUDA_VISIBLE_DEVICES in GitHub Actions CI workflow files.""" import argparse import os if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--test_folder", type=str, default=None, help="The test folder name of t...
transformers/utils/set_cuda_devices_for_ci.py/0
{ "file_path": "transformers/utils/set_cuda_devices_for_ci.py", "repo_id": "transformers", "token_count": 338 }
589
{ "opsets": { "1": [ "Abs", "Add", "AddV2", "ArgMax", "ArgMin", "AvgPool", "AvgPool3D", "BatchMatMul", "BatchMatMulV2", "BatchToSpaceND", "BiasAdd", "BiasAddV1", ...
transformers/utils/tf_ops/onnx.json/0
{ "file_path": "transformers/utils/tf_ops/onnx.json", "repo_id": "transformers", "token_count": 4081 }
590
# Best of N sampling: Alternative ways to get better model output without RL based fine-tuning Within the extras module is the `best-of-n` sampler class that serves as an alternative method of generating better model output. As to how it fares against the RL based fine-tuning, please look in the `examples` directory ...
trl/docs/source/best_of_n.md/0
{ "file_path": "trl/docs/source/best_of_n.md", "repo_id": "trl", "token_count": 841 }
591
# Examples of using peft with trl to finetune 8-bit models with Low Rank Adaption (LoRA) The notebooks and scripts in this 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 }
592
# 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/rlaif-v.py/0
{ "file_path": "trl/examples/datasets/rlaif-v.py", "repo_id": "trl", "token_count": 1597 }
593
# Copyright 2020-2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
trl/examples/research_projects/stack_llama/scripts/merge_peft_adapter.py/0
{ "file_path": "trl/examples/research_projects/stack_llama/scripts/merge_peft_adapter.py", "repo_id": "trl", "token_count": 817 }
594
# 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/rloo_tldr.py/0
{ "file_path": "trl/examples/scripts/rloo/rloo_tldr.py", "repo_id": "trl", "token_count": 2280 }
595
# 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_multi_image_dataset.py/0
{ "file_path": "trl/scripts/generate_zen_multi_image_dataset.py", "repo_id": "trl", "token_count": 8319 }
596
# 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": 9159 }
597
# 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_modeling_value_head.py/0
{ "file_path": "trl/tests/test_modeling_value_head.py", "repo_id": "trl", "token_count": 9757 }
598
# 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/extras/profiling.py/0
{ "file_path": "trl/trl/extras/profiling.py", "repo_id": "trl", "token_count": 1184 }
599
# 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/cpo_trainer.py/0
{ "file_path": "trl/trl/trainer/cpo_trainer.py", "repo_id": "trl", "token_count": 23609 }
600
# 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/nash_md_trainer.py/0
{ "file_path": "trl/trl/trainer/nash_md_trainer.py", "repo_id": "trl", "token_count": 10493 }
601
# 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/xpo_config.py/0
{ "file_path": "trl/trl/trainer/xpo_config.py", "repo_id": "trl", "token_count": 569 }
602
import os import sys import re from huggingface_hub import InferenceClient # Get the directory containing the current script script_dir = os.path.dirname(os.path.abspath(__file__)) default_inp_dir = os.path.join(script_dir, '..', 'units/en') default_model = "deepseek-ai/DeepSeek-R1" default_client = InferenceClient( ...
agents-course/scripts/translation.py/0
{ "file_path": "agents-course/scripts/translation.py", "repo_id": "agents-course", "token_count": 1471 }
0
# Launching Your Pokémon Battle Agent It's now time to battle! ⚡️ ## **Battle the Stream Agent!** If you don't feel like building your own agent, and you're just curious about the battle potential of agents in pokémon. We are hosting an automated livestream on [twitch](https://www.twitch.tv/jofthomas) <iframe src=...
agents-course/units/en/bonus-unit3/launching_agent_battle.mdx/0
{ "file_path": "agents-course/units/en/bonus-unit3/launching_agent_battle.mdx", "repo_id": "agents-course", "token_count": 867 }
1
# Quick Self-Check (ungraded) [[quiz2]] What?! Another Quiz? We know, we know, ... 😅 But this short, ungraded quiz is here to **help you reinforce key concepts you've just learned**. This quiz covers Large Language Models (LLMs), message systems, and tools; essential components for understanding and building AI ag...
agents-course/units/en/unit1/quiz2.mdx/0
{ "file_path": "agents-course/units/en/unit1/quiz2.mdx", "repo_id": "agents-course", "token_count": 754 }
2
# What are components in LlamaIndex? Remember Alfred, our helpful butler agent from Unit 1? To assist us effectively, Alfred needs to understand our requests and **prepare, find and use relevant information to help complete tasks.** This is where LlamaIndex's components come in. While LlamaIndex has many components, ...
agents-course/units/en/unit2/llama-index/components.mdx/0
{ "file_path": "agents-course/units/en/unit2/llama-index/components.mdx", "repo_id": "agents-course", "token_count": 3527 }
3
<CourseFloatingBanner classNames="absolute z-10 right-0 top-0" notebooks={[ {label: "Google Colab", value: "https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/unit2/smolagents/tool_calling_agents.ipynb"}, ]} askForHelpUrl="http://hf.co/join/discord" /> # Writing...
agents-course/units/en/unit2/smolagents/tool_calling_agents.mdx/0
{ "file_path": "agents-course/units/en/unit2/smolagents/tool_calling_agents.mdx", "repo_id": "agents-course", "token_count": 1170 }
4
# What is GAIA? [GAIA](https://huggingface.co/papers/2311.12983) is a **benchmark designed to evaluate AI assistants on real-world tasks** that require a combination of core capabilities—such as reasoning, multimodal understanding, web browsing, and proficient tool use. It was introduced in the paper _"[GAIA: A Bench...
agents-course/units/en/unit4/what-is-gaia.mdx/0
{ "file_path": "agents-course/units/en/unit4/what-is-gaia.mdx", "repo_id": "agents-course", "token_count": 1041 }
5
# Live 1: Como funciona el curso y preguntas y respuestas En esta primera sesión en vivo del Curso de Agentes, explicamos **como funciona el curso** (alcance, unidades, desafios y más) y respondimos tus preguntas. <iframe width="560" height="315" src="https://www.youtube.com/embed/iLVyYDbdSmM?si=TCX5Ai3uZuKLXq45" tit...
agents-course/units/es/communication/live1.mdx/0
{ "file_path": "agents-course/units/es/communication/live1.mdx", "repo_id": "agents-course", "token_count": 272 }
6
# ¿Qué son las Herramientas? <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-check-2.jpg" alt="Planificación de la Unidad 1"/> Un aspecto crucial de los Agentes de IA es su capacidad para realizar **acciones**. Como vimos, esto sucede a través del uso de **Herram...
agents-course/units/es/unit1/tools.mdx/0
{ "file_path": "agents-course/units/es/unit1/tools.mdx", "repo_id": "agents-course", "token_count": 5845 }
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/vision_agents.ipynb"}, ]} /> # Agentes de Visión con smolagents <Tip warni...
agents-course/units/es/unit2/smolagents/vision_agents.mdx/0
{ "file_path": "agents-course/units/es/unit2/smolagents/vision_agents.mdx", "repo_id": "agents-course", "token_count": 4929 }
8
- title: Unité 0. Bienvenue dans le cours sections: - local: unit0/introduction title: Bienvenue dans le cours 🤗 - local: unit0/onboarding title: Embarquement - local: unit0/discord101 title: (Optionnel) Introduction à Discord - title: Live 1. Comment fonctionne le cours et Q&R sections: - loc...
agents-course/units/fr/_toctree.yml/0
{ "file_path": "agents-course/units/fr/_toctree.yml", "repo_id": "agents-course", "token_count": 2359 }
9
# (Optionnel) Introduction à Discord [[discord-101]] <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit0/discord-etiquette.jpg" alt="L'étiquette sur Discord" width="100%"/> Ce guide est conçu pour vous aider à débuter sur Discord, une plateforme de chat gratuite très prisée dan...
agents-course/units/fr/unit0/discord101.mdx/0
{ "file_path": "agents-course/units/fr/unit0/discord101.mdx", "repo_id": "agents-course", "token_count": 1016 }
10
# Créons notre premier agent avec smolagents Dans la section précédente, nous avons appris comment créer des agents à partir de zéro en utilisant du code Python, et nous avons **vu à quel point ce processus peut être fastidieux**. Heureusement, de nombreuses bibliothèques d'agents simplifient ce travail en **se charge...
agents-course/units/fr/unit1/tutorial.mdx/0
{ "file_path": "agents-course/units/fr/unit1/tutorial.mdx", "repo_id": "agents-course", "token_count": 4376 }
11
# Introduction au *LlamaHub* ***LlamaHub* est un registre de centaines d'intégrations, d'*agents* et d'*outils* que vous pouvez utiliser dans LlamaIndex.** ![LlamaHub](https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/llama-index/llama-hub.png) Nous utiliserons diverses intégrations d...
agents-course/units/fr/unit2/llama-index/llama-hub.mdx/0
{ "file_path": "agents-course/units/fr/unit2/llama-index/llama-hub.mdx", "repo_id": "agents-course", "token_count": 834 }
12
![smolagents banner](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/smolagents/license_to_call.png) # Pourquoi utiliser smolagents Dans ce module, nous explorerons les avantages et les inconvénients de l'utilisation de [smolagents](https://huggingface.co/docs/smolagents/en/index), vous ...
agents-course/units/fr/unit2/smolagents/why_use_smolagents.mdx/0
{ "file_path": "agents-course/units/fr/unit2/smolagents/why_use_smolagents.mdx", "repo_id": "agents-course", "token_count": 1940 }
13
# AI 에이전트 코스에 오신걸 환영합니다 🤗 [[introduction]] <figure> <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit0/thumbnail.jpg" alt="AI Agents Course thumbnail" width="100%"/> <figcaption>이미지 배경은 <a href="https://scenario.com/">Scenario.com 을 활용하여 제작되었습니다.</a> </figcaption> </figure> ...
agents-course/units/ko/unit0/introduction.mdx/0
{ "file_path": "agents-course/units/ko/unit0/introduction.mdx", "repo_id": "agents-course", "token_count": 8065 }
14
# 에이전트란? [[what-is-an-agent]] <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-no-check.jpg" alt="Unit 1 planning"/> 이 섹션이 끝날 때 쯤이면, 여러분들은 에이전트의 개념과 AI에서의 응용 사례들을 이해하실 수 있을 것입니다. 에이전트가 무엇인지, 한 예시를 들어 설명하겠습니다. ## 큰 그림 : 에이전트 알프레드 (Alfred) [[the-big-picture-alfred...
agents-course/units/ko/unit1/what-are-agents.mdx/0
{ "file_path": "agents-course/units/ko/unit1/what-are-agents.mdx", "repo_id": "agents-course", "token_count": 7018 }
15
# Библиотека Фиктивного Агента <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-unit1sub3DONE.jpg" alt="Раздел 1 планирование"/> Этот курс не зависит от фреймворка, потому что мы хотим **сфокусироваться на концепции AI агентов и не увязнуть в специфике конкретного...
agents-course/units/ru-RU/unit1/dummy-agent-library.mdx/0
{ "file_path": "agents-course/units/ru-RU/unit1/dummy-agent-library.mdx", "repo_id": "agents-course", "token_count": 10899 }
16
# Giới thiệu ![Hình ảnh minh họa chương bổ trợ 1](https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/bonus-unit1/thumbnail.jpg) Chào mừng bạn đến với **chương bổ trợ đầu tiên** này, nơi ta sẽ học cách **tinh chỉnh (fine-tuning) Mô hình Ngôn ngữ Lớn (LLM) cho function calling**. Với LLMs, fun...
agents-course/units/vi/bonus-unit1/introduction.mdx/0
{ "file_path": "agents-course/units/vi/bonus-unit1/introduction.mdx", "repo_id": "agents-course", "token_count": 1951 }
17
# Kiểm tra nhanh tự đánh giá (không chấm điểm) [[quiz2]] Gì nữa? Lại Quiz á? Chúng mình biết, chúng mình biết... 😅 Nhưng bài kiểm tra ngắn không chấm điểm này giúp bạn **củng cố các khái niệm quan trọng vừa học**. Quiz này bao gồm Mô hình ngôn ngữ lơn (LLM), hệ thống tin nhắn và tools - những thành phần thiết yếu đ...
agents-course/units/vi/unit1/quiz2.mdx/0
{ "file_path": "agents-course/units/vi/unit1/quiz2.mdx", "repo_id": "agents-course", "token_count": 2043 }
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 支持**三种主要类型的推理智能体**: ![智能体类型](https://huggingface.co/datasets/agents-course/...
agents-course/units/zh-CN/unit2/llama-index/agents.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit2/llama-index/agents.mdx", "repo_id": "agents-course", "token_count": 3993 }
21
<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/retrieval_agents.ipynb"}, ]} /> # 构建智能驱动的 RAG 系统 <Tip> 您可以通过 <a href="http...
agents-course/units/zh-CN/unit2/smolagents/retrieval_agents.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit2/smolagents/retrieval_agents.mdx", "repo_id": "agents-course", "token_count": 4342 }
22
# 欢迎来到最后一个单元 [[介绍]] <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit4/thumbnail.jpg" alt="AI Agents Course thumbnail" width="100%"/> 欢迎来到课程的最后一个单元!🎉 到目前为止,您已经**在AI智能体方面建立了坚实的基础**,从理解其组件到创建自己的智能体。有了这些知识,您现在可以**构建强大的智能体**并在这个快速发展的领域中赶上潮流。 这个单元和应用您所学的知识有关。这是您的**最终动手项目**,完成它是您...
agents-course/units/zh-CN/unit4/introduction.mdx/0
{ "file_path": "agents-course/units/zh-CN/unit4/introduction.mdx", "repo_id": "agents-course", "token_count": 1024 }
23
# Candle Book The book uses [mdBook](https://github.com/rust-lang/mdBook) for building. ## Installation To install mdBook, run `cargo install mdbook`. More instructions can be found [here](https://rust-lang.github.io/mdBook/guide/installation.html). ## Viewing the book To view the book, run `mdbook serve --open ca...
candle/candle-book/CONTRIBUTING.md/0
{ "file_path": "candle/candle-book/CONTRIBUTING.md", "repo_id": "candle", "token_count": 140 }
24
# Hello world! We will now create the hello world of the ML world, building a model capable of solving MNIST dataset. Open `src/main.rs` and fill in this content: ```rust # extern crate candle_core; use candle_core::{Device, Result, Tensor}; struct Model { first: Tensor, second: Tensor, } impl Model { ...
candle/candle-book/src/guide/hello_world.md/0
{ "file_path": "candle/candle-book/src/guide/hello_world.md", "repo_id": "candle", "token_count": 2069 }
25
# Serialization
candle/candle-book/src/training/serialization.md/0
{ "file_path": "candle/candle-book/src/training/serialization.md", "repo_id": "candle", "token_count": 4 }
26
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, b: &Tensor, c: &Tensor) { a.where_cond(b, c).unwrap(); } const fn create_cond_arr<const N: usize>() -> ...
candle/candle-core/benches/benchmarks/where_cond.rs/0
{ "file_path": "candle/candle-core/benches/benchmarks/where_cond.rs", "repo_id": "candle", "token_count": 939 }
27
//! Implementation of Backend Fns for CPU use crate::backend::{BackendDevice, BackendStorage}; use crate::op::{BinaryOpT, CmpOp, ReduceOp, UnaryOpT}; use crate::{DType, Error, IntDType, Layout, Result, Shape, WithDType}; use float8::F8E4M3; use half::{bf16, f16}; use rayon::prelude::*; mod utils; pub use utils::{ ...
candle/candle-core/src/cpu_backend/mod.rs/0
{ "file_path": "candle/candle-core/src/cpu_backend/mod.rs", "repo_id": "candle", "token_count": 69775 }
28
//! ML framework for Rust //! //! ```rust //! use candle_core::{Tensor, DType, Device}; //! # use candle_core::Error; //! # fn main() -> Result<(), Error>{ //! //! let a = Tensor::arange(0f32, 6f32, &Device::Cpu)?.reshape((2, 3))?; //! let b = Tensor::arange(0f32, 12f32, &Device::Cpu)?.reshape((3, 4))?; //! let c = a.m...
candle/candle-core/src/lib.rs/0
{ "file_path": "candle/candle-core/src/lib.rs", "repo_id": "candle", "token_count": 1894 }
29
use super::k_quants::{ BlockQ2K, BlockQ3K, BlockQ4K, BlockQ4_0, BlockQ5K, BlockQ6K, BlockQ8K, BlockQ8_0, QK8_0, QK_K, }; use crate::Result; use byteorder::{ByteOrder, LittleEndian}; #[allow(unused_imports)] #[cfg(target_arch = "arm")] use core::arch::arm::*; #[allow(unused_imports)] #[cfg(target_arch = "aarch64")...
candle/candle-core/src/quantized/neon.rs/0
{ "file_path": "candle/candle-core/src/quantized/neon.rs", "repo_id": "candle", "token_count": 15290 }
30
use candle_core::backend::BackendStorage; use candle_core::cpu_backend; use candle_core::test_utils::to_vec1_round; use candle_core::{CpuStorage, CustomOp1, DType, Device, Error, Layout, Result, Shape, Tensor}; fn fwd<T: num_traits::Float>(v: T, alpha: f64) -> T { if v.is_sign_positive() { v } else { ...
candle/candle-core/tests/custom_op_tests.rs/0
{ "file_path": "candle/candle-core/tests/custom_op_tests.rs", "repo_id": "candle", "token_count": 2784 }
31
# candle-based Experimental, not instruction-tuned small LLM from the Hazy Research group, combining local and linear attention layers. [Blogpost](https://hazyresearch.stanford.edu/blog/2024-03-03-based) [Simple linear attention language models balance the recall-throughput tradeoff](https://arxiv.org/abs/2402.18668...
candle/candle-examples/examples/based/README.md/0
{ "file_path": "candle/candle-examples/examples/based/README.md", "repo_id": "candle", "token_count": 243 }
32
* candle-codegeex4_9b THUDM/CodeGeeX4 is a versatile model for all AI software development scenarios, including code completion, code interpreter, web search, function calling, repository-level Q&A and much more. - [[https://github.com/THUDM/CodeGeeX4][Github]] - [[https://codegeex.cn/][HomePage]] - [[https://huggingf...
candle/candle-examples/examples/codegeex4-9b/README.org/0
{ "file_path": "candle/candle-examples/examples/codegeex4-9b/README.org", "repo_id": "candle", "token_count": 1132 }
33
#[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::efficientvit; #[derive(Clone, Copy, Debug, ValueEnum)] enum Which { ...
candle/candle-examples/examples/efficientvit/main.rs/0
{ "file_path": "candle/candle-examples/examples/efficientvit/main.rs", "repo_id": "candle", "token_count": 1277 }
34
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use anyhow::{Error as E, Result}; use clap::Parser; use candle_transformers::models::gemma::{Config as Config1, Model as Model1}; use candle_transformers::models::gemma2::{Config as Config2, Model as Model...
candle/candle-examples/examples/gemma/main.rs/0
{ "file_path": "candle/candle-examples/examples/gemma/main.rs", "repo_id": "candle", "token_count": 6074 }
35
use crate::model::{Cache, Config, Llama}; use candle::{DType, Device, Result}; use candle_datasets::nlp::tinystories::{Dataset, DatasetRandomIter}; use candle_nn::Optimizer; fn valid_loss( dataset: &Dataset, model: &Llama, args: &crate::TrainingCmd, device: &Device, cache: &mut Cache, ) -> Result<f...
candle/candle-examples/examples/llama2-c/training.rs/0
{ "file_path": "candle/candle-examples/examples/llama2-c/training.rs", "repo_id": "candle", "token_count": 1144 }
36
# candle-mobileone [MobileOne: An Improved One millisecond Mobile Backbone](https://arxiv.org/abs/2206.04040). This candle implementation uses a pre-trained MobileOne network for inference. The classification head has been trained on the ImageNet dataset and returns the probabilities for the top-5 classes. ## Runnin...
candle/candle-examples/examples/mobileone/README.md/0
{ "file_path": "candle/candle-examples/examples/mobileone/README.md", "repo_id": "candle", "token_count": 254 }
37
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use candle::{IndexOp, D}; use candle_examples::save_image; use clap::{Parser, ValueEnum}; #[derive(Clone, Copy, Debug, ValueEnum)] enum Which { SqueezeNet, EfficientNet, EsrGan, } #[derive(Par...
candle/candle-examples/examples/onnx/main.rs/0
{ "file_path": "candle/candle-examples/examples/onnx/main.rs", "repo_id": "candle", "token_count": 1834 }
38
use std::collections::VecDeque; use candle::{DType, Device, Error, Module, Result, Tensor, Var}; use candle_nn::{ func, linear, sequential::seq, Activation, AdamW, Optimizer, ParamsAdamW, Sequential, VarBuilder, VarMap, }; use rand::{distr::Uniform, rng, Rng}; use super::gym_env::GymEnv; pub struct OuNoise {...
candle/candle-examples/examples/reinforcement-learning/ddpg.rs/0
{ "file_path": "candle/candle-examples/examples/reinforcement-learning/ddpg.rs", "repo_id": "candle", "token_count": 8545 }
39
[ { "index": 1, "color": "#787878", "label": "wall" }, { "index": 2, "color": "#B47878", "label": "building;edifice" }, { "index": 3, "color": "#06E6E6", "label": "sky" }, { "index": 4, "color": "#503232", "label": "floor;flooring" }, { "index": 5, ...
candle/candle-examples/examples/segformer/assets/labels.json/0
{ "file_path": "candle/candle-examples/examples/segformer/assets/labels.json", "repo_id": "candle", "token_count": 6397 }
40
def remove_prefix(text, prefix): return text[text.startswith(prefix) and len(prefix):] nps = {} for k, v in model.state_dict().items(): k = remove_prefix(k, 'module_list.') nps[k] = v.detach().numpy() np.savez('yolo-v3.ot', **nps)
candle/candle-examples/examples/yolo-v3/extract-weights.py/0
{ "file_path": "candle/candle-examples/examples/yolo-v3/extract-weights.py", "repo_id": "candle", "token_count": 98 }
41
/****************************************************************************** * Copyright (c) 2023, Tri Dao. ******************************************************************************/ #pragma once #include "cute/algorithm/copy.hpp" #include "cutlass/cutlass.h" #include "cutlass/layout/layout.h" #include <cu...
candle/candle-flash-attn/kernels/kernel_traits_sm90.h/0
{ "file_path": "candle/candle-flash-attn/kernels/kernel_traits_sm90.h", "repo_id": "candle", "token_count": 3269 }
42
#include "cuda_utils.cuh" #define BINARY_OP_OUT(TYPENAME, OUT_TYPENAME, FN_NAME, FUNC) \ extern "C" __global__ void FN_NAME( \ const size_t numel, \ const size_t num_dims, \ const size_t *dims_and_strides, \ const TYPENAME *lhs, \ const TYPENAME *rhs, \ OUT_TYPENAME *out \ ) { \ const size_...
candle/candle-kernels/src/binary_op_macros.cuh/0
{ "file_path": "candle/candle-kernels/src/binary_op_macros.cuh", "repo_id": "candle", "token_count": 1561 }
43
use anyhow::Result; use candle_metal_kernels::GemmDType; /// This example contains some simple benchmarks so that it's easy to run them in perf etc. use clap::{Parser, Subcommand}; use half::f16; fn run_gemm(f32: bool, n: usize) -> Result<()> { const WARMUP_ITERS: usize = 2; const MIN_DUR: f64 = 4.; let d...
candle/candle-metal-kernels/examples/metal_benchmarks.rs/0
{ "file_path": "candle/candle-metal-kernels/examples/metal_benchmarks.rs", "repo_id": "candle", "token_count": 1833 }
44
use crate::utils::{BufferOffset, EncoderProvider}; use crate::{set_params, DType, Kernels, MetalKernelError, Source}; use metal::{Buffer, ComputeCommandEncoderRef, Device, MTLResourceOptions, MTLSize}; #[allow(clippy::too_many_arguments)] pub fn call_arg_sort( device: &Device, ep: impl EncoderProvider, ker...
candle/candle-metal-kernels/src/sort.rs/0
{ "file_path": "candle/candle-metal-kernels/src/sort.rs", "repo_id": "candle", "token_count": 4875 }
45
use crate::benchmarks::{BenchDevice, BenchDeviceHandler}; use candle::{DType, Device, Tensor}; use candle_nn::ops::softmax_last_dim; use criterion::Throughput; use criterion::{black_box, criterion_group, Criterion}; use std::time::Instant; fn run(input: &Tensor) { let _ = softmax_last_dim(&input).unwrap(); } cons...
candle/candle-nn/benches/benchmarks/softmax.rs/0
{ "file_path": "candle/candle-nn/benches/benchmarks/softmax.rs", "repo_id": "candle", "token_count": 662 }
46
//! Tensor ops. //! use candle::{CpuStorage, DType, Layout, Module, Result, Shape, Tensor, D}; use rayon::prelude::*; /// Applies the softmax function to the input tensor, rescaling the element so that elements on /// a slice of fixed index on dimension `dim` are between 0 and 1 and sum to 1. /// /// ```rust /// use ...
candle/candle-nn/src/ops.rs/0
{ "file_path": "candle/candle-nn/src/ops.rs", "repo_id": "candle", "token_count": 24239 }
47
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use candle::{test_utils::to_vec2_round, DType, Device, Result, Tensor}; use candle_nn::RNN; /* The following test can be verified against PyTorch using the following snippet. import torch from torch import...
candle/candle-nn/tests/rnn.rs/0
{ "file_path": "candle/candle-nn/tests/rnn.rs", "repo_id": "candle", "token_count": 2010 }
48
import logging try: from .candle import * except ImportError as e: # If we are in development mode, or we did not bundle the DLLs, we try to locate them here # PyO3 wont give us any information about what DLLs are missing, so we can only try to load # the DLLs and re-import the module logging.warni...
candle/candle-pyo3/py_src/candle/__init__.py/0
{ "file_path": "candle/candle-pyo3/py_src/candle/__init__.py", "repo_id": "candle", "token_count": 919 }
49
from typing import TypeVar, Union, Sequence _T = TypeVar("_T") _ArrayLike = Union[ _T, Sequence[_T], Sequence[Sequence[_T]], Sequence[Sequence[Sequence[_T]]], Sequence[Sequence[Sequence[Sequence[_T]]]], ] CPU: str = "cpu" CUDA: str = "cuda" Device = TypeVar("Device", CPU, CUDA) Scalar = Union[i...
candle/candle-pyo3/py_src/candle/typing/__init__.py/0
{ "file_path": "candle/candle-pyo3/py_src/candle/typing/__init__.py", "repo_id": "candle", "token_count": 166 }
50
from candle import Tensor from candle import rand import pytest def test_absolute_shapes_are_valid(): a = rand((10, 20)) assert a.shape == (10, 20) b = rand(10, 20) assert b.shape == (10, 20) pytest.raises(OverflowError, lambda: rand((10, 20, -1))) pytest.raises(OverflowError, lambda: rand(-1...
candle/candle-pyo3/tests/native/test_shape.py/0
{ "file_path": "candle/candle-pyo3/tests/native/test_shape.py", "repo_id": "candle", "token_count": 385 }
51
//! 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) //! - 💻 [GH](https://github.com/huggingface/transformers/blob/5af...
candle/candle-transformers/src/models/chinese_clip/vision_model.rs/0
{ "file_path": "candle/candle-transformers/src/models/chinese_clip/vision_model.rs", "repo_id": "candle", "token_count": 6262 }
52
//! Implementation of EfficientBert, an efficient variant of BERT for computer vision tasks. //! //! See: //! - ["EfficientBERT: Progressively Searching Multilayer Perceptron Architectures for BERT"](https://arxiv.org/abs/2201.00462) //! use candle::{Context, Result, Tensor, D}; use candle_nn as nn; use nn::{Module, Va...
candle/candle-transformers/src/models/efficientnet.rs/0
{ "file_path": "candle/candle-transformers/src/models/efficientnet.rs", "repo_id": "candle", "token_count": 5204 }
53
//! Granite is a Long Context Transformer Language Model. //! //! A high performance transformer model optimized for efficient processing //! of very long context sequences //! //! Based on implementation from [Nod.ai](https://github.com/nod-ai/granite) use super::with_tracing::{linear_no_bias as linear, Linear, RmsNo...
candle/candle-transformers/src/models/granite.rs/0
{ "file_path": "candle/candle-transformers/src/models/granite.rs", "repo_id": "candle", "token_count": 8417 }
54
// Copyright (c) Kyutai, all rights reserved. // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. use candle::{IndexOp, Layout, Result, Shape, Tensor, D}; use candle_nn::{linear, Linear, VarBuilder}; struct CodebookEncode; impl candle::CustomOp2 f...
candle/candle-transformers/src/models/mimi/quantization.rs/0
{ "file_path": "candle/candle-transformers/src/models/mimi/quantization.rs", "repo_id": "candle", "token_count": 6873 }
55
//! MoonDream Model vision-to-text //! //! //! Moondream is a computer-vision model that can answer real-world questions about images. //! It's lightweight with only 1.6B parameters, enabling it to run on mobile phones and edge devices. //! [MoonDream Original Implementation](https://github.com/vikhyat/moondream) //! /...
candle/candle-transformers/src/models/moondream.rs/0
{ "file_path": "candle/candle-transformers/src/models/moondream.rs", "repo_id": "candle", "token_count": 4946 }
56
use candle::{DType, Device, Module, Result, Tensor, D}; use candle_nn::{linear_b, rms_norm, Linear, RmsNorm, VarBuilder}; fn default_act() -> candle_nn::Activation { candle_nn::Activation::Silu } fn default_hidden_size() -> usize { 1024 } fn default_intermediate_size() -> usize { 4096 } fn default_num_c...
candle/candle-transformers/src/models/pixtral/vision_model.rs/0
{ "file_path": "candle/candle-transformers/src/models/pixtral/vision_model.rs", "repo_id": "candle", "token_count": 5788 }
57
//! Segment Anything Model (SAM) //! //! SAM is an architecture for image segmentation, capable of segmenting any object //! in an image based on prompts like points or boxes. //! This model provides a robust and fast image segmentation pipeline that can be tweaked via //! some prompting (requesting some points to be i...
candle/candle-transformers/src/models/segment_anything/mod.rs/0
{ "file_path": "candle/candle-transformers/src/models/segment_anything/mod.rs", "repo_id": "candle", "token_count": 1721 }
58
//! 2D UNet Denoising Models //! //! The 2D Unet models take as input a noisy sample and the current diffusion //! timestep and return a denoised version of the input. use super::embeddings::{TimestepEmbedding, Timesteps}; use super::unet_2d_blocks::*; use crate::models::with_tracing::{conv2d, Conv2d}; use candle::{Res...
candle/candle-transformers/src/models/stable_diffusion/unet_2d.rs/0
{ "file_path": "candle/candle-transformers/src/models/stable_diffusion/unet_2d.rs", "repo_id": "candle", "token_count": 8419 }
59
import init, { Model } from "./build/m.js"; async function fetchArrayBuffer(url, cacheFile = true) { if (!cacheFile) return new Uint8Array(await (await fetch(url)).arrayBuffer()); const cacheName = "blip-candle-cache"; const cache = await caches.open(cacheName); const cachedResponse = await cache.match(url); ...
candle/candle-wasm-examples/blip/blipWorker.js/0
{ "file_path": "candle/candle-wasm-examples/blip/blipWorker.js", "repo_id": "candle", "token_count": 815 }
60
mod app; pub mod model; pub mod worker; pub use app::App; pub use worker::Worker;
candle/candle-wasm-examples/llama2-c/src/lib.rs/0
{ "file_path": "candle/candle-wasm-examples/llama2-c/src/lib.rs", "repo_id": "candle", "token_count": 29 }
61
use candle::{DType, Device, Tensor}; use candle_nn::VarBuilder; use candle_transformers::generation::LogitsProcessor; use candle_transformers::models::mixformer::{Config, MixFormerSequentialForCausalLM as MixFormer}; use candle_transformers::models::quantized_mixformer::MixFormerSequentialForCausalLM as QMixFormer; use...
candle/candle-wasm-examples/phi/src/bin/m.rs/0
{ "file_path": "candle/candle-wasm-examples/phi/src/bin/m.rs", "repo_id": "candle", "token_count": 2646 }
62