Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

How to create config.json automatically from in-memory objects in order to archive the model? #2377

Closed
ynandwan opened this issue Jan 17, 2019 · 1 comment

Comments

@ynandwan
Copy link

ynandwan commented Jan 17, 2019

Question
I followed the tutorial at https://allennlp.org/tutorials and at the end of it, I have a model object. I now want to archive it to be able to use later. However, archiving it (using archival.archive_model) requires a config file in the serialization directory. Is there a way to create the config file from all the objects(model, vocab etc) that I have in memory?

@joelgrus
Copy link
Contributor

no, there's no way to do this. (there's no explicit specification for what a config file looks like, its structure is implicitly defined by the from_params methods, and even if you had that structure there's still be no programmatic way to extract that data from your classes).

what probably should be done is

(1) add a final section to that tutorial about how to save the weights and vocabulary (and then how to reload them), and then
(2) add a subsequent tutorial for how to train using a config file.

I guess (2) already exists as part of the README in that tutorials directory:

https://github.com/allenai/allennlp/blob/master/tutorials/tagger/README.md#using-config-files

but we need to figure out how to incorporate it into the fancy tutorial. let me open an issue for that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants