Require huggingface_hub>=0.30.0 - #531
Open
SammyTourani wants to merge 1 commit into
Open
SammyTourani wants to merge 1 commit into
SammyTourani wants to merge 1 commit into
Conversation
TimesFM_2p5_200M_torch passes paper_url to PyTorchModelHubMixin, which huggingface_hub only accepts from 0.30.0. With 0.28.x/0.29.x, which the previous floor allowed, `import timesfm` fails with "ModelHubMixin.__init_subclass__() got an unexpected keyword argument 'paper_url'".
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #412
Raise the minimum
huggingface_hubinpyproject.tomlfrom 0.28.0 to 0.30.0. This is aone-line change.
TimesFM_2p5_200M_torchpassespaper_urltoPyTorchModelHubMixin, and huggingface_hubonly accepts that keyword from 0.30.0 (huggingface/huggingface_hub#2917). With 0.28.x or
0.29.x installed, both of which the current floor allows,
import timesfmfails:pip does not upgrade huggingface_hub in that case, because the installed version already
satisfies
>=0.28.0. This is thepaper_urlfailure reported in #412. Theproxiesfailurethat the issue is titled after was already fixed by #435, so with this change both failures
reported there are resolved.
Verification
Command:
python -m pytest tests/ src/timesfm3/ --ignore=src/timesfm3/mlx -p no:cacheprovider -q(fresh Python 3.11 venv, run once per huggingface_hub version)
Result:
Interrupted: 3 errors during collection, 0 tests run. The collection errors areTypeError: ModelHubMixin.__init_subclass__() got an unexpected keyword argument 'paper_url'(tests/test_base_utils.py, tests/test_force_flip_invariance.py) and a follow-on
KeyError: 'timesfm'(tests/test_model_loading.py).114 passed114 passed114 passed, 1 warning. The warning was there before this change:test_model_loading.pypassesproxies=, which huggingface_hub 1.x ignores.MLX backend at the new floor (0.30.0, mlx 0.32.2):
python -m pytest src/timesfm3/mlx -q→20 passed, 14 skipped. The skipped tests require a cached TimesFM 3.0 checkpoint.Install behaviour: I built wheels with
python -m buildand ranpip install "<wheel>[torch]"into an environment that already had huggingface_hub 0.29.3.
Requires-Dist: huggingface_hub>=0.28.0. pip leaveshuggingface_hub at 0.29.3, and
import timesfmraises thepaper_urlTypeError.Requires-Dist: huggingface_hub>=0.30.0. pip upgradeshuggingface_hub, and
import timesfmsucceeds.proxiesfailure from #412, checked against current master: I put the realconfig.jsonfrom
google/timesfm-2.5-200m-pytorchnext to randomly initialised weights and calledTimesFM_2p5_200M_torch.from_pretrained(path)with no extra arguments.TypeError: TimesFM_2p5_200M_torch.__init__() got an unexpected keyword argument 'proxies'.Master loads and picks up
torch_compile: falsefrom the config.Environment: macOS arm64, Python 3.11, torch 2.14.0, jax 0.10.2, flax 0.12.8.