Add a Dockerfile build for the converter only #423
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, converting an existing HF model requires having (1) a Rust environment ready, (2)
rust-bert
repo available and, (3) setting up a Python environment, just for the conversion.For the use case where
(a) a Rust developer wants to utilize an HF model, they would need a Python environment
(b) a data scientist wants to experiment with different models, and a given Rust project that was created for them by Rust devs: they would need a Rust environment, and to set up a
rust-bert
repoAs it seems, the groups are mostly mutually exclusive.
I've created a Dockerfile, which I think is minimal, that only does the conversion. It:
And so, developers and data scientists need only to depend on Docker, and assuming the image is called
rustbert-converter
after it was built to only run:docker run -v "$(pwd)"/<path to model on host>:/model rustbert-converter pytorch_mode.bin
The image expects a
/model
folder which is shared between the container and the host, where the raw pytorch model files are.