Fix HfHubHTTPError reduce error by adding factory function (#3579)
* fixed and added unit test
Signed-off-by: You-Cheng Lin <mses010108@gmail.com>
* Apply style fixes
---------
Signed-off-by: You-Cheng Lin <mses010108@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>