def write(self, path: str, embeddings: Embeddings): """ Helper to write different Formats """ if self == Format.finalfusion: embeddings.write(path) elif self == Format.word2vec: write_word2vec(path, embeddings) elif self == Format.text: write_text(path, embeddings) elif self == Format.textdims: write_text_dims(path, embeddings) elif self == Format.fasttext: write_fasttext(path, embeddings) else: raise ValueError(f"Unknown format {str(self)}")
def write_fifu(path: Union[str, bytes, int, PathLike], embeddings: Embeddings): embeddings.write(path)