add a standalone extra file loader for pytorch model (#57591)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/57591
According to dhruvbird we should be able to read a file from pytorch model (which is a zip file) using miniz. This diff added a standalone loader so user can load a JSON (or other type) file in the extra folder of the model. The whole point is to avoid loading pytorch library first, which can be complex (voltron, dynamic loading etc).
With this the hand tracking inference config (D27937516) can no longer depends on pytorch or use dynamic_pytorch. Previous it uses torch::jit::_load_extra_only_for_mobile which requires pytorch to be loaded first. We want to avoid doing that.
Test Plan: buck test caffe2/fb/dynamic_pytorch:extract_file_test
Reviewed By: dhruvbird
Differential Revision: D28140492
fbshipit-source-id: 2fd1570523841f4c35dc2ad8dfde5f1d396a74fa