Use yaml to create metadata
# What does this PR do?

This PR leverages `pyaml` to avoid writing yaml manually, as suggested by @julien-c .
note that this can ultimately be in `huggingface_hub` rather than here (but it's great to be able to experiment with this here)<|||||>Yes we were talking about it with @LysandreJik, probably for after the upcoming release!