Add mlx-lm version information to HF model card (#596)

* Add mlx-lm version informatiohn to HF model card

* Update llms/mlx_lm/utils.py

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>

* Reverted indentation

* Pre-commit formatting

---------

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>
This commit is contained in:
Chime Ogbuji 2024-03-19 22:42:03 -04:00 committed by GitHub
parent 39d5ca6427
commit 6f2fd5daea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -440,12 +440,14 @@ def upload_to_hub(path: str, upload_repo: str, hf_path: str):
from huggingface_hub import HfApi, ModelCard, logging
from . import __version__
card = ModelCard.load(hf_path)
card.data.tags = ["mlx"] if card.data.tags is None else card.data.tags + ["mlx"]
card.text = dedent(
f"""
# {upload_repo}
This model was converted to MLX format from [`{hf_path}`]().
This model was converted to MLX format from [`{hf_path}`]() using mlx-lm version **{__version__}**.
Refer to the [original model card](https://huggingface.co/{hf_path}) for more details on the model.
## Use with mlx