I’m not sure about the transformers library, but the YAML part of HF’s README.md and config.json are like part of the pyton program.
If you want to use a custom model, maybe you need to write your own py file, put it in the same folder and specify it?
I think so when I look at the following actual working custom model repo. (*And maybe you don’t need this much complicated code)
If possible, the fastest way to do this is to find a custom model Repo with a similar algorithm to what you want to do and mimic that setup.
https://huggingface.co/models?pipeline_tag=text2text-generation&library=transformers&sort=modified