Fix transformer.to_disk when dir exists
@@ -182,6 +182,7 @@ class Transformer(Pipe):
def save_model(p):
trf_dir = Path(p).absolute()
+ if not trf_dir.exists():
trf_dir.mkdir()
self.model.attrs["tokenizer"].save_pretrained(str(trf_dir))
transformer = self.model.layers[0].shims[0]._model
