in huggingface_sb3/push_to_hub.py [0:0]
def _generate_model_card(model_name: str, env_id: str, mean_reward: float, std_reward: float) -> ModelCard:
"""
Generate the model card for the Hub
:param model_name: name of the model
:env_id: name of the environment
:mean_reward: mean reward of the agent
:std_reward: standard deviation of the mean reward of the agent
"""
# Step 1: Select the tags
metadata = _generate_metadata(model_name, env_id, mean_reward, std_reward)
template = """
---
# For reference on model card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1
# Doc / guide: https://huggingface.co/docs/hub/model-cards
{{ card_data }}
---
# **{{ model_name }}** Agent playing **{{ env_id }}**
This is a trained model of a **{{ model_name }}** agent playing **{{ env_id }}**
using the [stable-baselines3 library](https://github.com/DLR-RM/stable-baselines3).
## Usage (with Stable-baselines3)
TODO: Add your code
```python
from stable_baselines3 import ...
from huggingface_sb3 import load_from_hub
...
```
"""
# Step 2: Generate the model card
return ModelCard.from_template(metadata, template_str=template, model_name=model_name, env_id=env_id)