From 0a03a86813c475543f649bfeae75ff0cae6ad2a6 Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Mon, 10 Jan 2022 12:44:11 +0100 Subject: [PATCH] fix model table cell text alignment (#14999) Co-authored-by: ydshieh --- docs/source/index.mdx | 2 +- utils/check_table.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/source/index.mdx b/docs/source/index.mdx index b18487a0814..eb57155a26a 100644 --- a/docs/source/index.mdx +++ b/docs/source/index.mdx @@ -190,7 +190,7 @@ Flax), PyTorch, and/or TensorFlow. | Model | Tokenizer slow | Tokenizer fast | PyTorch support | TensorFlow support | Flax Support | -|-----------------------------|----------------|----------------|-----------------|--------------------|--------------| +|:---------------------------:|:--------------:|:--------------:|:---------------:|:------------------:|:------------:| | ALBERT | ✅ | ✅ | ✅ | ✅ | ✅ | | BART | ✅ | ✅ | ✅ | ✅ | ✅ | | BEiT | ❌ | ❌ | ✅ | ❌ | ✅ | diff --git a/utils/check_table.py b/utils/check_table.py index b0f0ed5f9e1..17ab62e4aaa 100644 --- a/utils/check_table.py +++ b/utils/check_table.py @@ -140,7 +140,8 @@ def get_model_table_from_auto_modules(): # Build the table per se table = "|" + "|".join([_center_text(c, w) for c, w in zip(columns, widths)]) + "|\n" - table += "|" + "|".join(["-" * w for w in widths]) + "|\n" + # Use ":-----:" format to center-aligned table cell texts + table += "|" + "|".join([":" + "-" * (w - 2) + ":" for w in widths]) + "|\n" check = {True: "✅", False: "❌"} for name in model_names: