
@@ -24,9 +25,9 @@ rendered properly in your Markdown viewer.
# T5Gemma
-T5Gemma (aka encoder-decoder Gemma) was proposed in a [research paper](https://arxiv.org/abs/2504.06225) by Google. It is a family of encoder-decoder large language models, developed by adapting pretrained decoder-only models into encoder-decoder. T5Gemma includes pretrained and instruction-tuned variants. The architecture is based on transformer encoder-decoder design following T5, with improvements from Gemma 2: GQA, RoPE, GeGLU activation, RMSNorm, and interleaved local/global attention.
+T5Gemma (aka encoder-decoder Gemma) was proposed in a [research paper](https://huggingface.co/papers/2504.06225) by Google. It is a family of encoder-decoder large language models, developed by adapting pretrained decoder-only models into encoder-decoder. T5Gemma includes pretrained and instruction-tuned variants. The architecture is based on transformer encoder-decoder design following T5, with improvements from Gemma 2: GQA, RoPE, GeGLU activation, RMSNorm, and interleaved local/global attention.
-T5Gemma has two groups of model sizes: 1) [Gemma 2](https://ai.google.dev/gemma/docs/core/model_card_2) sizes (2B-2B, 9B-2B, and 9B-9B), which are based on the offical Gemma 2 models (2B and 9B); and 2) [T5](https://arxiv.org/abs/1910.10683) sizes (Small, Base, Large, and XL), where are pretrained under the Gemma 2 framework following T5 configuration. In addition, we also provide a model at ML size (medium large, ~2B in total), which is in-between T5 Large and T5 XL.
+T5Gemma has two groups of model sizes: 1) [Gemma 2](https://ai.google.dev/gemma/docs/core/model_card_2) sizes (2B-2B, 9B-2B, and 9B-9B), which are based on the offical Gemma 2 models (2B and 9B); and 2) [T5](https://huggingface.co/papers/1910.10683) sizes (Small, Base, Large, and XL), where are pretrained under the Gemma 2 framework following T5 configuration. In addition, we also provide a model at ML size (medium large, ~2B in total), which is in-between T5 Large and T5 XL.
The pretrained varaints are trained with two objectives: prefix language modeling with knowledge distillation (PrefixLM) and UL2, separately. We release both variants for each model size. The instruction-turned varaints was post-trained with supervised fine-tuning and reinforcement learning.
diff --git a/docs/source/en/model_doc/t5v1.1.md b/docs/source/en/model_doc/t5v1.1.md
index 7f10f30243..4b4ace6768 100644
--- a/docs/source/en/model_doc/t5v1.1.md
+++ b/docs/source/en/model_doc/t5v1.1.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2020-02-12 and added to Hugging Face Transformers on 2023-06-20.*
# T5v1.1
diff --git a/docs/source/en/model_doc/table-transformer.md b/docs/source/en/model_doc/table-transformer.md
index 534ab49c64..b35df2aec3 100644
--- a/docs/source/en/model_doc/table-transformer.md
+++ b/docs/source/en/model_doc/table-transformer.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-09-30 and added to Hugging Face Transformers on 2022-10-18.*
# Table Transformer
diff --git a/docs/source/en/model_doc/tapas.md b/docs/source/en/model_doc/tapas.md
index 21eb697ee3..744be7d688 100644
--- a/docs/source/en/model_doc/tapas.md
+++ b/docs/source/en/model_doc/tapas.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2020-04-05 and added to Hugging Face Transformers on 2020-12-15.*
# TAPAS
@@ -23,7 +24,7 @@ rendered properly in your Markdown viewer.
## Overview
-The TAPAS model was proposed in [TAPAS: Weakly Supervised Table Parsing via Pre-training](https://www.aclweb.org/anthology/2020.acl-main.398)
+The TAPAS model was proposed in [TAPAS: Weakly Supervised Table Parsing via Pre-training](https://huggingface.co/papers/2004.02349)
by Jonathan Herzig, Paweł Krzysztof Nowak, Thomas Müller, Francesco Piccinno and Julian Martin Eisenschlos. It's a BERT-based model specifically
designed (and pre-trained) for answering questions about tabular data. Compared to BERT, TAPAS uses relative position embeddings and has 7
token types that encode tabular structure. TAPAS is pre-trained on the masked language modeling (MLM) objective on a large dataset comprising
diff --git a/docs/source/en/model_doc/tapex.md b/docs/source/en/model_doc/tapex.md
index 9694b098ea..ed9a64d96a 100644
--- a/docs/source/en/model_doc/tapex.md
+++ b/docs/source/en/model_doc/tapex.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-07-16 and added to Hugging Face Transformers on 2023-06-20.*
# TAPEX
diff --git a/docs/source/en/model_doc/textnet.md b/docs/source/en/model_doc/textnet.md
index 36382664b8..9c29a8b16b 100644
--- a/docs/source/en/model_doc/textnet.md
+++ b/docs/source/en/model_doc/textnet.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-11-03 and added to Hugging Face Transformers on 2025-01-08.*
# TextNet
diff --git a/docs/source/en/model_doc/time_series_transformer.md b/docs/source/en/model_doc/time_series_transformer.md
index a91633b6b0..c38671f00f 100644
--- a/docs/source/en/model_doc/time_series_transformer.md
+++ b/docs/source/en/model_doc/time_series_transformer.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2022-12-01 and added to Hugging Face Transformers on 2022-09-30.*
# Time Series Transformer
diff --git a/docs/source/en/model_doc/timesfm.md b/docs/source/en/model_doc/timesfm.md
index f7b6424a4c..32348bba07 100644
--- a/docs/source/en/model_doc/timesfm.md
+++ b/docs/source/en/model_doc/timesfm.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2023-10-14 and added to Hugging Face Transformers on 2025-04-16.*
# TimesFM
diff --git a/docs/source/en/model_doc/timesformer.md b/docs/source/en/model_doc/timesformer.md
index c39a63a668..59e9ee7181 100644
--- a/docs/source/en/model_doc/timesformer.md
+++ b/docs/source/en/model_doc/timesformer.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-02-09 and added to Hugging Face Transformers on 2022-12-02.*
# TimeSformer
diff --git a/docs/source/en/model_doc/trajectory_transformer.md b/docs/source/en/model_doc/trajectory_transformer.md
index a2353c9414..fba51b1811 100644
--- a/docs/source/en/model_doc/trajectory_transformer.md
+++ b/docs/source/en/model_doc/trajectory_transformer.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-06-03 and added to Hugging Face Transformers on 2023-06-20.*
# Trajectory Transformer
diff --git a/docs/source/en/model_doc/transfo-xl.md b/docs/source/en/model_doc/transfo-xl.md
index 66f249f24e..a042737469 100644
--- a/docs/source/en/model_doc/transfo-xl.md
+++ b/docs/source/en/model_doc/transfo-xl.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2019-01-09 and added to Hugging Face Transformers on 2023-06-20.*
# Transformer XL
diff --git a/docs/source/en/model_doc/trocr.md b/docs/source/en/model_doc/trocr.md
index 9abc2add4e..73dd017b4f 100644
--- a/docs/source/en/model_doc/trocr.md
+++ b/docs/source/en/model_doc/trocr.md
@@ -12,6 +12,7 @@ Unless required by applicable law or agreed to in writing, software distributed
rendered properly in your Markdown viewer.
specific language governing permissions and limitations under the License. -->
+*This model was released on 2021-09-21 and added to Hugging Face Transformers on 2021-10-13.*
# TrOCR
diff --git a/docs/source/en/model_doc/tvlt.md b/docs/source/en/model_doc/tvlt.md
index 949c8549f5..0699781768 100644
--- a/docs/source/en/model_doc/tvlt.md
+++ b/docs/source/en/model_doc/tvlt.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2022-09-28 and added to Hugging Face Transformers on 2023-06-20.*
# TVLT
diff --git a/docs/source/en/model_doc/tvp.md b/docs/source/en/model_doc/tvp.md
index dd0f63e55e..49a538ffa8 100644
--- a/docs/source/en/model_doc/tvp.md
+++ b/docs/source/en/model_doc/tvp.md
@@ -9,6 +9,7 @@ Unless required by applicable law or agreed to in writing, software distributed
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->
+*This model was released on 2023-03-09 and added to Hugging Face Transformers on 2023-11-22.*
# TVP
diff --git a/docs/source/en/model_doc/udop.md b/docs/source/en/model_doc/udop.md
index fd2a70d7ec..eb400cc39d 100644
--- a/docs/source/en/model_doc/udop.md
+++ b/docs/source/en/model_doc/udop.md
@@ -9,6 +9,7 @@ Unless required by applicable law or agreed to in writing, software distributed
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->
+*This model was released on 2022-12-05 and added to Hugging Face Transformers on 2024-03-04.*
# UDOP
diff --git a/docs/source/en/model_doc/ul2.md b/docs/source/en/model_doc/ul2.md
index b3c1a22260..ca0bacbc43 100644
--- a/docs/source/en/model_doc/ul2.md
+++ b/docs/source/en/model_doc/ul2.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2022-05-10 and added to Hugging Face Transformers on 2023-06-20.*
# UL2
diff --git a/docs/source/en/model_doc/umt5.md b/docs/source/en/model_doc/umt5.md
index 736574373c..b0e5f02de4 100644
--- a/docs/source/en/model_doc/umt5.md
+++ b/docs/source/en/model_doc/umt5.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2023-04-18 and added to Hugging Face Transformers on 2023-07-03.*
# UMT5
@@ -22,7 +23,7 @@ rendered properly in your Markdown viewer.
## Overview
-The UMT5 model was proposed in [UniMax: Fairer and More Effective Language Sampling for Large-Scale Multilingual Pretraining](https://openreview.net/forum?id=kXwdL1cWOAi) by Hyung Won Chung, Xavier Garcia, Adam Roberts, Yi Tay, Orhan Firat, Sharan Narang, Noah Constant.
+The UMT5 model was proposed in [UniMax: Fairer and More Effective Language Sampling for Large-Scale Multilingual Pretraining](https://arxiv.org/pdf/2304.09151) by Hyung Won Chung, Xavier Garcia, Adam Roberts, Yi Tay, Orhan Firat, Sharan Narang, Noah Constant.
The abstract from the paper is the following:
diff --git a/docs/source/en/model_doc/unispeech-sat.md b/docs/source/en/model_doc/unispeech-sat.md
index 8d0adb8e78..308155bbfe 100644
--- a/docs/source/en/model_doc/unispeech-sat.md
+++ b/docs/source/en/model_doc/unispeech-sat.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-10-12 and added to Hugging Face Transformers on 2021-10-26.*
# UniSpeech-SAT
diff --git a/docs/source/en/model_doc/unispeech.md b/docs/source/en/model_doc/unispeech.md
index a83f7600d5..98348b560d 100644
--- a/docs/source/en/model_doc/unispeech.md
+++ b/docs/source/en/model_doc/unispeech.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-01-19 and added to Hugging Face Transformers on 2021-10-26.*
# UniSpeech
diff --git a/docs/source/en/model_doc/univnet.md b/docs/source/en/model_doc/univnet.md
index 57492dcd68..e20bc5c405 100644
--- a/docs/source/en/model_doc/univnet.md
+++ b/docs/source/en/model_doc/univnet.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-06-15 and added to Hugging Face Transformers on 2023-11-22.*
# UnivNet
diff --git a/docs/source/en/model_doc/upernet.md b/docs/source/en/model_doc/upernet.md
index e215ec8621..2c2e50fc56 100644
--- a/docs/source/en/model_doc/upernet.md
+++ b/docs/source/en/model_doc/upernet.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2018-07-26 and added to Hugging Face Transformers on 2023-01-16.*
# UPerNet
diff --git a/docs/source/en/model_doc/van.md b/docs/source/en/model_doc/van.md
index 0a25691823..0e07e314be 100644
--- a/docs/source/en/model_doc/van.md
+++ b/docs/source/en/model_doc/van.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2022-02-20 and added to Hugging Face Transformers on 2023-06-20.*
# VAN
diff --git a/docs/source/en/model_doc/video_llava.md b/docs/source/en/model_doc/video_llava.md
index b2051a91f2..bda7264369 100644
--- a/docs/source/en/model_doc/video_llava.md
+++ b/docs/source/en/model_doc/video_llava.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2023-11-16 and added to Hugging Face Transformers on 2024-05-15.*
# Video-LLaVA
diff --git a/docs/source/en/model_doc/videomae.md b/docs/source/en/model_doc/videomae.md
index ac3d6c044e..547cc2f0a1 100644
--- a/docs/source/en/model_doc/videomae.md
+++ b/docs/source/en/model_doc/videomae.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2022-03-23 and added to Hugging Face Transformers on 2022-08-04.*
# VideoMAE
diff --git a/docs/source/en/model_doc/vilt.md b/docs/source/en/model_doc/vilt.md
index 19146e3846..a8e63ec494 100644
--- a/docs/source/en/model_doc/vilt.md
+++ b/docs/source/en/model_doc/vilt.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-02-05 and added to Hugging Face Transformers on 2022-01-19.*
# ViLT
diff --git a/docs/source/en/model_doc/vipllava.md b/docs/source/en/model_doc/vipllava.md
index c60b172045..0d0a209c27 100644
--- a/docs/source/en/model_doc/vipllava.md
+++ b/docs/source/en/model_doc/vipllava.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2023-12-01 and added to Hugging Face Transformers on 2023-12-13.*
# VipLlava
diff --git a/docs/source/en/model_doc/vision-encoder-decoder.md b/docs/source/en/model_doc/vision-encoder-decoder.md
index 53c573be47..38abeb65b5 100644
--- a/docs/source/en/model_doc/vision-encoder-decoder.md
+++ b/docs/source/en/model_doc/vision-encoder-decoder.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-09-21 and added to Hugging Face Transformers on 2021-10-13.*
# Vision Encoder Decoder Models
diff --git a/docs/source/en/model_doc/vision-text-dual-encoder.md b/docs/source/en/model_doc/vision-text-dual-encoder.md
index 3106cb0ac3..b26fcc3104 100644
--- a/docs/source/en/model_doc/vision-text-dual-encoder.md
+++ b/docs/source/en/model_doc/vision-text-dual-encoder.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-11-15 and added to Hugging Face Transformers on 2021-11-30.*
# VisionTextDualEncoder
diff --git a/docs/source/en/model_doc/visual_bert.md b/docs/source/en/model_doc/visual_bert.md
index 9e4376d0d4..7a7ac24e4d 100644
--- a/docs/source/en/model_doc/visual_bert.md
+++ b/docs/source/en/model_doc/visual_bert.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2019-08-09 and added to Hugging Face Transformers on 2021-06-02.*
diff --git a/docs/source/en/model_doc/vit.md b/docs/source/en/model_doc/vit.md
index d09fed4b3a..6221d83a31 100644
--- a/docs/source/en/model_doc/vit.md
+++ b/docs/source/en/model_doc/vit.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2020-10-22 and added to Hugging Face Transformers on 2021-04-01.*
diff --git a/docs/source/en/model_doc/vit_hybrid.md b/docs/source/en/model_doc/vit_hybrid.md
index c268c2fad3..e85e156f29 100644
--- a/docs/source/en/model_doc/vit_hybrid.md
+++ b/docs/source/en/model_doc/vit_hybrid.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2020-10-22 and added to Hugging Face Transformers on 2023-06-20.*
# Hybrid Vision Transformer (ViT Hybrid)
diff --git a/docs/source/en/model_doc/vit_mae.md b/docs/source/en/model_doc/vit_mae.md
index 787253f32f..515c5b8cba 100644
--- a/docs/source/en/model_doc/vit_mae.md
+++ b/docs/source/en/model_doc/vit_mae.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-11-11 and added to Hugging Face Transformers on 2022-01-18.*
diff --git a/docs/source/en/model_doc/vit_msn.md b/docs/source/en/model_doc/vit_msn.md
index 8835f01cd8..a54cfad46c 100644
--- a/docs/source/en/model_doc/vit_msn.md
+++ b/docs/source/en/model_doc/vit_msn.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2022-04-14 and added to Hugging Face Transformers on 2022-09-22.*
# ViTMSN
diff --git a/docs/source/en/model_doc/vitdet.md b/docs/source/en/model_doc/vitdet.md
index 738d83461b..539ae5e376 100644
--- a/docs/source/en/model_doc/vitdet.md
+++ b/docs/source/en/model_doc/vitdet.md
@@ -9,6 +9,7 @@ Unless required by applicable law or agreed to in writing, software distributed
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->
+*This model was released on 2022-03-30 and added to Hugging Face Transformers on 2023-08-29.*
# ViTDet
diff --git a/docs/source/en/model_doc/vitmatte.md b/docs/source/en/model_doc/vitmatte.md
index f661de1622..519a2dd74d 100644
--- a/docs/source/en/model_doc/vitmatte.md
+++ b/docs/source/en/model_doc/vitmatte.md
@@ -9,6 +9,7 @@ Unless required by applicable law or agreed to in writing, software distributed
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->
+*This model was released on 2023-05-24 and added to Hugging Face Transformers on 2023-09-19.*
# ViTMatte
diff --git a/docs/source/en/model_doc/vitpose.md b/docs/source/en/model_doc/vitpose.md
index f9ed726593..612d556550 100644
--- a/docs/source/en/model_doc/vitpose.md
+++ b/docs/source/en/model_doc/vitpose.md
@@ -9,6 +9,7 @@ Unless required by applicable law or agreed to in writing, software distributed
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->
+*This model was released on 2022-04-26 and added to Hugging Face Transformers on 2025-01-08.*
diff --git a/docs/source/en/model_doc/vits.md b/docs/source/en/model_doc/vits.md
index 7a829b36ba..9633e6e35e 100644
--- a/docs/source/en/model_doc/vits.md
+++ b/docs/source/en/model_doc/vits.md
@@ -8,6 +8,7 @@ http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.-->
+*This model was released on 2021-06-11 and added to Hugging Face Transformers on 2023-09-01.*
@@ -17,7 +18,7 @@ specific language governing permissions and limitations under the License.-->
# VITS
-[VITS (Variational Inference with adversarial learning for end-to-end Text-to-Speech)](https://hf.co/papers/2106.06103) is a end-to-end speech synthesis model, simplifying the traditional two-stage text-to-speech (TTS) systems. It's unique because it directly synthesizes speech from text using variational inference, adversarial learning, and normalizing flows to produce natural and expressive speech with diverse rhythms and intonations.
+[VITS (Variational Inference with adversarial learning for end-to-end Text-to-Speech)](https://huggingface.co/papers/2106.06103) is a end-to-end speech synthesis model, simplifying the traditional two-stage text-to-speech (TTS) systems. It's unique because it directly synthesizes speech from text using variational inference, adversarial learning, and normalizing flows to produce natural and expressive speech with diverse rhythms and intonations.
You can find all the original VITS checkpoints under the [AI at Meta](https://huggingface.co/facebook?search_models=mms-tts) organization.
diff --git a/docs/source/en/model_doc/vivit.md b/docs/source/en/model_doc/vivit.md
index cf32c749e2..61dddcb270 100644
--- a/docs/source/en/model_doc/vivit.md
+++ b/docs/source/en/model_doc/vivit.md
@@ -9,6 +9,7 @@ Unless required by applicable law or agreed to in writing, software distributed
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->
+*This model was released on 2021-03-29 and added to Hugging Face Transformers on 2023-07-11.*
# Video Vision Transformer (ViViT)
diff --git a/docs/source/en/model_doc/vjepa2.md b/docs/source/en/model_doc/vjepa2.md
index b16875339e..bf409a5139 100644
--- a/docs/source/en/model_doc/vjepa2.md
+++ b/docs/source/en/model_doc/vjepa2.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2025-06-11 and added to Hugging Face Transformers on 2025-06-11.*
@@ -25,7 +26,7 @@ rendered properly in your Markdown viewer.
# V-JEPA 2
-V-JEPA 2 is a self-supervised approach to training video encoders developed by FAIR, Meta. Using internet-scale video data, V-JEPA 2 attains state-of-the-art performance on motion understanding and human action anticipation tasks. V-JEPA 2-AC is a latent action-conditioned world model post-trained from V-JEPA 2 (using a small amount of robot trajectory interaction data) that solves robot manipulation tasks without environment-specific data collection or task-specific training or calibration.
+[V-JEPA 2](https://huggingface.co/papers/2506.09985) ([blog post](https://ai.meta.com/blog/v-jepa-2-world-model-benchmarks/)) is a self-supervised approach to training video encoders developed by FAIR, Meta. Using internet-scale video data, V-JEPA 2 attains state-of-the-art performance on motion understanding and human action anticipation tasks. V-JEPA 2-AC is a latent action-conditioned world model post-trained from V-JEPA 2 (using a small amount of robot trajectory interaction data) that solves robot manipulation tasks without environment-specific data collection or task-specific training or calibration.

diff --git a/docs/source/en/model_doc/voxtral.md b/docs/source/en/model_doc/voxtral.md
index ad15631a96..f46c1188df 100644
--- a/docs/source/en/model_doc/voxtral.md
+++ b/docs/source/en/model_doc/voxtral.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2025-07-15 and added to Hugging Face Transformers on 2025-07-18.*
# Voxtral
diff --git a/docs/source/en/model_doc/wav2vec2-bert.md b/docs/source/en/model_doc/wav2vec2-bert.md
index c2cf464977..4edb67498a 100644
--- a/docs/source/en/model_doc/wav2vec2-bert.md
+++ b/docs/source/en/model_doc/wav2vec2-bert.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2023-11-30 and added to Hugging Face Transformers on 2024-01-18.*
# Wav2Vec2-BERT
@@ -22,7 +23,7 @@ rendered properly in your Markdown viewer.
## Overview
-The Wav2Vec2-BERT model was proposed in [Seamless: Multilingual Expressive and Streaming Speech Translation](https://ai.meta.com/research/publications/seamless-multilingual-expressive-and-streaming-speech-translation/) by the Seamless Communication team from Meta AI.
+The [Wav2Vec2-BERT](https://huggingface.co/papers/2312.05187) model was proposed in [Seamless: Multilingual Expressive and Streaming Speech Translation](https://ai.meta.com/research/publications/seamless-multilingual-expressive-and-streaming-speech-translation/) by the Seamless Communication team from Meta AI.
This model was pre-trained on 4.5M hours of unlabeled audio data covering more than 143 languages. It requires finetuning to be used for downstream tasks such as Automatic Speech Recognition (ASR), or Audio Classification.
diff --git a/docs/source/en/model_doc/wav2vec2-conformer.md b/docs/source/en/model_doc/wav2vec2-conformer.md
index fa304b3a86..e2a56b450d 100644
--- a/docs/source/en/model_doc/wav2vec2-conformer.md
+++ b/docs/source/en/model_doc/wav2vec2-conformer.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2020-10-11 and added to Hugging Face Transformers on 2022-05-17.*
# Wav2Vec2-Conformer
diff --git a/docs/source/en/model_doc/wav2vec2.md b/docs/source/en/model_doc/wav2vec2.md
index 340ac4b193..401859a6c8 100644
--- a/docs/source/en/model_doc/wav2vec2.md
+++ b/docs/source/en/model_doc/wav2vec2.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2020-06-20 and added to Hugging Face Transformers on 2021-02-02.*
# Wav2Vec2
diff --git a/docs/source/en/model_doc/wav2vec2_phoneme.md b/docs/source/en/model_doc/wav2vec2_phoneme.md
index 863bdafca3..e669120f29 100644
--- a/docs/source/en/model_doc/wav2vec2_phoneme.md
+++ b/docs/source/en/model_doc/wav2vec2_phoneme.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-09-23 and added to Hugging Face Transformers on 2021-12-17.*
# Wav2Vec2Phoneme
diff --git a/docs/source/en/model_doc/wavlm.md b/docs/source/en/model_doc/wavlm.md
index 7dfe6f26bb..4925b5a1a0 100644
--- a/docs/source/en/model_doc/wavlm.md
+++ b/docs/source/en/model_doc/wavlm.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-10-26 and added to Hugging Face Transformers on 2021-12-16.*
# WavLM
diff --git a/docs/source/en/model_doc/whisper.md b/docs/source/en/model_doc/whisper.md
index 4bb51d0ce8..5b426f0505 100644
--- a/docs/source/en/model_doc/whisper.md
+++ b/docs/source/en/model_doc/whisper.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2022-12-06 and added to Hugging Face Transformers on 2022-10-05.*
@@ -28,7 +29,7 @@ rendered properly in your Markdown viewer.
# Whisper
-[Whisper](https://hf.co/papers/2212.04356) is a encoder-decoder (sequence-to-sequence) transformer pretrained on 680,000 hours of labeled audio data. This amount of pretraining data enables zero-shot performance on audio tasks in English and many other languages. The decoder allows Whisper to map the encoders learned speech representations to useful outputs, such as text, without additional fine-tuning. Whisper just works out of the box.
+[Whisper](https://huggingface.co/papers/2212.04356) is a encoder-decoder (sequence-to-sequence) transformer pretrained on 680,000 hours of labeled audio data. This amount of pretraining data enables zero-shot performance on audio tasks in English and many other languages. The decoder allows Whisper to map the encoders learned speech representations to useful outputs, such as text, without additional fine-tuning. Whisper just works out of the box.
You can find all the original Whisper checkpoints under the [Whisper](https://huggingface.co/collections/openai/whisper-release-6501bba2cf999715fd953013) collection.
diff --git a/docs/source/en/model_doc/xclip.md b/docs/source/en/model_doc/xclip.md
index ca78a68ae2..e3219f6d8f 100644
--- a/docs/source/en/model_doc/xclip.md
+++ b/docs/source/en/model_doc/xclip.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2022-08-04 and added to Hugging Face Transformers on 2023-06-20.*
# X-CLIP
diff --git a/docs/source/en/model_doc/xglm.md b/docs/source/en/model_doc/xglm.md
index 6c0c180727..5042492ef7 100644
--- a/docs/source/en/model_doc/xglm.md
+++ b/docs/source/en/model_doc/xglm.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-12-20 and added to Hugging Face Transformers on 2022-01-28.*
# XGLM
diff --git a/docs/source/en/model_doc/xlm-prophetnet.md b/docs/source/en/model_doc/xlm-prophetnet.md
index 5d11a532f2..4dad4c0afa 100644
--- a/docs/source/en/model_doc/xlm-prophetnet.md
+++ b/docs/source/en/model_doc/xlm-prophetnet.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2020-01-13 and added to Hugging Face Transformers on 2023-06-20.*
# XLM-ProphetNet
diff --git a/docs/source/en/model_doc/xlm-roberta-xl.md b/docs/source/en/model_doc/xlm-roberta-xl.md
index 56306bcb4a..eba0218289 100644
--- a/docs/source/en/model_doc/xlm-roberta-xl.md
+++ b/docs/source/en/model_doc/xlm-roberta-xl.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-05-02 and added to Hugging Face Transformers on 2022-01-29.*
diff --git a/docs/source/en/model_doc/xlm-roberta.md b/docs/source/en/model_doc/xlm-roberta.md
index 80465da245..bac0bcf8ec 100644
--- a/docs/source/en/model_doc/xlm-roberta.md
+++ b/docs/source/en/model_doc/xlm-roberta.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2019-11-05 and added to Hugging Face Transformers on 2020-11-16.*
diff --git a/docs/source/en/model_doc/xlm-v.md b/docs/source/en/model_doc/xlm-v.md
index 05b4a42593..7001926dc2 100644
--- a/docs/source/en/model_doc/xlm-v.md
+++ b/docs/source/en/model_doc/xlm-v.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2023-01-25 and added to Hugging Face Transformers on 2023-06-20.*
# XLM-V
diff --git a/docs/source/en/model_doc/xlm.md b/docs/source/en/model_doc/xlm.md
index f0c376625d..83835b29dc 100644
--- a/docs/source/en/model_doc/xlm.md
+++ b/docs/source/en/model_doc/xlm.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2019-01-22 and added to Hugging Face Transformers on 2020-11-16.*
diff --git a/docs/source/en/model_doc/xlnet.md b/docs/source/en/model_doc/xlnet.md
index e35851d5d2..7b844f44c7 100644
--- a/docs/source/en/model_doc/xlnet.md
+++ b/docs/source/en/model_doc/xlnet.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2019-06-19 and added to Hugging Face Transformers on 2020-11-16.*
# XLNet
diff --git a/docs/source/en/model_doc/xls_r.md b/docs/source/en/model_doc/xls_r.md
index 238c703f3e..bc99bbcbee 100644
--- a/docs/source/en/model_doc/xls_r.md
+++ b/docs/source/en/model_doc/xls_r.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-11-17 and added to Hugging Face Transformers on 2023-06-20.*
# XLS-R
diff --git a/docs/source/en/model_doc/xlsr_wav2vec2.md b/docs/source/en/model_doc/xlsr_wav2vec2.md
index eceea3be20..5c2771278b 100644
--- a/docs/source/en/model_doc/xlsr_wav2vec2.md
+++ b/docs/source/en/model_doc/xlsr_wav2vec2.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2020-06-24 and added to Hugging Face Transformers on 2023-06-20.*
# XLSR-Wav2Vec2
diff --git a/docs/source/en/model_doc/xlstm.md b/docs/source/en/model_doc/xlstm.md
index ba47a5a97c..b239d631fb 100644
--- a/docs/source/en/model_doc/xlstm.md
+++ b/docs/source/en/model_doc/xlstm.md
@@ -13,16 +13,17 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2024-05-07 and added to Hugging Face Transformers on 2025-07-25.*
# xLSTM
## Overview
-The xLSTM model was proposed in [xLSTM: Extended Long Short-Term Memory](https://openreview.net/forum?id=ARAxPPIAhq) by Maximilian Beck*, Korbinian Pöppel*, Markus Spanring, Andreas Auer, Oleksandra Prudnikova, Michael Kopp, Günter Klambauer, Johannes Brandstetter and Sepp Hochreiter.
+The xLSTM model was proposed in [xLSTM: Extended Long Short-Term Memory](https://huggingface.co/papers/2405.04517) by Maximilian Beck*, Korbinian Pöppel*, Markus Spanring, Andreas Auer, Oleksandra Prudnikova, Michael Kopp, Günter Klambauer, Johannes Brandstetter and Sepp Hochreiter.
xLSTM updates the original LSTM architecture to be competitive with Transformer models by introducing exponential gating, matrix memory expansion, and parallelizable training and ingestion.
-The [7B model](https://hf.co/NX-AI/xLSTM-7b) variant was trained by the xLSTM team Maximilian Beck, Korbinian Pöppel, Phillip Lippe, Richard Kurle, Patrick Blies, Sebastian Böck and Sepp Hochreiter at NXAI.
+The [7B model](https://huggingface.co/NX-AI/xLSTM-7b) variant was trained by the xLSTM team Maximilian Beck, Korbinian Pöppel, Phillip Lippe, Richard Kurle, Patrick Blies, Sebastian Böck and Sepp Hochreiter at NXAI.
The abstract from the paper is the following:
diff --git a/docs/source/en/model_doc/xmod.md b/docs/source/en/model_doc/xmod.md
index e07601074c..1ae591c92c 100644
--- a/docs/source/en/model_doc/xmod.md
+++ b/docs/source/en/model_doc/xmod.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2022-05-12 and added to Hugging Face Transformers on 2023-02-10.*
# X-MOD
@@ -22,7 +23,7 @@ rendered properly in your Markdown viewer.
## Overview
-The X-MOD model was proposed in [Lifting the Curse of Multilinguality by Pre-training Modular Transformers](http://dx.doi.org/10.18653/v1/2022.naacl-main.255) by Jonas Pfeiffer, Naman Goyal, Xi Lin, Xian Li, James Cross, Sebastian Riedel, and Mikel Artetxe.
+The X-MOD model was proposed in [Lifting the Curse of Multilinguality by Pre-training Modular Transformers](https://arxiv.org/abs/2205.06266) by Jonas Pfeiffer, Naman Goyal, Xi Lin, Xian Li, James Cross, Sebastian Riedel, and Mikel Artetxe.
X-MOD extends multilingual masked language models like [XLM-R](xlm-roberta) to include language-specific modular components (_language adapters_) during pre-training. For fine-tuning, the language adapters in each transformer layer are frozen.
The abstract from the paper is the following:
diff --git a/docs/source/en/model_doc/yolos.md b/docs/source/en/model_doc/yolos.md
index 2c4cc7bc48..516c7e656e 100644
--- a/docs/source/en/model_doc/yolos.md
+++ b/docs/source/en/model_doc/yolos.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-06-01 and added to Hugging Face Transformers on 2022-05-02.*

diff --git a/docs/source/en/model_doc/yoso.md b/docs/source/en/model_doc/yoso.md
index 344fad9e12..f07e5aba08 100644
--- a/docs/source/en/model_doc/yoso.md
+++ b/docs/source/en/model_doc/yoso.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2021-11-18 and added to Hugging Face Transformers on 2022-01-26.*
# YOSO
diff --git a/docs/source/en/model_doc/zamba.md b/docs/source/en/model_doc/zamba.md
index b112c92d53..f9280f9379 100644
--- a/docs/source/en/model_doc/zamba.md
+++ b/docs/source/en/model_doc/zamba.md
@@ -13,13 +13,14 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2024-04-16 and added to Hugging Face Transformers on 2024-10-04.*
# Zamba
-Zamba is a large language model (LLM) trained by Zyphra, and made available under an Apache 2.0 license. Please see the [Zyphra Hugging Face](https://huggingface.co/collections/zyphra/) repository for model weights.
+[Zamba](https://huggingface.co/papers/2405.16712) ([blog post](https://www.zyphra.com/post/zamba)) is a large language model (LLM) trained by Zyphra, and made available under an Apache 2.0 license. Please see the [Zyphra Hugging Face](https://huggingface.co/collections/zyphra/) repository for model weights.
This model was contributed by [pglo](https://huggingface.co/pglo).
diff --git a/docs/source/en/model_doc/zamba2.md b/docs/source/en/model_doc/zamba2.md
index 447fa27b69..cf31eeb1ea 100644
--- a/docs/source/en/model_doc/zamba2.md
+++ b/docs/source/en/model_doc/zamba2.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2024-11-22 and added to Hugging Face Transformers on 2025-01-27.*
# Zamba2
@@ -21,14 +22,14 @@ rendered properly in your Markdown viewer.
-Zamba2 is a large language model (LLM) trained by Zyphra, and made available under an Apache 2.0 license. Please see the [Zyphra Hugging Face](https://huggingface.co/collections/zyphra/) repository for model weights.
+[Zamba2](https://huggingface.co/papers/2411.15242) is a large language model (LLM) trained by Zyphra, and made available under an Apache 2.0 license. Please see the [Zyphra Hugging Face](https://huggingface.co/collections/zyphra/) repository for model weights.
This model was contributed by [pglo](https://huggingface.co/pglo).
## Model details
-Zamba2-1.2B, Zamba2-2.7B and Zamba2-7B are hybrid models combining state-space models (Specifically [Mamba](https://github.com/state-spaces/mamba)) and transformer, and were trained using next-token prediction. Zamba2 uses shared transformer layers after every 6 mamba blocks. It uses the [Mistral v0.1 tokenizer](https://huggingface.co/mistralai/Mistral-7B-v0.1). We came to this architecture after a series of ablations at small scales. Zamba2-1.2B, Zamba2-2.7B and Zamba2-7B were pre-trained on 2T and 3T tokens, respectively.
+[Zamba2-1.2B](https://www.zyphra.com/post/zamba2-mini), [Zamba2-2.7B](https://www.zyphra.com/post/zamba2-small) and [Zamba2-7B](https://www.zyphra.com/post/zamba2-7b) are hybrid models combining state-space models (Specifically [Mamba](https://github.com/state-spaces/mamba)) and transformer, and were trained using next-token prediction. Zamba2 uses shared transformer layers after every 6 mamba blocks. It uses the [Mistral v0.1 tokenizer](https://huggingface.co/mistralai/Mistral-7B-v0.1). We came to this architecture after a series of ablations at small scales. Zamba2-1.2B, Zamba2-2.7B and Zamba2-7B were pre-trained on 2T and 3T tokens, respectively.

diff --git a/docs/source/en/model_doc/zoedepth.md b/docs/source/en/model_doc/zoedepth.md
index d392b34abb..9ca7d3f30a 100644
--- a/docs/source/en/model_doc/zoedepth.md
+++ b/docs/source/en/model_doc/zoedepth.md
@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
rendered properly in your Markdown viewer.
-->
+*This model was released on 2023-02-23 and added to Hugging Face Transformers on 2024-07-08.*
diff --git a/utils/add_dates.py b/utils/add_dates.py
new file mode 100644
index 0000000000..9efa831d30
--- /dev/null
+++ b/utils/add_dates.py
@@ -0,0 +1,282 @@
+import argparse
+import os
+import re
+import subprocess
+from typing import Optional
+
+from huggingface_hub import paper_info
+
+
+ROOT = os.getcwd().split("utils")[0]
+DOCS_PATH = os.path.join(ROOT, "docs/source/en/model_doc")
+MODELS_PATH = os.path.join(ROOT, "src/transformers/models")
+
+COPYRIGHT_DISCLAIMER = """"""
+
+ARXIV_PAPERS_NOT_IN_HF_PAPERS = {
+ "gemma3n.md": "2506.06644",
+ "xmod.md": "2205.06266",
+}
+
+
+def get_modified_cards() -> list[str]:
+ """Get the list of model names from modified files in docs/source/en/model_doc/"""
+
+ result = subprocess.check_output(["git", "status", "--porcelain"], text=True)
+
+ model_names = []
+ for line in result.strip().split("\n"):
+ if line:
+ # Split on whitespace and take the last part (filename)
+ filename = line.split()[-1]
+ if filename.startswith("docs/source/en/model_doc/") and filename.endswith(".md"):
+ model_name = os.path.splitext(os.path.basename(filename))[0]
+ if model_name not in ["auto", "timm_wrapper"]:
+ model_names.append(model_name)
+
+ return model_names
+
+
+def get_paper_link(model_card: Optional[str], path: Optional[str]) -> str:
+ """Get the first paper link from the model card content."""
+
+ if model_card is not None and not model_card.endswith(".md"):
+ model_card = f"{model_card}.md"
+ file_path = path or os.path.join(DOCS_PATH, f"{model_card}")
+ model_card = os.path.basename(file_path)
+ with open(file_path, "r", encoding="utf-8") as f:
+ content = f.read()
+
+ if "blog" in content or "report" in content or "post" in content:
+ print(f"Insert the release date of the blog post or technical report at the top of {model_card}")
+ return "blog"
+
+ # Find known paper links
+ paper_ids = re.findall(r"https://huggingface\.co/papers/\d+\.\d+", content)
+ paper_ids += re.findall(r"https://arxiv\.org/abs/\d+\.\d+", content)
+
+ # If no known paper links are found, look for other potential paper links
+ if len(paper_ids) == 0:
+ # Find all https links
+ all_https_links = re.findall(r"https://[^\s\)]+", content)
+
+ # Filter out huggingface.co and github links
+ other_paper_links = []
+ for link in all_https_links:
+ link = link.rstrip(".,;!?)")
+ if "huggingface.co" not in link and "github.com" not in link:
+ other_paper_links.append(link)
+
+ # Remove duplicates while preserving order
+ other_paper_links = list(dict.fromkeys(other_paper_links))
+
+ if other_paper_links:
+ print(f"No Hugging Face or Arxiv papers found. The possible paper links found in {model_card}:")
+ for link in other_paper_links:
+ print(f" - {link}")
+
+ return "No_paper"
+
+ return paper_ids[0]
+
+
+def get_first_commit_date(model_name: Optional[str]) -> str:
+ """Get the first commit date of the model's init file or model.md. This date is considered as the date the model was added to HF transformers"""
+
+ if model_name.endswith(".md"):
+ model_name = f"{model_name[:-3]}"
+
+ model_name_src = model_name
+ if "-" in model_name:
+ model_name_src = model_name.replace("-", "_")
+ file_path = os.path.join(MODELS_PATH, model_name_src, "__init__.py")
+
+ # If the init file is not found (only true for legacy models), the doc's first commit date is used
+ if not os.path.exists(file_path):
+ file_path = os.path.join(DOCS_PATH, f"{model_name}.md")
+
+ result = subprocess.check_output(
+ ["git", "log", "--reverse", "--pretty=format:%ad", "--date=iso", file_path], text=True
+ )
+ return result.strip().split("\n")[0][:10]
+
+
+def get_release_date(link: str) -> str:
+ if link.startswith("https://huggingface.co/papers/"):
+ link = link.replace("https://huggingface.co/papers/", "")
+
+ try:
+ info = paper_info(link)
+ return info.published_at.date().isoformat()
+ except Exception as e:
+ print(f"Error fetching release date for the paper https://huggingface.co/papers/{link}: {e}")
+
+ elif link.startswith("https://arxiv.org/abs/"):
+ print(f"This paper {link} is not yet available in Hugging Face papers, skipping the release date attachment.")
+ return r"{release_date}"
+
+
+def replace_paper_links(file_path: str) -> bool:
+ """Replace arxiv links with huggingface links if valid, and replace hf.co with huggingface.co"""
+
+ with open(file_path, "r", encoding="utf-8") as f:
+ content = f.read()
+
+ model_card = os.path.basename(file_path)
+ original_content = content
+
+ # Replace hf.co with huggingface.co
+ content = content.replace("https://hf.co/", "https://huggingface.co/")
+
+ # Find all arxiv links
+ arxiv_links = re.findall(r"https://arxiv\.org/abs/(\d+\.\d+)", content)
+
+ for paper_id in arxiv_links:
+ try:
+ # Check if paper exists on huggingface
+ paper_info(paper_id)
+ # If no exception, replace the link
+ old_link = f"https://arxiv.org/abs/{paper_id}"
+ new_link = f"https://huggingface.co/papers/{paper_id}"
+ content = content.replace(old_link, new_link)
+ print(f"Replaced {old_link} with {new_link}")
+
+ except Exception:
+ # Paper not available on huggingface, keep arxiv link
+ print(f"Paper {paper_id} for {model_card} is not available on huggingface, keeping the arxiv link")
+ continue
+
+ # Write back only if content changed
+ if content != original_content:
+ with open(file_path, "w", encoding="utf-8") as f:
+ f.write(content)
+ return True
+ return False
+
+
+def insert_dates(model_card_list: list[str]):
+ """Insert release and commit dates into model cards"""
+
+ for model_card in model_card_list:
+ if not model_card.endswith(".md"):
+ model_card = f"{model_card}.md"
+
+ if model_card == "auto.md" or model_card == "timm_wrapper.md":
+ continue
+
+ file_path = os.path.join(DOCS_PATH, model_card)
+
+ # First replace arxiv paper links with hf paper link if possible
+ links_replaced = replace_paper_links(file_path)
+ if links_replaced:
+ print(f"Updated paper links in {model_card}")
+
+ pattern = (
+ r"\n\*This model was released on (.*) and added to Hugging Face Transformers on (\d{4}-\d{2}-\d{2})\.\*"
+ )
+
+ # Check if the copyright disclaimer sections exists, if not, add one with 2025
+ with open(file_path, "r", encoding="utf-8") as f:
+ content = f.read()
+ markers = list(re.finditer(r"-->", content)) # Dates info is placed right below this marker
+ if len(markers) == 0:
+ print(f"No marker found in {model_card}. Adding copyright disclaimer to the top.")
+
+ # Add copyright disclaimer to the very top of the file
+ content = COPYRIGHT_DISCLAIMER + "\n\n" + content
+ with open(file_path, "w", encoding="utf-8") as f:
+ f.write(content)
+ markers = list(re.finditer(r"-->", content))
+
+ hf_commit_date = get_first_commit_date(model_name=model_card)
+
+ match = re.search(pattern, content)
+
+ # If the dates info line already exists, only check and update the hf_commit_date, don't modify the existing release date
+ if match:
+ release_date = match.group(1) # The release date part
+ existing_hf_date = match.group(2) # The existing HF date part
+ if existing_hf_date != hf_commit_date:
+ old_line = match.group(0) # Full matched line
+ new_line = f"\n*This model was released on {release_date} and added to Hugging Face Transformers on {hf_commit_date}.*"
+
+ content = content.replace(old_line, new_line)
+ with open(file_path, "w", encoding="utf-8") as f:
+ f.write(content)
+
+ # If the dates info line does not exist, add it
+ else:
+ paper_link = get_paper_link(path=file_path)
+ release_date = ""
+
+ if not (paper_link == "No_paper" or paper_link == "blog"):
+ release_date = get_release_date(paper_link)
+ else:
+ release_date = r"{release_date}"
+
+ insert_index = markers[0].end()
+
+ date_info = f"\n*This model was released on {release_date} and added to Hugging Face Transformers on {hf_commit_date}.*"
+ content = content[:insert_index] + date_info + content[insert_index:]
+ with open(file_path, "w", encoding="utf-8") as f:
+ f.write(content)
+ print(f"Added {model_card} release and commit dates.")
+
+
+def get_all_model_cards():
+ """Get all model cards from the docs path"""
+
+ all_files = os.listdir(DOCS_PATH)
+ model_cards = []
+ for file in all_files:
+ if file.endswith(".md"):
+ model_name = os.path.splitext(file)[0]
+ if model_name not in ["auto", "timm_wrapper"]:
+ model_cards.append(model_name)
+ return sorted(model_cards)
+
+
+def main(all=False, auto=True, models=None):
+ if all:
+ model_cards = get_all_model_cards()
+ print(f"Processing all {len(model_cards)} model cards from docs directory")
+ elif auto:
+ model_cards = get_modified_cards()
+ if not model_cards:
+ print("No modified model cards found.")
+ return
+ print(f"Processing modified model cards: {model_cards}")
+ else:
+ model_cards = models
+ print(f"Processing specified model cards: {model_cards}")
+
+ insert_dates(model_cards)
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser(description="Add release and commit dates to model cards")
+ group = parser.add_mutually_exclusive_group(required=False)
+ group.add_argument(
+ "--auto", action="store_true", help="Automatically process modified model cards from git status"
+ )
+ group.add_argument("--models", nargs="+", help="Specify model cards to process (without .md extension)")
+ group.add_argument("--all", action="store_true", help="Process all model cards in the docs directory")
+
+ parser.set_defaults(auto=True)
+ args = parser.parse_args()
+
+ main(args.all, args.auto, args.models)