gesistsa / grafzahl

🧛 fine-tuning Transformers for text data from within R
https://gesistsa.github.io/grafzahl/
GNU General Public License v3.0
41 stars 2 forks source link

Serialize the model object #1

Open chainsawriot opened 2 years ago

chainsawriot commented 2 years ago

The current textmodel_transformer is not portable across machine due to the hardcoding of output_dir

https://github.com/chainsawriot/grafzahl/blob/e8b2f81ac47d026c95b3a069a94e075da6cceb21/R/train.R#L52

Until a clever solution is available, a stupid way to serialize the model object is to save the textmodel_transformer object with the whole directory of output_dir. When deserialize, extract the directory into a temp. directory and then rewrite output_dir to that temp directory.