presight-fairseq2 0.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fairseq2/__init__.py +50 -0
- fairseq2/assets/__init__.py +90 -0
- fairseq2/assets/__main__.py +11 -0
- fairseq2/assets/card.py +205 -0
- fairseq2/assets/cards/datasets/librilight.yaml +8 -0
- fairseq2/assets/cards/datasets/librispeech.yaml +20 -0
- fairseq2/assets/cards/datasets/openeft.yaml +8 -0
- fairseq2/assets/cards/models/jepa.yaml +39 -0
- fairseq2/assets/cards/models/llama.yaml +210 -0
- fairseq2/assets/cards/models/mistral.yaml +21 -0
- fairseq2/assets/cards/models/nllb.yaml +247 -0
- fairseq2/assets/cards/models/qwen.yaml +177 -0
- fairseq2/assets/cards/models/s2t_conformer.yaml +33 -0
- fairseq2/assets/cards/models/s2t_transformer.yaml +79 -0
- fairseq2/assets/cards/models/wav2vec2.yaml +32 -0
- fairseq2/assets/cli.py +219 -0
- fairseq2/assets/dirs.py +142 -0
- fairseq2/assets/download_manager.py +766 -0
- fairseq2/assets/metadata_provider.py +454 -0
- fairseq2/assets/store.py +207 -0
- fairseq2/checkpoint/__init__.py +44 -0
- fairseq2/checkpoint/hg.py +124 -0
- fairseq2/checkpoint/manager.py +884 -0
- fairseq2/checkpoint/model_metadata.py +175 -0
- fairseq2/cluster.py +195 -0
- fairseq2/composition/__init__.py +27 -0
- fairseq2/composition/assets.py +141 -0
- fairseq2/composition/datasets.py +77 -0
- fairseq2/composition/extensions.py +53 -0
- fairseq2/composition/lib.py +177 -0
- fairseq2/composition/models.py +381 -0
- fairseq2/composition/tokenizers.py +173 -0
- fairseq2/data/__init__.py +5 -0
- fairseq2/data/_memory.py +41 -0
- fairseq2/data/audio.py +70 -0
- fairseq2/data/data_pipeline.py +717 -0
- fairseq2/data/image.py +39 -0
- fairseq2/data/parquet/__init__.py +122 -0
- fairseq2/data/parquet/arrow_transform.py +312 -0
- fairseq2/data/parquet/fragment_loading/__init__.py +13 -0
- fairseq2/data/parquet/fragment_loading/builder.py +211 -0
- fairseq2/data/parquet/fragment_loading/config.py +160 -0
- fairseq2/data/parquet/fragment_streaming/__init__.py +18 -0
- fairseq2/data/parquet/fragment_streaming/builder.py +128 -0
- fairseq2/data/parquet/fragment_streaming/config.py +183 -0
- fairseq2/data/parquet/fragment_streaming/primitives.py +570 -0
- fairseq2/data/parquet/table_bucketing/__init__.py +10 -0
- fairseq2/data/parquet/table_bucketing/builder.py +145 -0
- fairseq2/data/parquet/table_bucketing/config.py +129 -0
- fairseq2/data/parquet/table_bucketing/primitives.py +189 -0
- fairseq2/data/parquet/utils.py +256 -0
- fairseq2/data/text/__init__.py +13 -0
- fairseq2/data/text/converters.py +89 -0
- fairseq2/data/text/reader.py +44 -0
- fairseq2/data/tokenizers/__init__.py +32 -0
- fairseq2/data/tokenizers/char.py +24 -0
- fairseq2/data/tokenizers/family.py +200 -0
- fairseq2/data/tokenizers/hg.py +262 -0
- fairseq2/data/tokenizers/hub.py +186 -0
- fairseq2/data/tokenizers/ref.py +30 -0
- fairseq2/data/tokenizers/sentencepiece.py +293 -0
- fairseq2/data/tokenizers/tiktoken.py +232 -0
- fairseq2/data/tokenizers/tokenizer.py +114 -0
- fairseq2/data/tokenizers/vocab_info.py +39 -0
- fairseq2/data/utils.py +71 -0
- fairseq2/data_type.py +27 -0
- fairseq2/datasets/__init__.py +25 -0
- fairseq2/datasets/batch.py +664 -0
- fairseq2/datasets/data_reader.py +200 -0
- fairseq2/datasets/family.py +168 -0
- fairseq2/datasets/hub.py +127 -0
- fairseq2/device.py +249 -0
- fairseq2/early_stopper.py +35 -0
- fairseq2/error.py +40 -0
- fairseq2/file_system.py +182 -0
- fairseq2/gang.py +1104 -0
- fairseq2/generation/__init__.py +19 -0
- fairseq2/generation/beam_search/__init__.py +21 -0
- fairseq2/generation/beam_search/algo.py +107 -0
- fairseq2/generation/beam_search/generator.py +936 -0
- fairseq2/generation/generator.py +173 -0
- fairseq2/generation/sampling/__init__.py +17 -0
- fairseq2/generation/sampling/generator.py +896 -0
- fairseq2/generation/sampling/sampler.py +104 -0
- fairseq2/generation/step_processor.py +176 -0
- fairseq2/generation/text.py +356 -0
- fairseq2/io.py +175 -0
- fairseq2/logging.py +68 -0
- fairseq2/metrics/__init__.py +19 -0
- fairseq2/metrics/aggregation.py +79 -0
- fairseq2/metrics/bag.py +145 -0
- fairseq2/metrics/common.py +201 -0
- fairseq2/metrics/formatters.py +114 -0
- fairseq2/metrics/recorders/__init__.py +30 -0
- fairseq2/metrics/recorders/composite.py +31 -0
- fairseq2/metrics/recorders/descriptor.py +39 -0
- fairseq2/metrics/recorders/jsonl.py +139 -0
- fairseq2/metrics/recorders/log.py +84 -0
- fairseq2/metrics/recorders/recorder.py +40 -0
- fairseq2/metrics/recorders/tensorboard.py +113 -0
- fairseq2/metrics/recorders/wandb.py +81 -0
- fairseq2/metrics/text/__init__.py +12 -0
- fairseq2/metrics/text/bleu.py +101 -0
- fairseq2/metrics/text/chrf.py +76 -0
- fairseq2/metrics/text/wer.py +122 -0
- fairseq2/model_checkpoint/__init__.py +61 -0
- fairseq2/model_checkpoint/basic.py +100 -0
- fairseq2/model_checkpoint/common.py +209 -0
- fairseq2/model_checkpoint/delegating.py +83 -0
- fairseq2/model_checkpoint/loader.py +92 -0
- fairseq2/model_checkpoint/native.py +227 -0
- fairseq2/model_checkpoint/safetensors.py +136 -0
- fairseq2/models/__init__.py +28 -0
- fairseq2/models/asr.py +80 -0
- fairseq2/models/clm.py +101 -0
- fairseq2/models/conformer/__init__.py +12 -0
- fairseq2/models/conformer/block.py +196 -0
- fairseq2/models/conformer/convolution.py +183 -0
- fairseq2/models/family.py +668 -0
- fairseq2/models/feature_extractor.py +40 -0
- fairseq2/models/hub.py +787 -0
- fairseq2/models/jepa/__init__.py +20 -0
- fairseq2/models/jepa/classifier/__init__.py +33 -0
- fairseq2/models/jepa/classifier/config.py +56 -0
- fairseq2/models/jepa/classifier/factory.py +140 -0
- fairseq2/models/jepa/classifier/hub.py +18 -0
- fairseq2/models/jepa/classifier/model.py +229 -0
- fairseq2/models/jepa/config.py +158 -0
- fairseq2/models/jepa/factory.py +283 -0
- fairseq2/models/jepa/hub.py +13 -0
- fairseq2/models/jepa/interop.py +86 -0
- fairseq2/models/jepa/model.py +57 -0
- fairseq2/models/llama/__init__.py +38 -0
- fairseq2/models/llama/checkpoint.py +163 -0
- fairseq2/models/llama/config.py +272 -0
- fairseq2/models/llama/factory.py +344 -0
- fairseq2/models/llama/hub.py +21 -0
- fairseq2/models/llama/interop.py +218 -0
- fairseq2/models/llama/sharder.py +33 -0
- fairseq2/models/llama/tokenizer.py +291 -0
- fairseq2/models/llama4/__init__.py +31 -0
- fairseq2/models/llama4/config.py +106 -0
- fairseq2/models/llama4/factory.py +156 -0
- fairseq2/models/llama4/hub.py +21 -0
- fairseq2/models/llama4/interop.py +152 -0
- fairseq2/models/llama4/moe.py +157 -0
- fairseq2/models/llama4/sharder.py +92 -0
- fairseq2/models/llama4/tokenizer.py +141 -0
- fairseq2/models/mistral/__init__.py +25 -0
- fairseq2/models/mistral/config.py +62 -0
- fairseq2/models/mistral/factory.py +178 -0
- fairseq2/models/mistral/hub.py +22 -0
- fairseq2/models/mistral/interop.py +36 -0
- fairseq2/models/mistral/tokenizer.py +21 -0
- fairseq2/models/nllb/__init__.py +21 -0
- fairseq2/models/nllb/config.py +87 -0
- fairseq2/models/nllb/factory.py +245 -0
- fairseq2/models/nllb/hub.py +21 -0
- fairseq2/models/nllb/interop.py +75 -0
- fairseq2/models/nllb/tokenizer.py +157 -0
- fairseq2/models/qwen/__init__.py +23 -0
- fairseq2/models/qwen/config.py +239 -0
- fairseq2/models/qwen/factory.py +281 -0
- fairseq2/models/qwen/hub.py +21 -0
- fairseq2/models/qwen/interop.py +80 -0
- fairseq2/models/qwen/sharder.py +31 -0
- fairseq2/models/qwen/tokenizer.py +181 -0
- fairseq2/models/s2t_conformer/__init__.py +29 -0
- fairseq2/models/s2t_conformer/config.py +70 -0
- fairseq2/models/s2t_conformer/factory.py +320 -0
- fairseq2/models/s2t_conformer/hub.py +18 -0
- fairseq2/models/s2t_conformer/interop.py +66 -0
- fairseq2/models/s2t_transformer/__init__.py +47 -0
- fairseq2/models/s2t_transformer/config.py +106 -0
- fairseq2/models/s2t_transformer/factory.py +265 -0
- fairseq2/models/s2t_transformer/feature_extractor.py +133 -0
- fairseq2/models/s2t_transformer/frontend.py +103 -0
- fairseq2/models/s2t_transformer/hub.py +29 -0
- fairseq2/models/s2t_transformer/interop.py +52 -0
- fairseq2/models/s2t_transformer/tokenizer.py +150 -0
- fairseq2/models/seq2seq.py +114 -0
- fairseq2/models/transformer/__init__.py +153 -0
- fairseq2/models/transformer/ac.py +19 -0
- fairseq2/models/transformer/attention_bias.py +409 -0
- fairseq2/models/transformer/decoder.py +217 -0
- fairseq2/models/transformer/decoder_layer.py +298 -0
- fairseq2/models/transformer/encoder.py +206 -0
- fairseq2/models/transformer/encoder_layer.py +204 -0
- fairseq2/models/transformer/experts.py +352 -0
- fairseq2/models/transformer/ffn.py +403 -0
- fairseq2/models/transformer/frontend.py +130 -0
- fairseq2/models/transformer/fsdp.py +37 -0
- fairseq2/models/transformer/model.py +288 -0
- fairseq2/models/transformer/multihead_attention.py +974 -0
- fairseq2/models/transformer/norm_order.py +21 -0
- fairseq2/models/transformer/sdpa/__init__.py +0 -0
- fairseq2/models/transformer/sdpa/base.py +58 -0
- fairseq2/models/transformer/sdpa/default.py +45 -0
- fairseq2/models/transformer/sdpa/flash2.py +125 -0
- fairseq2/models/transformer/sdpa/flash3.py +514 -0
- fairseq2/models/transformer/sdpa/naive.py +110 -0
- fairseq2/models/transformer/sdpa/relative.py +294 -0
- fairseq2/models/transformer/sdpa/shaw.py +207 -0
- fairseq2/models/transformer/sdpa/torch.py +100 -0
- fairseq2/models/transformer_lm/__init__.py +33 -0
- fairseq2/models/transformer_lm/ac.py +18 -0
- fairseq2/models/transformer_lm/compiler.py +17 -0
- fairseq2/models/transformer_lm/decoder.py +160 -0
- fairseq2/models/transformer_lm/decoder_layer.py +209 -0
- fairseq2/models/transformer_lm/fsdp.py +34 -0
- fairseq2/models/transformer_lm/model.py +215 -0
- fairseq2/models/utils/__init__.py +0 -0
- fairseq2/models/utils/ac.py +23 -0
- fairseq2/models/utils/checkpoint.py +180 -0
- fairseq2/models/utils/fsdp.py +22 -0
- fairseq2/models/utils/hg_export.py +282 -0
- fairseq2/models/vit/__init__.py +18 -0
- fairseq2/models/vit/feature_extractor.py +137 -0
- fairseq2/models/vit/frontend.py +83 -0
- fairseq2/models/w2vbert/__init__.py +22 -0
- fairseq2/models/w2vbert/config.py +121 -0
- fairseq2/models/w2vbert/factory.py +55 -0
- fairseq2/models/w2vbert/hub.py +13 -0
- fairseq2/models/w2vbert/interop.py +66 -0
- fairseq2/models/w2vbert/model.py +214 -0
- fairseq2/models/wav2vec2/__init__.py +63 -0
- fairseq2/models/wav2vec2/ac.py +18 -0
- fairseq2/models/wav2vec2/asr/__init__.py +34 -0
- fairseq2/models/wav2vec2/asr/ac.py +18 -0
- fairseq2/models/wav2vec2/asr/config.py +135 -0
- fairseq2/models/wav2vec2/asr/factory.py +96 -0
- fairseq2/models/wav2vec2/asr/fsdp.py +34 -0
- fairseq2/models/wav2vec2/asr/hub.py +15 -0
- fairseq2/models/wav2vec2/asr/interop.py +63 -0
- fairseq2/models/wav2vec2/asr/model.py +174 -0
- fairseq2/models/wav2vec2/config.py +234 -0
- fairseq2/models/wav2vec2/factory.py +354 -0
- fairseq2/models/wav2vec2/feature_extractor.py +377 -0
- fairseq2/models/wav2vec2/frontend.py +223 -0
- fairseq2/models/wav2vec2/fsdp.py +34 -0
- fairseq2/models/wav2vec2/hub.py +15 -0
- fairseq2/models/wav2vec2/interop.py +64 -0
- fairseq2/models/wav2vec2/masker.py +188 -0
- fairseq2/models/wav2vec2/model.py +417 -0
- fairseq2/models/wav2vec2/position_encoder.py +289 -0
- fairseq2/models/wav2vec2/vector_quantizer.py +218 -0
- fairseq2/nn/__init__.py +55 -0
- fairseq2/nn/batch_layout.py +233 -0
- fairseq2/nn/ddp.py +152 -0
- fairseq2/nn/embedding.py +441 -0
- fairseq2/nn/fsdp/__init__.py +40 -0
- fairseq2/nn/fsdp/common.py +93 -0
- fairseq2/nn/fsdp/fsdp1.py +272 -0
- fairseq2/nn/fsdp/fsdp2.py +299 -0
- fairseq2/nn/fsdp/unified.py +142 -0
- fairseq2/nn/functional/__init__.py +9 -0
- fairseq2/nn/functional/cross_entropy.py +160 -0
- fairseq2/nn/incremental_state.py +152 -0
- fairseq2/nn/normalization.py +269 -0
- fairseq2/nn/position_encoder.py +925 -0
- fairseq2/nn/projection.py +577 -0
- fairseq2/nn/residual.py +116 -0
- fairseq2/nn/sharded.py +75 -0
- fairseq2/nn/utils/__init__.py +0 -0
- fairseq2/nn/utils/grad.py +169 -0
- fairseq2/nn/utils/mask.py +205 -0
- fairseq2/nn/utils/module.py +536 -0
- fairseq2/nn/utils/padding.py +51 -0
- fairseq2/ops/__init__.py +10 -0
- fairseq2/ops/shape.py +44 -0
- fairseq2/ops/tensor_parallel.py +134 -0
- fairseq2/optim/__init__.py +10 -0
- fairseq2/optim/fp16_loss_scaler.py +315 -0
- fairseq2/optim/lr_schedulers/__init__.py +25 -0
- fairseq2/optim/lr_schedulers/cosine_annealing.py +146 -0
- fairseq2/optim/lr_schedulers/lr_scheduler.py +65 -0
- fairseq2/optim/lr_schedulers/myle.py +81 -0
- fairseq2/optim/lr_schedulers/noam.py +71 -0
- fairseq2/optim/lr_schedulers/polynomial_decay.py +105 -0
- fairseq2/optim/lr_schedulers/tri_stage.py +116 -0
- fairseq2/optim/optimizer.py +46 -0
- fairseq2/profilers/__init__.py +12 -0
- fairseq2/profilers/composite.py +35 -0
- fairseq2/profilers/profiler.py +49 -0
- fairseq2/profilers/torch.py +77 -0
- fairseq2/py.typed +0 -0
- fairseq2/recipe/__init__.py +30 -0
- fairseq2/recipe/base.py +175 -0
- fairseq2/recipe/cli.py +861 -0
- fairseq2/recipe/component.py +117 -0
- fairseq2/recipe/composition/__init__.py +27 -0
- fairseq2/recipe/composition/beam_search.py +78 -0
- fairseq2/recipe/composition/config.py +59 -0
- fairseq2/recipe/composition/data_parallel.py +48 -0
- fairseq2/recipe/composition/dataset.py +32 -0
- fairseq2/recipe/composition/device_stat.py +26 -0
- fairseq2/recipe/composition/eval_model.py +69 -0
- fairseq2/recipe/composition/evaluator.py +31 -0
- fairseq2/recipe/composition/generator.py +31 -0
- fairseq2/recipe/composition/lr_schedulers.py +154 -0
- fairseq2/recipe/composition/metric_recorders.py +170 -0
- fairseq2/recipe/composition/model.py +58 -0
- fairseq2/recipe/composition/optim.py +69 -0
- fairseq2/recipe/composition/profilers.py +25 -0
- fairseq2/recipe/composition/root.py +261 -0
- fairseq2/recipe/composition/sampling.py +90 -0
- fairseq2/recipe/composition/seq_generator.py +36 -0
- fairseq2/recipe/composition/tokenizer.py +42 -0
- fairseq2/recipe/composition/trainer.py +101 -0
- fairseq2/recipe/config.py +1372 -0
- fairseq2/recipe/dataset.py +39 -0
- fairseq2/recipe/error.py +192 -0
- fairseq2/recipe/evaluator.py +329 -0
- fairseq2/recipe/generator.py +285 -0
- fairseq2/recipe/internal/__init__.py +0 -0
- fairseq2/recipe/internal/asset_config.py +88 -0
- fairseq2/recipe/internal/assets.py +64 -0
- fairseq2/recipe/internal/beam_search.py +121 -0
- fairseq2/recipe/internal/cluster.py +33 -0
- fairseq2/recipe/internal/compile.py +31 -0
- fairseq2/recipe/internal/config.py +34 -0
- fairseq2/recipe/internal/config_preparer.py +116 -0
- fairseq2/recipe/internal/data_parallel.py +414 -0
- fairseq2/recipe/internal/dataset.py +141 -0
- fairseq2/recipe/internal/device_stat.py +33 -0
- fairseq2/recipe/internal/eval_model.py +282 -0
- fairseq2/recipe/internal/evaluator.py +48 -0
- fairseq2/recipe/internal/gang.py +154 -0
- fairseq2/recipe/internal/generator.py +45 -0
- fairseq2/recipe/internal/log.py +213 -0
- fairseq2/recipe/internal/logging.py +122 -0
- fairseq2/recipe/internal/lr_schedulers.py +264 -0
- fairseq2/recipe/internal/metric_recorders.py +226 -0
- fairseq2/recipe/internal/model.py +534 -0
- fairseq2/recipe/internal/optim.py +92 -0
- fairseq2/recipe/internal/output_dir.py +37 -0
- fairseq2/recipe/internal/profilers.py +38 -0
- fairseq2/recipe/internal/sampling.py +121 -0
- fairseq2/recipe/internal/seq_generator.py +52 -0
- fairseq2/recipe/internal/sweep_tag.py +218 -0
- fairseq2/recipe/internal/task.py +69 -0
- fairseq2/recipe/internal/tokenizer.py +180 -0
- fairseq2/recipe/internal/torch.py +205 -0
- fairseq2/recipe/internal/trainer.py +282 -0
- fairseq2/recipe/model.py +117 -0
- fairseq2/recipe/optim.py +229 -0
- fairseq2/recipe/run.py +203 -0
- fairseq2/recipe/task.py +28 -0
- fairseq2/recipe/tokenizer.py +81 -0
- fairseq2/recipe/trainer.py +1202 -0
- fairseq2/recipe/validator.py +443 -0
- fairseq2/runtime/__init__.py +0 -0
- fairseq2/runtime/closable.py +13 -0
- fairseq2/runtime/config_registry.py +115 -0
- fairseq2/runtime/dependency.py +497 -0
- fairseq2/runtime/lazy.py +28 -0
- fairseq2/runtime/lookup.py +25 -0
- fairseq2/sharder.py +202 -0
- fairseq2/typing.py +31 -0
- fairseq2/utils/__init__.py +0 -0
- fairseq2/utils/argparse.py +142 -0
- fairseq2/utils/config.py +184 -0
- fairseq2/utils/device_stat.py +83 -0
- fairseq2/utils/env.py +109 -0
- fairseq2/utils/gc.py +77 -0
- fairseq2/utils/progress.py +76 -0
- fairseq2/utils/rich.py +165 -0
- fairseq2/utils/rng.py +146 -0
- fairseq2/utils/stopwatch.py +92 -0
- fairseq2/utils/structured.py +602 -0
- fairseq2/utils/tensor.py +29 -0
- fairseq2/utils/threading.py +73 -0
- fairseq2/utils/uri.py +68 -0
- fairseq2/utils/validation.py +281 -0
- fairseq2/utils/version.py +33 -0
- fairseq2/utils/warn.py +25 -0
- fairseq2/utils/yaml.py +75 -0
- fairseq2/world_info.py +81 -0
- presight_fairseq2-0.6.1.dist-info/LICENSE +21 -0
- presight_fairseq2-0.6.1.dist-info/METADATA +56 -0
- presight_fairseq2-0.6.1.dist-info/RECORD +383 -0
- presight_fairseq2-0.6.1.dist-info/WHEEL +5 -0
- presight_fairseq2-0.6.1.dist-info/top_level.txt +1 -0
fairseq2/__init__.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from collections.abc import Callable
|
|
10
|
+
|
|
11
|
+
import fairseq2n # Report any fairseq2n initialization error eagerly.
|
|
12
|
+
|
|
13
|
+
import fairseq2.runtime.dependency
|
|
14
|
+
from fairseq2.error import InvalidOperationError
|
|
15
|
+
from fairseq2.runtime.dependency import DependencyContainer, DependencyResolver
|
|
16
|
+
|
|
17
|
+
__version__ = "0.6.1"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
_in_call: bool = False
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def init_fairseq2(
|
|
24
|
+
*, extras: Callable[[DependencyContainer], None] | None = None
|
|
25
|
+
) -> DependencyResolver:
|
|
26
|
+
from fairseq2.composition import _register_library
|
|
27
|
+
|
|
28
|
+
global _in_call
|
|
29
|
+
|
|
30
|
+
if fairseq2.runtime.dependency._resolver is not None:
|
|
31
|
+
raise InvalidOperationError("`init_fairseq2()` is already called.")
|
|
32
|
+
|
|
33
|
+
if _in_call:
|
|
34
|
+
raise InvalidOperationError("`init_fairseq2()` cannot be called recursively.")
|
|
35
|
+
|
|
36
|
+
_in_call = True
|
|
37
|
+
|
|
38
|
+
container = DependencyContainer()
|
|
39
|
+
|
|
40
|
+
try:
|
|
41
|
+
_register_library(container)
|
|
42
|
+
|
|
43
|
+
if extras is not None:
|
|
44
|
+
extras(container)
|
|
45
|
+
finally:
|
|
46
|
+
_in_call = False
|
|
47
|
+
|
|
48
|
+
fairseq2.runtime.dependency._resolver = container
|
|
49
|
+
|
|
50
|
+
return container
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from fairseq2.assets.card import AssetCard as AssetCard
|
|
10
|
+
from fairseq2.assets.card import AssetCardError as AssetCardError
|
|
11
|
+
from fairseq2.assets.card import AssetConfigLoader as AssetConfigLoader
|
|
12
|
+
from fairseq2.assets.card import StandardAssetConfigLoader as StandardAssetConfigLoader
|
|
13
|
+
from fairseq2.assets.dirs import AssetDirectoryAccessor as AssetDirectoryAccessor
|
|
14
|
+
from fairseq2.assets.dirs import (
|
|
15
|
+
StandardAssetDirectoryAccessor as StandardAssetDirectoryAccessor,
|
|
16
|
+
)
|
|
17
|
+
from fairseq2.assets.download_manager import AssetDownloadError as AssetDownloadError
|
|
18
|
+
from fairseq2.assets.download_manager import (
|
|
19
|
+
AssetDownloadManager as AssetDownloadManager,
|
|
20
|
+
)
|
|
21
|
+
from fairseq2.assets.download_manager import (
|
|
22
|
+
DelegatingAssetDownloadManager as DelegatingAssetDownloadManager,
|
|
23
|
+
)
|
|
24
|
+
from fairseq2.assets.download_manager import HuggingFaceHub as HuggingFaceHub
|
|
25
|
+
from fairseq2.assets.download_manager import (
|
|
26
|
+
LocalAssetDownloadManager as LocalAssetDownloadManager,
|
|
27
|
+
)
|
|
28
|
+
from fairseq2.assets.download_manager import (
|
|
29
|
+
StandardAssetDownloadManager as StandardAssetDownloadManager,
|
|
30
|
+
)
|
|
31
|
+
from fairseq2.assets.metadata_provider import AssetMetadataError as AssetMetadataError
|
|
32
|
+
from fairseq2.assets.metadata_provider import (
|
|
33
|
+
AssetMetadataFileLoader as AssetMetadataFileLoader,
|
|
34
|
+
)
|
|
35
|
+
from fairseq2.assets.metadata_provider import (
|
|
36
|
+
AssetMetadataProvider as AssetMetadataProvider,
|
|
37
|
+
)
|
|
38
|
+
from fairseq2.assets.metadata_provider import AssetMetadataSource as AssetMetadataSource
|
|
39
|
+
from fairseq2.assets.metadata_provider import (
|
|
40
|
+
AssetSourceNotFoundError as AssetSourceNotFoundError,
|
|
41
|
+
)
|
|
42
|
+
from fairseq2.assets.metadata_provider import (
|
|
43
|
+
CachedAssetMetadataProvider as CachedAssetMetadataProvider,
|
|
44
|
+
)
|
|
45
|
+
from fairseq2.assets.metadata_provider import (
|
|
46
|
+
FileAssetMetadataLoader as FileAssetMetadataLoader,
|
|
47
|
+
)
|
|
48
|
+
from fairseq2.assets.metadata_provider import (
|
|
49
|
+
FileAssetMetadataSource as FileAssetMetadataSource,
|
|
50
|
+
)
|
|
51
|
+
from fairseq2.assets.metadata_provider import (
|
|
52
|
+
InMemoryAssetMetadataSource as InMemoryAssetMetadataSource,
|
|
53
|
+
)
|
|
54
|
+
from fairseq2.assets.metadata_provider import (
|
|
55
|
+
PackageAssetMetadataLoader as PackageAssetMetadataLoader,
|
|
56
|
+
)
|
|
57
|
+
from fairseq2.assets.metadata_provider import (
|
|
58
|
+
PackageAssetMetadataSource as PackageAssetMetadataSource,
|
|
59
|
+
)
|
|
60
|
+
from fairseq2.assets.metadata_provider import PackageFileLister as PackageFileLister
|
|
61
|
+
from fairseq2.assets.metadata_provider import (
|
|
62
|
+
StandardFileAssetMetadataLoader as StandardFileAssetMetadataLoader,
|
|
63
|
+
)
|
|
64
|
+
from fairseq2.assets.metadata_provider import (
|
|
65
|
+
StandardPackageAssetMetadataLoader as StandardPackageAssetMetadataLoader,
|
|
66
|
+
)
|
|
67
|
+
from fairseq2.assets.metadata_provider import (
|
|
68
|
+
StandardPackageFileLister as StandardPackageFileLister,
|
|
69
|
+
)
|
|
70
|
+
from fairseq2.assets.metadata_provider import (
|
|
71
|
+
WellKnownAssetMetadataSource as WellKnownAssetMetadataSource,
|
|
72
|
+
)
|
|
73
|
+
from fairseq2.assets.metadata_provider import (
|
|
74
|
+
YamlAssetMetadataFileLoader as YamlAssetMetadataFileLoader,
|
|
75
|
+
)
|
|
76
|
+
from fairseq2.assets.metadata_provider import (
|
|
77
|
+
canonicalize_asset_name as canonicalize_asset_name,
|
|
78
|
+
)
|
|
79
|
+
from fairseq2.assets.metadata_provider import (
|
|
80
|
+
load_in_memory_asset_metadata as load_in_memory_asset_metadata,
|
|
81
|
+
)
|
|
82
|
+
from fairseq2.assets.metadata_provider import (
|
|
83
|
+
sanitize_base_asset_name as sanitize_base_asset_name,
|
|
84
|
+
)
|
|
85
|
+
from fairseq2.assets.store import AssetEnvironmentDetector as AssetEnvironmentDetector
|
|
86
|
+
from fairseq2.assets.store import AssetEnvironmentResolver as AssetEnvironmentResolver
|
|
87
|
+
from fairseq2.assets.store import AssetNotFoundError as AssetNotFoundError
|
|
88
|
+
from fairseq2.assets.store import AssetStore as AssetStore
|
|
89
|
+
from fairseq2.assets.store import StandardAssetStore as StandardAssetStore
|
|
90
|
+
from fairseq2.assets.store import get_asset_store as get_asset_store
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from fairseq2.assets.cli import _main
|
|
10
|
+
|
|
11
|
+
_main()
|
fairseq2/assets/card.py
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from abc import ABC, abstractmethod
|
|
10
|
+
from collections.abc import Mapping
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from typing import TypeVar, final
|
|
13
|
+
|
|
14
|
+
from typing_extensions import override
|
|
15
|
+
|
|
16
|
+
from fairseq2.utils.config import ConfigDirectiveError, ConfigMerger, ConfigProcessor
|
|
17
|
+
from fairseq2.utils.structured import StructureError, ValueConverter
|
|
18
|
+
from fairseq2.utils.uri import Uri
|
|
19
|
+
|
|
20
|
+
T = TypeVar("T", bool, int, float, str)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@final
|
|
24
|
+
class AssetCard:
|
|
25
|
+
"""Holds information about an asset."""
|
|
26
|
+
|
|
27
|
+
def __init__(
|
|
28
|
+
self, name: str, metadata: Mapping[str, object], base: AssetCard | None = None
|
|
29
|
+
) -> None:
|
|
30
|
+
self._name = name
|
|
31
|
+
self._metadata = metadata
|
|
32
|
+
self._base = base
|
|
33
|
+
|
|
34
|
+
def field(self, name: str) -> AssetCardField:
|
|
35
|
+
field = self.maybe_get_field(name)
|
|
36
|
+
if field is None:
|
|
37
|
+
msg = f"{self._name} asset card does not have a field named {name}."
|
|
38
|
+
|
|
39
|
+
raise AssetCardError(self._name, msg)
|
|
40
|
+
|
|
41
|
+
return field
|
|
42
|
+
|
|
43
|
+
def maybe_get_field(self, name: str) -> AssetCardField | None:
|
|
44
|
+
card: AssetCard | None = self
|
|
45
|
+
|
|
46
|
+
while card is not None:
|
|
47
|
+
try:
|
|
48
|
+
value = card.metadata[name]
|
|
49
|
+
except KeyError:
|
|
50
|
+
pass
|
|
51
|
+
else:
|
|
52
|
+
return AssetCardField(name, self, value)
|
|
53
|
+
|
|
54
|
+
card = card.base
|
|
55
|
+
|
|
56
|
+
return None
|
|
57
|
+
|
|
58
|
+
def has_field(self, name: str) -> bool:
|
|
59
|
+
card: AssetCard | None = self
|
|
60
|
+
|
|
61
|
+
while card is not None:
|
|
62
|
+
if name in card.metadata:
|
|
63
|
+
return True
|
|
64
|
+
|
|
65
|
+
card = card.base
|
|
66
|
+
|
|
67
|
+
return False
|
|
68
|
+
|
|
69
|
+
def __repr__(self) -> str:
|
|
70
|
+
return f"{self._name}={self._metadata}"
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def name(self) -> str:
|
|
74
|
+
return self._name
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def metadata(self) -> Mapping[str, object]:
|
|
78
|
+
return self._metadata
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def base(self) -> AssetCard | None:
|
|
82
|
+
return self._base
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
@final
|
|
86
|
+
class AssetCardField:
|
|
87
|
+
def __init__(self, name: str, card: AssetCard, value: object) -> None:
|
|
88
|
+
self._name = name
|
|
89
|
+
self._card = card
|
|
90
|
+
self._value = value
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def value(self) -> object:
|
|
94
|
+
return self._value
|
|
95
|
+
|
|
96
|
+
def as_(self, kls: type[T]) -> T:
|
|
97
|
+
if not isinstance(self._value, kls):
|
|
98
|
+
msg = f"{self._name} field of the {self._card.name} asset card is expected to be of type `{kls}`, but is of type `{type(self._value)}` instead."
|
|
99
|
+
|
|
100
|
+
raise AssetCardError(self._card.name, msg)
|
|
101
|
+
|
|
102
|
+
return self._value
|
|
103
|
+
|
|
104
|
+
def as_uri(self) -> Uri:
|
|
105
|
+
value = self.as_(str)
|
|
106
|
+
|
|
107
|
+
uri = Uri.maybe_parse(value)
|
|
108
|
+
if uri is not None:
|
|
109
|
+
return uri
|
|
110
|
+
|
|
111
|
+
try:
|
|
112
|
+
path = Path(value)
|
|
113
|
+
except ValueError:
|
|
114
|
+
msg = f"{self._name} field of the {self._card.name} asset card cannot be parsed as a URI or a pathname."
|
|
115
|
+
|
|
116
|
+
raise AssetCardError(self._card.name, msg) from None
|
|
117
|
+
|
|
118
|
+
if not path.is_absolute():
|
|
119
|
+
base_path = self._card.metadata.get("__base_path__")
|
|
120
|
+
if not isinstance(base_path, Path):
|
|
121
|
+
msg = f"{self._name} field of the {self._card.name} asset card is a relative pathname and cannot be converted to a URI."
|
|
122
|
+
|
|
123
|
+
raise AssetCardError(self._card.name, msg)
|
|
124
|
+
|
|
125
|
+
path = base_path.joinpath(path)
|
|
126
|
+
|
|
127
|
+
return Uri.from_path(path)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class AssetCardError(Exception):
|
|
131
|
+
def __init__(self, name: str, message: str) -> None:
|
|
132
|
+
super().__init__(message)
|
|
133
|
+
|
|
134
|
+
self.name = name
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class AssetConfigLoader(ABC):
|
|
138
|
+
@abstractmethod
|
|
139
|
+
def load(self, card: AssetCard, base_config: object, config_key: str) -> object: ...
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
@final
|
|
143
|
+
class StandardAssetConfigLoader(AssetConfigLoader):
|
|
144
|
+
def __init__(
|
|
145
|
+
self,
|
|
146
|
+
value_converter: ValueConverter,
|
|
147
|
+
config_merger: ConfigMerger,
|
|
148
|
+
config_processor: ConfigProcessor,
|
|
149
|
+
) -> None:
|
|
150
|
+
self._value_converter = value_converter
|
|
151
|
+
self._config_merger = config_merger
|
|
152
|
+
self._config_processor = config_processor
|
|
153
|
+
|
|
154
|
+
@override
|
|
155
|
+
def load(self, card: AssetCard, base_config: object, config_key: str) -> object:
|
|
156
|
+
all_config_overrides = []
|
|
157
|
+
|
|
158
|
+
base_card: AssetCard | None = card
|
|
159
|
+
|
|
160
|
+
while base_card is not None:
|
|
161
|
+
config_overrides = base_card.metadata.get(config_key)
|
|
162
|
+
if config_overrides is not None:
|
|
163
|
+
all_config_overrides.append((base_card.name, config_overrides))
|
|
164
|
+
|
|
165
|
+
base_card = base_card.base
|
|
166
|
+
|
|
167
|
+
if not all_config_overrides:
|
|
168
|
+
return base_config
|
|
169
|
+
|
|
170
|
+
config_kls = type(base_config)
|
|
171
|
+
|
|
172
|
+
try:
|
|
173
|
+
unstructured_config = self._value_converter.unstructure(base_config)
|
|
174
|
+
except StructureError:
|
|
175
|
+
msg = f"{config_key} field of the {card.name} asset card cannot be parsed as of type `{config_kls}`."
|
|
176
|
+
|
|
177
|
+
raise AssetCardError(card.name, msg) from None
|
|
178
|
+
|
|
179
|
+
for name, config_overrides in reversed(all_config_overrides):
|
|
180
|
+
# TODO(balioglu): unescape _set_ and _del_ in config_overrides
|
|
181
|
+
try:
|
|
182
|
+
unstructured_config = self._config_merger.merge(
|
|
183
|
+
unstructured_config, config_overrides
|
|
184
|
+
)
|
|
185
|
+
except (ValueError, TypeError) as ex:
|
|
186
|
+
msg = f"{config_key} field of the {name} asset card cannot be merged with the base configuration."
|
|
187
|
+
|
|
188
|
+
raise AssetCardError(name, msg) from ex
|
|
189
|
+
|
|
190
|
+
# TODO(balioglu): unescape config directives and run them.
|
|
191
|
+
try:
|
|
192
|
+
unstructured_config = self._config_processor.process(
|
|
193
|
+
unstructured_config
|
|
194
|
+
)
|
|
195
|
+
except ConfigDirectiveError as ex:
|
|
196
|
+
msg = f"A directive in the {config_key} field of the {name} asset card cannot processed."
|
|
197
|
+
|
|
198
|
+
raise AssetCardError(name, msg) from ex
|
|
199
|
+
|
|
200
|
+
try:
|
|
201
|
+
return self._value_converter.structure(unstructured_config, config_kls)
|
|
202
|
+
except StructureError as ex:
|
|
203
|
+
msg = f"{config_key} field of the {card.name} asset card cannot be parsed as of type `{config_kls}`."
|
|
204
|
+
|
|
205
|
+
raise AssetCardError(card.name, msg) from ex
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
6
|
+
|
|
7
|
+
name: librilight_asr_10h
|
|
8
|
+
dataset_family: wav2vec2_asr
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
6
|
+
|
|
7
|
+
name: librispeech_asr
|
|
8
|
+
dataset_family: generic_asr
|
|
9
|
+
tokenizer: "https://dl.fbaipublicfiles.com/fairseq/wav2vec/librispeech_asr.model"
|
|
10
|
+
tokenizer_family: char_tokenizer
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
name: librispeech_asr_100h
|
|
15
|
+
base: wav2vec2_asr
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
name: librispeech_960h
|
|
20
|
+
dataset_family: wav2vec2_ssl
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
6
|
+
|
|
7
|
+
name: openeft
|
|
8
|
+
dataset_family: generic_instruction
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
6
|
+
|
|
7
|
+
name: jepa_vitl16
|
|
8
|
+
model_family: jepa
|
|
9
|
+
model_arch: large
|
|
10
|
+
model_config_override:
|
|
11
|
+
encoder_config:
|
|
12
|
+
input_dims: [16, 224, 224]
|
|
13
|
+
patch_dims: [2, 16, 16]
|
|
14
|
+
uniform_power: true
|
|
15
|
+
checkpoint: "https://dl.fbaipublicfiles.com/jepa/vitl16/vitl16.pth.tar"
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
name: jepa_vith16
|
|
20
|
+
model_family: jepa
|
|
21
|
+
model_arch: huge
|
|
22
|
+
model_config_override:
|
|
23
|
+
encoder_config:
|
|
24
|
+
input_dims: [16, 224, 224]
|
|
25
|
+
patch_dims: [2, 16, 16]
|
|
26
|
+
uniform_power: true
|
|
27
|
+
checkpoint: "https://dl.fbaipublicfiles.com/jepa/vith16/vith16.pth.tar"
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
name: jepa_vith16_384
|
|
32
|
+
model_family: jepa
|
|
33
|
+
model_arch: huge
|
|
34
|
+
model_config_override:
|
|
35
|
+
encoder_config:
|
|
36
|
+
input_dims: [16, 384, 384]
|
|
37
|
+
patch_dims: [2, 16, 16]
|
|
38
|
+
uniform_power: true
|
|
39
|
+
checkpoint: "https://dl.fbaipublicfiles.com/jepa/vith16-384/vith16-384.pth.tar"
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
6
|
+
|
|
7
|
+
name: llama
|
|
8
|
+
model_family: llama
|
|
9
|
+
checkpoint: "https://ai.meta.com/llama/;gated=true"
|
|
10
|
+
tokenizer: "https://ai.meta.com/llama/;gated=true"
|
|
11
|
+
tokenizer_family: llama
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
name: llama_7b
|
|
16
|
+
base: llama
|
|
17
|
+
model_arch: 7b
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
name: llama2
|
|
22
|
+
model_family: llama
|
|
23
|
+
checkpoint: "https://ai.meta.com/llama/;gated=true"
|
|
24
|
+
tokenizer: "https://ai.meta.com/llama/;gated=true"
|
|
25
|
+
tokenizer_family: llama
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
name: llama2_7b
|
|
30
|
+
base: llama2
|
|
31
|
+
model_arch: llama2_7b
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
name: llama2_7b_chat
|
|
36
|
+
base: llama2
|
|
37
|
+
model_arch: llama2_7b
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
name: llama2_13b
|
|
42
|
+
base: llama2
|
|
43
|
+
model_arch: llama2_13b
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
name: llama2_13b_chat
|
|
48
|
+
base: llama2
|
|
49
|
+
model_arch: llama2_13b
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
name: llama2_70b
|
|
54
|
+
base: llama2
|
|
55
|
+
model_arch: llama2_70b
|
|
56
|
+
|
|
57
|
+
# legacy
|
|
58
|
+
num_shards: 8
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
name: llama2_70b_chat
|
|
63
|
+
base: llama2
|
|
64
|
+
model_arch: llama2_70b
|
|
65
|
+
|
|
66
|
+
# legacy
|
|
67
|
+
num_shards: 8
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
name: llama3
|
|
72
|
+
model_family: llama
|
|
73
|
+
checkpoint: "https://ai.meta.com/llama/;gated=true"
|
|
74
|
+
tokenizer: "https://ai.meta.com/llama/;gated=true"
|
|
75
|
+
tokenizer_family: llama
|
|
76
|
+
tokenizer_config_override:
|
|
77
|
+
impl: hg
|
|
78
|
+
|
|
79
|
+
# legacy
|
|
80
|
+
use_v2_tokenizer: true
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
name: llama3_instruct
|
|
85
|
+
base: llama3
|
|
86
|
+
tokenizer_config_override:
|
|
87
|
+
use_eot: true # instruct tokenizer to use EOT instead of EOS
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
name: llama3_8b
|
|
92
|
+
base: llama3
|
|
93
|
+
model_arch: llama3_8b
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
name: llama3_8b_instruct
|
|
98
|
+
base: llama3_instruct
|
|
99
|
+
model_arch: llama3_8b
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
name: llama3_70b
|
|
104
|
+
base: llama3
|
|
105
|
+
model_arch: llama3_70b
|
|
106
|
+
|
|
107
|
+
# legacy
|
|
108
|
+
num_shards: 8
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
name: llama3_70b_instruct
|
|
113
|
+
base: llama3_instruct
|
|
114
|
+
model_arch: llama3_70b
|
|
115
|
+
|
|
116
|
+
# legacy
|
|
117
|
+
num_shards: 8
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
name: llama3_1_8b
|
|
122
|
+
base: llama3
|
|
123
|
+
model_arch: llama3_1_8b
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
name: llama3_1_8b_instruct
|
|
128
|
+
base: llama3_instruct
|
|
129
|
+
model_arch: llama3_1_8b
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
name: llama3_1_70b
|
|
134
|
+
base: llama3
|
|
135
|
+
model_arch: llama3_1_70b
|
|
136
|
+
|
|
137
|
+
# legacy
|
|
138
|
+
num_shards: 8
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
name: llama3_1_70b_instruct
|
|
143
|
+
base: llama3_instruct
|
|
144
|
+
model_arch: llama3_1_70b
|
|
145
|
+
|
|
146
|
+
# legacy
|
|
147
|
+
num_shards: 8
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
name: llama3_2_1b
|
|
152
|
+
base: llama3
|
|
153
|
+
model_arch: llama3_2_1b
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
name: llama3_2_1b_instruct
|
|
158
|
+
base: llama3_instruct
|
|
159
|
+
model_arch: llama3_2_1b
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
name: llama3_2_3b
|
|
164
|
+
base: llama3
|
|
165
|
+
model_arch: llama3_2_3b
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
name: llama3_2_3b_instruct
|
|
170
|
+
base: llama3_instruct
|
|
171
|
+
model_arch: llama3_2_3b
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
name: llama3_3_70b_instruct
|
|
176
|
+
base: llama3_instruct
|
|
177
|
+
model_arch: llama3_1_70b
|
|
178
|
+
|
|
179
|
+
# legacy
|
|
180
|
+
num_shards: 8
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
name: r1_distilled_llama3_1_8b_instruct
|
|
185
|
+
model_family: llama
|
|
186
|
+
model_arch: llama3_1_8b
|
|
187
|
+
checkpoint: "hg://deepseek-ai/DeepSeek-R1-Distill-Llama-8B"
|
|
188
|
+
tokenizer: "hg://deepseek-ai/DeepSeek-R1-Distill-Llama-8B"
|
|
189
|
+
tokenizer_family: llama
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
name: llama4
|
|
194
|
+
model_family: llama4
|
|
195
|
+
checkpoint: "https://ai.meta.com/llama/;gated=true"
|
|
196
|
+
tokenizer: "https://ai.meta.com/llama/;gated=true"
|
|
197
|
+
tokenizer_family: llama4
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
name: llama4_scout_17b_16e
|
|
202
|
+
base: llama4
|
|
203
|
+
model_arch: llama4_scout_17b_16e
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
name: llama4_scout_17b_16e_instruct
|
|
208
|
+
base: llama4_scout_17b_16e
|
|
209
|
+
tokenizer_config_override:
|
|
210
|
+
use_eot: true # instruct tokenizer to use EOT instead of EOS
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
6
|
+
|
|
7
|
+
name: mistral_7b
|
|
8
|
+
model_family: mistral
|
|
9
|
+
model_arch: 7b
|
|
10
|
+
checkpoint: "https://files.mistral-7b-v0-1.mistral.ai/mistral-7B-v0.1.tar;path=mistral-7B-v0.1%2Fconsolidated.00.pth"
|
|
11
|
+
tokenizer: "https://files.mistral-7b-v0-1.mistral.ai/mistral-7B-v0.1.tar;path=mistral-7B-v0.1%2Ftokenizer.model"
|
|
12
|
+
tokenizer_family: mistral
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
name: mistral_7b_instruct
|
|
17
|
+
model_family: mistral
|
|
18
|
+
model_arch: 7b
|
|
19
|
+
checkpoint: "https://files.mistral-7b-v0-1.mistral.ai/mistral-7B-instruct-v0.1b.tar;path=Mistral-7B-instruct-v0.1%2Fconsolidated.00.pth"
|
|
20
|
+
tokenizer: "https://files.mistral-7b-v0-1.mistral.ai/mistral-7B-instruct-v0.1b.tar;path=Mistral-7B-instruct-v0.1%2Ftokenizer.model"
|
|
21
|
+
tokenizer_family: mistral
|