TextClasDataBunch.export does not export the vocab

After running data_clas.export() I try the following:

data_inf = TextClasDataBunch.load_empty(CLS_PATH)
learn = text_classifier_learner(data_inf, drop_mult=0.5, bptt=70, emb_sz=400, nh=1150, nl=3,
                                lin_ftrs=[50], ps=[0.1], alpha=2., beta=1.)

This returns multiple errors because expected objects like vocab arein’t included in the empty DataBunch.

Is there something I’m missing? Or is this a bug?

SOLVED (kind of)

data_inf = TextClasDataBunch.load_empty(CLS_PATH)
data_inf.vocab = vocab
data_inf.c = 8

I had to add the vocab and c attribute manually

UPDATE: Also notice that it doesn’t correctly save the pre-processing functions (it will just use the defaults for the ItemList subclass)