Closed abedini-arteriaai closed 9 months ago
Hello!
It isn't possible to explicitly disable README creation when saving a model, but you can subclass the SetFitModel to remove the model card creation functionality. For example:
from setfit import SetFitModel
class SetFitModelWithoutModelCard(SetFitModel):
def create_model_card(self, path: str, model_name: Optional[str] = "SetFit Model") -> None:
pass
SetFitModelWithoutModelCard.from_pretrained("...")
# usage continues like normal
I'm not sure why you're experiencing that error to begin with; I'd like to figure that out in the future as well, but this should help in the meantime.
Hi SetFit team,
Is there a way to disable
create_model_card
for README as well?model_body.save
has this option withcreate_model_card=False
, however it automatically will create a model card to save README.This gives a
TemplateAssertionError
and if possible, would like to skip that part entirely as I don't need to save the README.Context for the code in SetFit:
Context for the
TemplateAssertionError
:Edit: for reference of others, upgrading Jinja2 addresses TemplateAssertionError