tinker_cookbook.weights.generate_model_card
Generated from tinker-cookbook at commit 4a3a282. Source links point at that snapshot.
tinker_cookbook.weights.generate_model_card(config, repo_id, model_path)
Generate a HuggingFace model card from config.
The returned ~huggingface_hub.ModelCard can be previewed with
str(card) or saved with card.save("README.md").
Parameters:
- config (ModelCardConfig) – Model card metadata.
- repo_id (str | None) – HuggingFace repo ID (e.g.
"user/my-model"). Used for the card title and usage snippet. IfNone, a generic title is used. - model_path (str | None) – Local path to the model directory. If provided, auto-detects whether the output is a LoRA adapter (by checking for
adapter_config.json) or a merged model, and adjusts the card content accordingly.
Returns: A ~huggingface_hub.ModelCard with YAML frontmatter and markdown body.