Ahmad2005 commited on
Commit
4cf2a08
·
verified ·
1 Parent(s): e1094ee

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .cache/pip/http-v2/0/2/f/7/a/02f7a3cfa8e6aa881ea9780e7473e44a5ee78388ef2ddf2bbdaf9c4c +0 -0
  2. .cache/pip/http-v2/0/2/f/7/a/02f7a3cfa8e6aa881ea9780e7473e44a5ee78388ef2ddf2bbdaf9c4c.body +88 -0
  3. .cache/pip/http-v2/0/4/4/7/c/0447ce2249fdae0f8cf52a43e01f215eacdf7c35d89a248bd4b4ebaa +0 -0
  4. .cache/pip/http-v2/2/6/9/6/f/2696f961349c363ba6eaa61f1f16df2705938f26ba64023adb039e90.body +0 -0
  5. .cache/pip/http-v2/2/b/d/2/a/2bd2afb46be8ef29cc0dd505de4aff907384c53895a0fbbce798558e +0 -0
  6. .cache/pip/http-v2/4/5/2/4/1/45241d61b1606b84c3825a9119b750e7cd16e5fac504d31f79203a8e +0 -0
  7. .cache/pip/http-v2/5/2/e/b/0/52eb09ff78f469a17d2b7efae5a925d94693634f88d734649f34a875.body +3 -0
  8. .cache/pip/http-v2/5/9/1/a/0/591a0a7ea47d81cffb332bf5e1460e560ce743822558c6f345314d4b.body +0 -0
  9. .cache/pip/http-v2/7/2/8/a/2/728a2f33f382f4dacf08f6df77aad6f3d889f819ba4fa3efad5ec7e4 +0 -0
  10. .cache/pip/http-v2/7/2/8/a/2/728a2f33f382f4dacf08f6df77aad6f3d889f819ba4fa3efad5ec7e4.body +3 -0
  11. .cache/pip/http-v2/7/5/1/d/d/751ddfa98a60b6475798efa337438e34cb9e1ccfb51f0ff0c13f3a28 +0 -0
  12. .cache/pip/http-v2/7/5/1/d/d/751ddfa98a60b6475798efa337438e34cb9e1ccfb51f0ff0c13f3a28.body +373 -0
  13. .cache/pip/http-v2/7/5/c/7/6/75c76ba3da983fc745a6549a0de110dcd624d42b682204260c21f535 +0 -0
  14. .cache/pip/http-v2/7/5/c/7/6/75c76ba3da983fc745a6549a0de110dcd624d42b682204260c21f535.body +3 -0
  15. .cache/pip/http-v2/7/9/2/1/a/7921ac3318a5cdb592026cc26a94f7a2c1e1f7d3a1dc1e3857fd49f1 +0 -0
  16. .cache/pip/http-v2/7/9/2/1/a/7921ac3318a5cdb592026cc26a94f7a2c1e1f7d3a1dc1e3857fd49f1.body +0 -0
  17. .cache/pip/http-v2/7/a/1/2/2/7a12234cc448f4452405e8d5b4447cba68049d0e6085f64225d7eef0 +0 -0
  18. .cache/pip/http-v2/7/a/1/2/2/7a12234cc448f4452405e8d5b4447cba68049d0e6085f64225d7eef0.body +592 -0
  19. .cache/pip/http-v2/7/f/f/b/a/7ffbaade46b578649cfc115650c307df3346f8f8e3d20f832aa9ec7b +0 -0
  20. .cache/pip/http-v2/7/f/f/b/a/7ffbaade46b578649cfc115650c307df3346f8f8e3d20f832aa9ec7b.body +3 -0
  21. .cache/pip/http-v2/b/1/f/5/d/b1f5dc01896eee598e8915be35e61304ad2b16363d00711f8576642c +0 -0
  22. .cache/pip/http-v2/b/1/f/5/d/b1f5dc01896eee598e8915be35e61304ad2b16363d00711f8576642c.body +3 -0
  23. .cache/pip/http-v2/b/9/9/a/d/b99ad330dfd2e9e0337861ace33d07fca2ddfd480ba4473963ebc23d +0 -0
  24. .cache/pip/http-v2/b/e/5/9/9/be599e435b04e9191df28c1690b91394df11dcc43b78b8097f2cac95 +0 -0
  25. .cache/pip/http-v2/b/e/5/9/9/be599e435b04e9191df28c1690b91394df11dcc43b78b8097f2cac95.body +0 -0
  26. .cache/pip/http-v2/d/3/2/9/d/d329d269473dcb26bc2fcf82e354619e8463ba8855d5a3b77637c124.body +3 -0
  27. .cache/pip/http-v2/d/a/8/1/4/da8145136a84a44f3223fc3ee57fc18e4604ae09f030d21a21c2ecb5.body +3 -0
  28. .cache/pip/http-v2/d/d/2/0/6/dd206ee8d449d4bec512242e8f8ebadb5a808c682766018f3921f62b +0 -0
  29. .cache/pip/http-v2/d/d/2/0/6/dd206ee8d449d4bec512242e8f8ebadb5a808c682766018f3921f62b.body +51 -0
  30. .cache/pip/http-v2/e/a/2/2/a/ea22a79fcbb7a5195dc8846d5b7ddabfe6981d47f448fe52cbe95a8a +0 -0
  31. .cache/pip/http-v2/e/a/2/2/a/ea22a79fcbb7a5195dc8846d5b7ddabfe6981d47f448fe52cbe95a8a.body +0 -0
  32. .cache/pip/http-v2/e/c/8/b/3/ec8b32f74b33a66cdb59c6ce388ac68e5697696325dcbe84554f832d +0 -0
  33. .cache/pip/http-v2/e/c/8/b/3/ec8b32f74b33a66cdb59c6ce388ac68e5697696325dcbe84554f832d.body +139 -0
  34. .cache/pip/http-v2/e/d/e/d/1/eded1062df3a835b1d654db11016327d0de7276866caf329f6f27b1c +0 -0
  35. .cache/pip/http-v2/e/d/e/d/1/eded1062df3a835b1d654db11016327d0de7276866caf329f6f27b1c.body +94 -0
  36. .cache/pip/http-v2/f/1/9/c/b/f19cb9f2548ebec3162f98dc0753cc5fe07d32364a02b1720f376edb +0 -0
  37. .cache/pip/http-v2/f/1/9/c/b/f19cb9f2548ebec3162f98dc0753cc5fe07d32364a02b1720f376edb.body +0 -0
  38. .cache/pip/http-v2/f/6/4/9/7/f64975d28276977ea56e4922737def644a797957c860c54f5b5bc122.body +0 -0
  39. .cache/uv/.gitignore +1 -0
  40. .cache/uv/.lock +0 -0
  41. .cache/uv/CACHEDIR.TAG +1 -0
  42. .cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub-1.26.0.dist-info/METADATA +373 -0
  43. .cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub-1.26.0.dist-info/RECORD +191 -0
  44. .cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub-1.26.0.dist-info/WHEEL +5 -0
  45. .cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub-1.26.0.dist-info/entry_points.txt +7 -0
  46. .cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub-1.26.0.dist-info/top_level.txt +1 -0
  47. .cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub/errors.py +617 -0
  48. .cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub/fastai_utils.py +414 -0
  49. .cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub/hf_api.py +0 -0
  50. .cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub/hub_mixin.py +834 -0
.cache/pip/http-v2/0/2/f/7/a/02f7a3cfa8e6aa881ea9780e7473e44a5ee78388ef2ddf2bbdaf9c4c ADDED
Binary file (1.27 kB). View file
 
.cache/pip/http-v2/0/2/f/7/a/02f7a3cfa8e6aa881ea9780e7473e44a5ee78388ef2ddf2bbdaf9c4c.body ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: Mako
3
+ Version: 1.3.12
4
+ Summary: A super-fast templating language that borrows the best ideas from the existing templating languages.
5
+ Home-page: https://www.makotemplates.org/
6
+ Author: Mike Bayer
7
+ Author-email: mike@zzzcomputing.com
8
+ License: MIT
9
+ Project-URL: Documentation, https://docs.makotemplates.org
10
+ Project-URL: Issue Tracker, https://github.com/sqlalchemy/mako
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Environment :: Web Environment
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: Implementation :: CPython
23
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
24
+ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
25
+ Requires-Python: >=3.8
26
+ Description-Content-Type: text/x-rst
27
+ License-File: LICENSE
28
+ Requires-Dist: MarkupSafe>=0.9.2
29
+ Provides-Extra: testing
30
+ Requires-Dist: pytest; extra == "testing"
31
+ Provides-Extra: babel
32
+ Requires-Dist: Babel; extra == "babel"
33
+ Provides-Extra: lingua
34
+ Requires-Dist: lingua; extra == "lingua"
35
+ Dynamic: license-file
36
+
37
+ =========================
38
+ Mako Templates for Python
39
+ =========================
40
+
41
+ Mako is a template library written in Python. It provides a familiar, non-XML
42
+ syntax which compiles into Python modules for maximum performance. Mako's
43
+ syntax and API borrows from the best ideas of many others, including Django
44
+ templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded
45
+ Python (i.e. Python Server Page) language, which refines the familiar ideas
46
+ of componentized layout and inheritance to produce one of the most
47
+ straightforward and flexible models available, while also maintaining close
48
+ ties to Python calling and scoping semantics.
49
+
50
+ Nutshell
51
+ ========
52
+
53
+ ::
54
+
55
+ <%inherit file="base.html"/>
56
+ <%
57
+ rows = [[v for v in range(0,10)] for row in range(0,10)]
58
+ %>
59
+ <table>
60
+ % for row in rows:
61
+ ${makerow(row)}
62
+ % endfor
63
+ </table>
64
+
65
+ <%def name="makerow(row)">
66
+ <tr>
67
+ % for name in row:
68
+ <td>${name}</td>\
69
+ % endfor
70
+ </tr>
71
+ </%def>
72
+
73
+ Philosophy
74
+ ===========
75
+
76
+ Python is a great scripting language. Don't reinvent the wheel...your templates can handle it !
77
+
78
+ Documentation
79
+ ==============
80
+
81
+ See documentation for Mako at https://docs.makotemplates.org/en/latest/
82
+
83
+ License
84
+ ========
85
+
86
+ Mako is licensed under an MIT-style license (see LICENSE).
87
+ Other incorporated projects may be licensed under different licenses.
88
+ All licenses allow for non-commercial and commercial use.
.cache/pip/http-v2/0/4/4/7/c/0447ce2249fdae0f8cf52a43e01f215eacdf7c35d89a248bd4b4ebaa ADDED
Binary file (1.89 kB). View file
 
.cache/pip/http-v2/2/6/9/6/f/2696f961349c363ba6eaa61f1f16df2705938f26ba64023adb039e90.body ADDED
Binary file (78.5 kB). View file
 
.cache/pip/http-v2/2/b/d/2/a/2bd2afb46be8ef29cc0dd505de4aff907384c53895a0fbbce798558e ADDED
Binary file (1.3 kB). View file
 
.cache/pip/http-v2/4/5/2/4/1/45241d61b1606b84c3825a9119b750e7cd16e5fac504d31f79203a8e ADDED
Binary file (1.3 kB). View file
 
.cache/pip/http-v2/5/2/e/b/0/52eb09ff78f469a17d2b7efae5a925d94693634f88d734649f34a875.body ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db78c39c83d6279daddc98e2238f373ab8980685556d42472b4ec51abcf03e8c
3
+ size 4428006
.cache/pip/http-v2/5/9/1/a/0/591a0a7ea47d81cffb332bf5e1460e560ce743822558c6f345314d4b.body ADDED
Binary file (18.1 kB). View file
 
.cache/pip/http-v2/7/2/8/a/2/728a2f33f382f4dacf08f6df77aad6f3d889f819ba4fa3efad5ec7e4 ADDED
Binary file (1.9 kB). View file
 
.cache/pip/http-v2/7/2/8/a/2/728a2f33f382f4dacf08f6df77aad6f3d889f819ba4fa3efad5ec7e4.body ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:840a36ba7d60efdaf3ac0d4e6edecec318724286033ac51bb825a7fdb3c6d981
3
+ size 123031
.cache/pip/http-v2/7/5/1/d/d/751ddfa98a60b6475798efa337438e34cb9e1ccfb51f0ff0c13f3a28 ADDED
Binary file (1.28 kB). View file
 
.cache/pip/http-v2/7/5/1/d/d/751ddfa98a60b6475798efa337438e34cb9e1ccfb51f0ff0c13f3a28.body ADDED
@@ -0,0 +1,373 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: huggingface_hub
3
+ Version: 1.26.0
4
+ Summary: Client library to download and publish models, datasets and other repos on the huggingface.co hub
5
+ Home-page: https://github.com/huggingface/huggingface_hub
6
+ Author: Hugging Face, Inc.
7
+ Author-email: julien@huggingface.co
8
+ License: Apache-2.0
9
+ Keywords: model-hub machine-learning models natural-language-processing deep-learning pytorch pretrained-models
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Education
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Requires-Python: >=3.10.0
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: click<9.0.0,>=8.4.2
27
+ Requires-Dist: filelock>=3.10.0
28
+ Requires-Dist: fsspec>=2023.5.0
29
+ Requires-Dist: hf-xet<2.0.0,>=1.5.1; platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "arm64" or platform_machine == "aarch64"
30
+ Requires-Dist: httpx<1,>=0.23.0
31
+ Requires-Dist: packaging>=20.9
32
+ Requires-Dist: pyyaml>=5.1
33
+ Requires-Dist: tqdm>=4.42.1
34
+ Requires-Dist: typing-extensions>=4.1.0
35
+ Provides-Extra: oauth
36
+ Requires-Dist: authlib>=1.3.2; extra == "oauth"
37
+ Requires-Dist: fastapi; extra == "oauth"
38
+ Requires-Dist: httpx; extra == "oauth"
39
+ Requires-Dist: itsdangerous; extra == "oauth"
40
+ Provides-Extra: torch
41
+ Requires-Dist: torch; extra == "torch"
42
+ Requires-Dist: safetensors[torch]; extra == "torch"
43
+ Provides-Extra: fastai
44
+ Requires-Dist: toml; extra == "fastai"
45
+ Requires-Dist: fastai>=2.4; extra == "fastai"
46
+ Requires-Dist: fastcore>=1.3.27; extra == "fastai"
47
+ Provides-Extra: hf-xet
48
+ Requires-Dist: hf-xet<2.0.0,>=1.5.1; extra == "hf-xet"
49
+ Provides-Extra: mcp
50
+ Requires-Dist: mcp>=1.8.0; extra == "mcp"
51
+ Provides-Extra: testing
52
+ Requires-Dist: authlib>=1.3.2; extra == "testing"
53
+ Requires-Dist: fastapi; extra == "testing"
54
+ Requires-Dist: httpx; extra == "testing"
55
+ Requires-Dist: itsdangerous; extra == "testing"
56
+ Requires-Dist: jedi; extra == "testing"
57
+ Requires-Dist: Jinja2; extra == "testing"
58
+ Requires-Dist: pytest>=8.4.2; extra == "testing"
59
+ Requires-Dist: pytest-cov; extra == "testing"
60
+ Requires-Dist: pytest-env; extra == "testing"
61
+ Requires-Dist: pytest-xdist; extra == "testing"
62
+ Requires-Dist: pytest-vcr; extra == "testing"
63
+ Requires-Dist: pytest-asyncio; extra == "testing"
64
+ Requires-Dist: pytest-rerunfailures>=16.2; extra == "testing"
65
+ Requires-Dist: pytest-mock; extra == "testing"
66
+ Requires-Dist: urllib3<2.0; extra == "testing"
67
+ Requires-Dist: soundfile; extra == "testing"
68
+ Requires-Dist: Pillow; extra == "testing"
69
+ Requires-Dist: numpy; extra == "testing"
70
+ Requires-Dist: duckdb; extra == "testing"
71
+ Requires-Dist: fastapi; extra == "testing"
72
+ Provides-Extra: gradio
73
+ Requires-Dist: gradio>=5.0.0; extra == "gradio"
74
+ Requires-Dist: requests; extra == "gradio"
75
+ Provides-Extra: typing
76
+ Requires-Dist: typing-extensions>=4.8.0; extra == "typing"
77
+ Requires-Dist: types-PyYAML; extra == "typing"
78
+ Requires-Dist: types-simplejson; extra == "typing"
79
+ Requires-Dist: types-toml; extra == "typing"
80
+ Requires-Dist: types-tqdm; extra == "typing"
81
+ Requires-Dist: types-urllib3; extra == "typing"
82
+ Provides-Extra: quality
83
+ Requires-Dist: ruff>=0.9.0; extra == "quality"
84
+ Requires-Dist: mypy==1.15.0; extra == "quality"
85
+ Requires-Dist: libcst>=1.4.0; extra == "quality"
86
+ Requires-Dist: ty; extra == "quality"
87
+ Provides-Extra: all
88
+ Requires-Dist: authlib>=1.3.2; extra == "all"
89
+ Requires-Dist: fastapi; extra == "all"
90
+ Requires-Dist: httpx; extra == "all"
91
+ Requires-Dist: itsdangerous; extra == "all"
92
+ Requires-Dist: jedi; extra == "all"
93
+ Requires-Dist: Jinja2; extra == "all"
94
+ Requires-Dist: pytest>=8.4.2; extra == "all"
95
+ Requires-Dist: pytest-cov; extra == "all"
96
+ Requires-Dist: pytest-env; extra == "all"
97
+ Requires-Dist: pytest-xdist; extra == "all"
98
+ Requires-Dist: pytest-vcr; extra == "all"
99
+ Requires-Dist: pytest-asyncio; extra == "all"
100
+ Requires-Dist: pytest-rerunfailures>=16.2; extra == "all"
101
+ Requires-Dist: pytest-mock; extra == "all"
102
+ Requires-Dist: urllib3<2.0; extra == "all"
103
+ Requires-Dist: soundfile; extra == "all"
104
+ Requires-Dist: Pillow; extra == "all"
105
+ Requires-Dist: numpy; extra == "all"
106
+ Requires-Dist: duckdb; extra == "all"
107
+ Requires-Dist: fastapi; extra == "all"
108
+ Requires-Dist: ruff>=0.9.0; extra == "all"
109
+ Requires-Dist: mypy==1.15.0; extra == "all"
110
+ Requires-Dist: libcst>=1.4.0; extra == "all"
111
+ Requires-Dist: ty; extra == "all"
112
+ Requires-Dist: typing-extensions>=4.8.0; extra == "all"
113
+ Requires-Dist: types-PyYAML; extra == "all"
114
+ Requires-Dist: types-simplejson; extra == "all"
115
+ Requires-Dist: types-toml; extra == "all"
116
+ Requires-Dist: types-tqdm; extra == "all"
117
+ Requires-Dist: types-urllib3; extra == "all"
118
+ Provides-Extra: dev
119
+ Requires-Dist: authlib>=1.3.2; extra == "dev"
120
+ Requires-Dist: fastapi; extra == "dev"
121
+ Requires-Dist: httpx; extra == "dev"
122
+ Requires-Dist: itsdangerous; extra == "dev"
123
+ Requires-Dist: jedi; extra == "dev"
124
+ Requires-Dist: Jinja2; extra == "dev"
125
+ Requires-Dist: pytest>=8.4.2; extra == "dev"
126
+ Requires-Dist: pytest-cov; extra == "dev"
127
+ Requires-Dist: pytest-env; extra == "dev"
128
+ Requires-Dist: pytest-xdist; extra == "dev"
129
+ Requires-Dist: pytest-vcr; extra == "dev"
130
+ Requires-Dist: pytest-asyncio; extra == "dev"
131
+ Requires-Dist: pytest-rerunfailures>=16.2; extra == "dev"
132
+ Requires-Dist: pytest-mock; extra == "dev"
133
+ Requires-Dist: urllib3<2.0; extra == "dev"
134
+ Requires-Dist: soundfile; extra == "dev"
135
+ Requires-Dist: Pillow; extra == "dev"
136
+ Requires-Dist: numpy; extra == "dev"
137
+ Requires-Dist: duckdb; extra == "dev"
138
+ Requires-Dist: fastapi; extra == "dev"
139
+ Requires-Dist: ruff>=0.9.0; extra == "dev"
140
+ Requires-Dist: mypy==1.15.0; extra == "dev"
141
+ Requires-Dist: libcst>=1.4.0; extra == "dev"
142
+ Requires-Dist: ty; extra == "dev"
143
+ Requires-Dist: typing-extensions>=4.8.0; extra == "dev"
144
+ Requires-Dist: types-PyYAML; extra == "dev"
145
+ Requires-Dist: types-simplejson; extra == "dev"
146
+ Requires-Dist: types-toml; extra == "dev"
147
+ Requires-Dist: types-tqdm; extra == "dev"
148
+ Requires-Dist: types-urllib3; extra == "dev"
149
+ Dynamic: author
150
+ Dynamic: author-email
151
+ Dynamic: classifier
152
+ Dynamic: description
153
+ Dynamic: description-content-type
154
+ Dynamic: home-page
155
+ Dynamic: keywords
156
+ Dynamic: license
157
+ Dynamic: license-file
158
+ Dynamic: provides-extra
159
+ Dynamic: requires-dist
160
+ Dynamic: requires-python
161
+ Dynamic: summary
162
+
163
+ <p align="center">
164
+ <picture>
165
+ <source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub-dark.svg">
166
+ <source media="(prefers-color-scheme: light)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg">
167
+ <img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="352" height="59" style="max-width: 100%">
168
+ </picture>
169
+ <br/>
170
+ <br/>
171
+ </p>
172
+
173
+ <p align="center">
174
+ <i>The official CLI and Python client for the Hugging Face Hub.</i>
175
+ <br/>
176
+ <a href="#what-is-huggingface_hub">About</a>
177
+ ·
178
+ <a href="https://huggingface.co/docs/huggingface_hub">Documentation</a>
179
+ ·
180
+ <a href="https://huggingface.co/docs/huggingface_hub/en/installation">Install</a>
181
+ ·
182
+ <a href="https://huggingface.co/docs/huggingface_hub/en/guides/cli">CLI Guide</a>
183
+ ·
184
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/CONTRIBUTING.md">Contributing</a>
185
+ </p>
186
+
187
+ <p align="center">
188
+ <a href="https://huggingface.co/docs/huggingface_hub/en/index"><img alt="Documentation" src="https://img.shields.io/website/http/huggingface.co/docs/huggingface_hub/index.svg?down_color=red&down_message=offline&up_message=online&label=doc"></a>
189
+ <a href="https://github.com/huggingface/huggingface_hub/releases"><img alt="GitHub release" src="https://img.shields.io/github/release/huggingface/huggingface_hub.svg"></a>
190
+ <a href="https://github.com/huggingface/huggingface_hub"><img alt="PyPi version" src="https://img.shields.io/pypi/pyversions/huggingface_hub.svg"></a>
191
+ <a href="https://pypi.org/project/huggingface-hub"><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/huggingface_hub"></a>
192
+ <a href="https://codecov.io/gh/huggingface/huggingface_hub"><img alt="Code coverage" src="https://codecov.io/gh/huggingface/huggingface_hub/branch/main/graph/badge.svg?token=RXP95LE2XL"></a>
193
+ </p>
194
+
195
+ <h4 align="center">
196
+ <p>
197
+ <b>English</b> |
198
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_de.md">Deutsch</a> |
199
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_fr.md">Français</a> |
200
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_hi.md">हिंदी</a> |
201
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_ko.md">한국어</a> |
202
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_cn.md">中文 (简体)</a> |
203
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_kn.md">ಕನ್ನಡ</a>
204
+ </p>
205
+ </h4>
206
+
207
+ ## Quick start
208
+
209
+ Install the [`hf` CLI](https://huggingface.co/docs/huggingface_hub/en/guides/cli) with the standalone installer:
210
+
211
+ ```bash
212
+ # On macOS and Linux.
213
+ curl -LsSf https://hf.co/cli/install.sh | bash
214
+ ```
215
+
216
+ ```powershell
217
+ # On Windows.
218
+ powershell -ExecutionPolicy ByPass -c "irm https://hf.co/cli/install.ps1 | iex"
219
+ ```
220
+
221
+ Log in, then start working with the Hub:
222
+
223
+ ```bash
224
+ # Log in (use --token $HF_TOKEN in non-interactive environments)
225
+ hf auth login
226
+
227
+ # Find models served by Inference Providers
228
+ hf models ls --warm
229
+
230
+ # Download a model
231
+ hf download Qwen/Qwen3-0.6B
232
+
233
+ # Upload files to your own repo
234
+ hf upload username/my-cool-model ./model.safetensors
235
+
236
+ # Sync a local folder to a storage bucket
237
+ hf buckets sync ./checkpoints hf://buckets/username/my-bucket
238
+
239
+ # Run a job on Hugging Face infrastructure
240
+ hf jobs run python:3.12 python -c "print('Hello from the cloud!')"
241
+
242
+ # Discover everything else
243
+ hf --help
244
+ ```
245
+
246
+ The Hub uses tokens to authenticate applications (see [docs](https://huggingface.co/docs/hub/security-tokens)). Check out the [CLI guide](https://huggingface.co/docs/huggingface_hub/en/guides/cli) for a tour of the main features.
247
+
248
+ ## What is `huggingface_hub`?
249
+
250
+ The `huggingface_hub` library allows you to interact with the [Hugging Face Hub](https://huggingface.co/), a platform democratizing open-source Machine Learning for creators and collaborators. Discover pre-trained models and datasets for your projects, play with the thousands of machine learning apps hosted on the Hub, or create and share your own models, datasets and demos with the community. Everything ships in one package with two interfaces: the [`hf` CLI](https://huggingface.co/docs/huggingface_hub/en/guides/cli) for your terminal and the `huggingface_hub` library for Python — both designed to work well for humans and AI agents. Use them to:
251
+
252
+ - [Download files](https://huggingface.co/docs/huggingface_hub/en/guides/download) from the Hub.
253
+ - [Upload files](https://huggingface.co/docs/huggingface_hub/en/guides/upload) to the Hub.
254
+ - [Manage your repositories](https://huggingface.co/docs/huggingface_hub/en/guides/repository).
255
+ - [Run Inference](https://huggingface.co/docs/huggingface_hub/en/guides/inference) on deployed models.
256
+ - [Run Jobs](https://huggingface.co/docs/huggingface_hub/en/guides/jobs) on Hugging Face infrastructure.
257
+ - [Search](https://huggingface.co/docs/huggingface_hub/en/guides/search) for models, datasets and Spaces.
258
+ - [Share Model Cards](https://huggingface.co/docs/huggingface_hub/en/guides/model-cards) to document your models.
259
+ - [Engage with the community](https://huggingface.co/docs/huggingface_hub/en/guides/community) through PRs and comments.
260
+ - Do all of the above from the terminal with the [`hf` CLI](https://huggingface.co/docs/huggingface_hub/en/guides/cli).
261
+
262
+ ## Built for humans and AI agents
263
+
264
+ The `hf` CLI is designed for people and coding agents alike: the same commands adapt their output when run by an agent. If you use Claude Code, Codex, Cursor, or another coding agent, install the `hf` CLI Skill — a command reference generated from your installed CLI:
265
+
266
+ ```bash
267
+ # for Codex, Cursor, OpenCode, Pi and other agents that load skills from `.agents/skills`
268
+ hf skills add
269
+ # includes the above + Claude Code
270
+ hf skills add --claude
271
+ ```
272
+
273
+ Learn more in the [Hugging Face CLI for AI agents guide](https://huggingface.co/docs/hub/agents-cli) and the [announcement blog post](https://huggingface.co/blog/hf-cli-for-agents).
274
+
275
+ ## Use the Python library
276
+
277
+ Install the `huggingface_hub` package with [pip](https://pypi.org/project/huggingface-hub/) (this also installs the `hf` CLI):
278
+
279
+ ```bash
280
+ pip install huggingface_hub
281
+ ```
282
+
283
+ We recommend using [`uv`](https://docs.astral.sh/uv/) for a fast and reliable install:
284
+
285
+ ```bash
286
+ uv pip install huggingface_hub
287
+ ```
288
+
289
+ In order to keep the package minimal by default, `huggingface_hub` comes with optional dependencies useful for some use cases. For example, if you want to use the MCP module, run:
290
+
291
+ ```bash
292
+ pip install "huggingface_hub[mcp]"
293
+ ```
294
+
295
+ To learn more about installation and optional dependencies, check out the [installation guide](https://huggingface.co/docs/huggingface_hub/en/installation).
296
+
297
+ ### Download files
298
+
299
+ Download a single file
300
+
301
+ ```py
302
+ from huggingface_hub import hf_hub_download
303
+
304
+ hf_hub_download(repo_id="zai-org/GLM-5.2", filename="config.json")
305
+ ```
306
+
307
+ Or an entire repository
308
+
309
+ ```py
310
+ from huggingface_hub import snapshot_download
311
+
312
+ snapshot_download("sentence-transformers/all-MiniLM-L6-v2")
313
+ ```
314
+
315
+ Files will be downloaded in a local cache folder. More details in [this guide](https://huggingface.co/docs/huggingface_hub/en/guides/manage-cache).
316
+
317
+ ### Create a repository
318
+
319
+ ```py
320
+ from huggingface_hub import create_repo
321
+
322
+ create_repo(repo_id="super-cool-model")
323
+ ```
324
+
325
+ ### Upload files
326
+
327
+ Upload a single file
328
+
329
+ ```py
330
+ from huggingface_hub import upload_file
331
+
332
+ upload_file(
333
+ path_or_fileobj="/home/lysandre/dummy-test/README.md",
334
+ path_in_repo="README.md",
335
+ repo_id="lysandre/test-model",
336
+ )
337
+ ```
338
+
339
+ Or an entire folder
340
+
341
+ ```py
342
+ from huggingface_hub import upload_folder
343
+
344
+ upload_folder(
345
+ folder_path="/path/to/local/space",
346
+ repo_id="username/my-cool-space",
347
+ repo_type="space",
348
+ )
349
+ ```
350
+
351
+ More details in the [upload guide](https://huggingface.co/docs/huggingface_hub/en/guides/upload).
352
+
353
+ ## Integrating with the Hub.
354
+
355
+ We're partnering with cool open source ML libraries to provide free model hosting and versioning. You can find the existing integrations [here](https://huggingface.co/docs/hub/libraries).
356
+
357
+ The advantages are:
358
+
359
+ - Free model or dataset hosting for libraries and their users.
360
+ - Built-in file versioning, even with very large files, made possible by [Xet](https://huggingface.co/docs/hub/xet/index), the Hub's chunk-deduplicated storage backend.
361
+ - In-browser widgets to play with the uploaded models.
362
+ - Anyone can upload a new model for your library, they just need to add the corresponding tag for the model to be discoverable.
363
+ - Fast downloads! We use Cloudfront (a CDN) to geo-replicate downloads so they're blazing fast from anywhere on the globe.
364
+ - Usage stats and more features to come.
365
+
366
+ If you would like to integrate your library, feel free to open an issue to begin the discussion. We wrote a [step-by-step guide](https://huggingface.co/docs/hub/adding-a-library) with ❤️ showing how to do this integration.
367
+
368
+ ## Contributions (feature requests, bugs, etc.) are super welcome 💙💚💛💜🧡❤️
369
+
370
+ Everyone is welcome to contribute, and we value everybody's contribution. Code is not the only way to help the community.
371
+ Answering questions, helping others, reaching out and improving the documentations are immensely valuable to the community.
372
+ We wrote a [contribution guide](https://github.com/huggingface/huggingface_hub/blob/main/CONTRIBUTING.md) to summarize
373
+ how to get started to contribute to this repository.
.cache/pip/http-v2/7/5/c/7/6/75c76ba3da983fc745a6549a0de110dcd624d42b682204260c21f535 ADDED
Binary file (1.2 kB). View file
 
.cache/pip/http-v2/7/5/c/7/6/75c76ba3da983fc745a6549a0de110dcd624d42b682204260c21f535.body ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd6f3f93c9a0a7cc2788ee63fb763353d4bd2e89b0751bc78fcf7dda00bea774
3
+ size 516040
.cache/pip/http-v2/7/9/2/1/a/7921ac3318a5cdb592026cc26a94f7a2c1e1f7d3a1dc1e3857fd49f1 ADDED
Binary file (1.89 kB). View file
 
.cache/pip/http-v2/7/9/2/1/a/7921ac3318a5cdb592026cc26a94f7a2c1e1f7d3a1dc1e3857fd49f1.body ADDED
Binary file (1.94 kB). View file
 
.cache/pip/http-v2/7/a/1/2/2/7a12234cc448f4452405e8d5b4447cba68049d0e6085f64225d7eef0 ADDED
Binary file (1.24 kB). View file
 
.cache/pip/http-v2/7/a/1/2/2/7a12234cc448f4452405e8d5b4447cba68049d0e6085f64225d7eef0.body ADDED
@@ -0,0 +1,592 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.1
2
+ Name: timm
3
+ Version: 1.0.28
4
+ Summary: PyTorch Image Models
5
+ Keywords: pytorch,image-classification
6
+ Author-Email: Ross Wightman <ross@huggingface.co>
7
+ License: Apache-2.0
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Education
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Scientific/Engineering
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Classifier: Topic :: Software Development
20
+ Classifier: Topic :: Software Development :: Libraries
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Project-URL: homepage, https://github.com/huggingface/pytorch-image-models
23
+ Project-URL: documentation, https://huggingface.co/docs/timm/en/index
24
+ Project-URL: repository, https://github.com/huggingface/pytorch-image-models
25
+ Requires-Python: >=3.8
26
+ Requires-Dist: torch
27
+ Requires-Dist: torchvision
28
+ Requires-Dist: pyyaml
29
+ Requires-Dist: huggingface_hub
30
+ Requires-Dist: safetensors
31
+ Description-Content-Type: text/markdown
32
+
33
+ # PyTorch Image Models
34
+ - [What's New](#whats-new)
35
+ - [Introduction](#introduction)
36
+ - [Models](#models)
37
+ - [Features](#features)
38
+ - [Results](#results)
39
+ - [Getting Started (Documentation)](#getting-started-documentation)
40
+ - [Train, Validation, Inference Scripts](#train-validation-inference-scripts)
41
+ - [Awesome PyTorch Resources](#awesome-pytorch-resources)
42
+ - [Licenses](#licenses)
43
+ - [Citing](#citing)
44
+
45
+ ## What's New
46
+
47
+ ## July 10, 2026
48
+ * Improve optimizer `torch.compile` and tensor learning-rate support.
49
+ * Extend NaFlexViT patch-layout (for NaFlex-CLAP), and `forward_intermediates` (NaFlex dict input) support.
50
+ * Harden pickle loading and improve custom-label inference.
51
+ * Release 1.0.28
52
+
53
+ ## May 27, 2026
54
+ * Add model defs and pretrained weights for EUPE ViT (DINOv3-style) and ConvNeXt models. See the [Efficient Universal Perception Encoder paper](https://arxiv.org/abs/2603.22387).
55
+ * Add TIPSv2 model defs and pretrained weights for (DINOv2-style) ViTs. See the [TIPSv2 paper](https://arxiv.org/abs/2604.12012).
56
+
57
+ ## May 8, 2026
58
+ * Release 1.0.27
59
+
60
+ ## April 23, 2026
61
+ * Add Gemma4 ViT encoders w/ NaFlex pipeline support (variable aspect/size per image). Thanks [Yonghye Kwon](https://github.com/developer0hye)
62
+ * Support DINOv3 weights in NaFlexVit. Thanks [Yonghye Kwon](https://github.com/developer0hye)
63
+ * Some improvements to Muon fallback (AdamW/NadamW) lr behavior
64
+
65
+ ## March 23, 2026
66
+ * Improve pickle checkpoint handling security. Default all loading to `weights_only=True`, add safe_global for ArgParse.
67
+ * Improve attention mask handling for core ViT/EVA models & layers. Resolve bool masks, pass `is_causal` through for SSL tasks.
68
+ * Fix class & register token uses with ViT and no pos embed enabled.
69
+ * Add Patch Representation Refinement (PRR) as a pooling option in ViT. Thanks Sina (https://github.com/sinahmr).
70
+ * Improve consistency of output projection / MLP dimensions for attention pooling layers.
71
+ * Hiera model F.SDPA optimization to allow Flash Attention kernel use.
72
+ * Caution added to SGDP optimizer.
73
+ * Release 1.0.26. First maintenance release since my departure from Hugging Face.
74
+
75
+ ## Feb 23, 2026
76
+ * Add token distillation training support to distillation task wrappers
77
+ * Remove some torch.jit usage in prep for official deprecation
78
+ * Caution added to AdamP optimizer
79
+ * Call reset_parameters() even if meta-device init so that buffers get init w/ hacks like init_empty_weights
80
+ * Tweak Muon optimizer to work with DTensor/FSDP2 (clamp_ instead of clamp_min_, alternate NS branch for DTensor)
81
+ * Release 1.0.25
82
+
83
+ ## Jan 21, 2026
84
+ * **Compat Break**: Fix oversight w/ QKV vs MLP bias in `ParallelScalingBlock` (& `DiffParallelScalingBlock`)
85
+ * Does not impact any trained `timm` models but could impact downstream use.
86
+
87
+ ## Jan 5 & 6, 2026
88
+ * Release 1.0.24
89
+ * Add new benchmark result csv files for inference timing on all models w/ RTX Pro 6000, 5090, and 4090 cards w/ PyTorch 2.9.1
90
+ * Fix moved module error in deprecated timm.models.layers import path that impacts legacy imports
91
+ * Release 1.0.23
92
+
93
+ ## Dec 30, 2025
94
+ * Add better NAdaMuon trained `dpwee`, `dwee`, `dlittle` (differential) ViTs with a small boost over previous runs
95
+ * https://huggingface.co/timm/vit_dlittle_patch16_reg1_gap_256.sbb_nadamuon_in1k (83.24% top-1)
96
+ * https://huggingface.co/timm/vit_dwee_patch16_reg1_gap_256.sbb_nadamuon_in1k (81.80% top-1)
97
+ * https://huggingface.co/timm/vit_dpwee_patch16_reg1_gap_256.sbb_nadamuon_in1k (81.67% top-1)
98
+ * Add a ~21M param `timm` variant of the CSATv2 model at 512x512 & 640x640
99
+ * https://huggingface.co/timm/csatv2_21m.sw_r640_in1k (83.13% top-1)
100
+ * https://huggingface.co/timm/csatv2_21m.sw_r512_in1k (82.58% top-1)
101
+ * Factor non-persistent param init out of `__init__` into a common method that can be externally called via `init_non_persistent_buffers()` after meta-device init.
102
+
103
+ ## Dec 12, 2025
104
+ * Add CSATV2 model (thanks https://github.com/gusdlf93) -- a lightweight but high res model with DCT stem & spatial attention. https://huggingface.co/Hyunil/CSATv2
105
+ * Add AdaMuon and NAdaMuon optimizer support to existing `timm` Muon impl. Appears more competitive vs AdamW with familiar hparams for image tasks.
106
+ * End of year PR cleanup, merge aspects of several long open PR
107
+ * Merge differential attention (`DiffAttention`), add corresponding `DiffParallelScalingBlock` (for ViT), train some wee vits
108
+ * https://huggingface.co/timm/vit_dwee_patch16_reg1_gap_256.sbb_in1k
109
+ * https://huggingface.co/timm/vit_dpwee_patch16_reg1_gap_256.sbb_in1k
110
+ * Add a few pooling modules, `LsePlus` and `SimPool`
111
+ * Cleanup, optimize `DropBlock2d` (also add support to ByobNet based models)
112
+ * Bump unit tests to PyTorch 2.9.1 + Python 3.13 on upper end, lower still PyTorch 1.13 + Python 3.10
113
+
114
+ ## Dec 1, 2025
115
+ * Add lightweight task abstraction, add logits and feature distillation support to train script via new tasks.
116
+ * Remove old APEX AMP support
117
+
118
+ ## Nov 4, 2025
119
+ * Fix LayerScale / LayerScale2d init bug (init values ignored), introduced in 1.0.21. Thanks https://github.com/Ilya-Fradlin
120
+ * Release 1.0.22
121
+
122
+ ## Oct 31, 2025 🎃
123
+ * Update imagenet & OOD variant result csv files to include a few new models and verify correctness over several torch & timm versions
124
+ * EfficientNet-X and EfficientNet-H B5 model weights added as part of a hparam search for AdamW vs Muon (still iterating on Muon runs)
125
+
126
+ ## Oct 16-20, 2025
127
+ * Add an impl of the Muon optimizer (based on https://github.com/KellerJordan/Muon) with customizations
128
+ * extra flexibility and improved handling for conv weights and fallbacks for weight shapes not suited for orthogonalization
129
+ * small speedup for NS iterations by reducing allocs and using fused (b)add(b)mm ops
130
+ * by default uses AdamW (or NAdamW if `nesterov=True`) updates if muon not suitable for parameter shape (or excluded via param group flag)
131
+ * like torch impl, select from several LR scale adjustment fns via `adjust_lr_fn`
132
+ * select from several NS coefficient presets or specify your own via `ns_coefficients`
133
+ * First 2 steps of 'meta' device model initialization supported
134
+ * Fix several ops that were breaking creation under 'meta' device context
135
+ * Add device & dtype factory kwarg support to all models and modules (anything inherting from nn.Module) in `timm`
136
+ * License fields added to pretrained cfgs in code
137
+ * Release 1.0.21
138
+
139
+ ## Sept 21, 2025
140
+ * Remap DINOv3 ViT weight tags from `lvd_1689m` -> `lvd1689m` to match (same for `sat_493m` -> `sat493m`)
141
+ * Release 1.0.20
142
+
143
+ ## Sept 17, 2025
144
+ * DINOv3 (https://arxiv.org/abs/2508.10104) ConvNeXt and ViT models added. ConvNeXt models were mapped to existing `timm` model. ViT support done via the EVA base model w/ a new `RotaryEmbeddingDinoV3` to match the DINOv3 specific RoPE impl
145
+ * HuggingFace Hub: https://huggingface.co/collections/timm/timm-dinov3-68cb08bb0bee365973d52a4d
146
+ * MobileCLIP-2 (https://arxiv.org/abs/2508.20691) vision encoders. New MCI3/MCI4 FastViT variants added and weights mapped to existing FastViT and B, L/14 ViTs.
147
+ * MetaCLIP-2 Worldwide (https://arxiv.org/abs/2507.22062) ViT encoder weights added.
148
+ * SigLIP-2 (https://arxiv.org/abs/2502.14786) NaFlex ViT encoder weights added via timm NaFlexViT model.
149
+ * Misc fixes and contributions
150
+
151
+ ## July 23, 2025
152
+ * Add `set_input_size()` method to EVA models, used by OpenCLIP 3.0.0 to allow resizing for timm based encoder models.
153
+ * Release 1.0.18, needed for PE-Core S & T models in OpenCLIP 3.0.0
154
+ * Fix small typing issue that broke Python 3.9 compat. 1.0.19 patch release.
155
+
156
+ ## July 21, 2025
157
+ * ROPE support added to NaFlexViT. All models covered by the EVA base (`eva.py`) including EVA, EVA02, Meta PE ViT, `timm` SBB ViT w/ ROPE, and Naver ROPE-ViT can be now loaded in NaFlexViT when `use_naflex=True` passed at model creation time
158
+ * More Meta PE ViT encoders added, including small/tiny variants, lang variants w/ tiling, and more spatial variants.
159
+ * PatchDropout fixed with NaFlexViT and also w/ EVA models (regression after adding Naver ROPE-ViT)
160
+ * Fix XY order with grid_indexing='xy', impacted non-square image use in 'xy' mode (only ROPE-ViT and PE impacted).
161
+
162
+ ## July 7, 2025
163
+ * MobileNet-v5 backbone tweaks for improved Google Gemma 3n behaviour (to pair with updated official weights)
164
+ * Add stem bias (zero'd in updated weights, compat break with old weights)
165
+ * GELU -> GELU (tanh approx). A minor change to be closer to JAX
166
+ * Add two arguments to layer-decay support, a min scale clamp and 'no optimization' scale threshold
167
+ * Add 'Fp32' LayerNorm, RMSNorm, SimpleNorm variants that can be enabled to force computation of norm in float32
168
+ * Some typing, argument cleanup for norm, norm+act layers done with above
169
+ * Support Naver ROPE-ViT (https://github.com/naver-ai/rope-vit) in `eva.py`, add RotaryEmbeddingMixed module for mixed mode, weights on HuggingFace Hub
170
+
171
+ |model |img_size|top1 |top5 |param_count|
172
+ |--------------------------------------------------|--------|------|------|-----------|
173
+ |vit_large_patch16_rope_mixed_ape_224.naver_in1k |224 |84.84 |97.122|304.4 |
174
+ |vit_large_patch16_rope_mixed_224.naver_in1k |224 |84.828|97.116|304.2 |
175
+ |vit_large_patch16_rope_ape_224.naver_in1k |224 |84.65 |97.154|304.37 |
176
+ |vit_large_patch16_rope_224.naver_in1k |224 |84.648|97.122|304.17 |
177
+ |vit_base_patch16_rope_mixed_ape_224.naver_in1k |224 |83.894|96.754|86.59 |
178
+ |vit_base_patch16_rope_mixed_224.naver_in1k |224 |83.804|96.712|86.44 |
179
+ |vit_base_patch16_rope_ape_224.naver_in1k |224 |83.782|96.61 |86.59 |
180
+ |vit_base_patch16_rope_224.naver_in1k |224 |83.718|96.672|86.43 |
181
+ |vit_small_patch16_rope_224.naver_in1k |224 |81.23 |95.022|21.98 |
182
+ |vit_small_patch16_rope_mixed_224.naver_in1k |224 |81.216|95.022|21.99 |
183
+ |vit_small_patch16_rope_ape_224.naver_in1k |224 |81.004|95.016|22.06 |
184
+ |vit_small_patch16_rope_mixed_ape_224.naver_in1k |224 |80.986|94.976|22.06 |
185
+ * Some cleanup of ROPE modules, helpers, and FX tracing leaf registration
186
+ * Preparing version 1.0.17 release
187
+
188
+ ## June 26, 2025
189
+ * MobileNetV5 backbone (w/ encoder only variant) for [Gemma 3n](https://ai.google.dev/gemma/docs/gemma-3n#parameters) image encoder
190
+ * Version 1.0.16 released
191
+
192
+ ## June 23, 2025
193
+ * Add F.grid_sample based 2D and factorized pos embed resize to NaFlexViT. Faster when lots of different sizes (based on example by https://github.com/stas-sl).
194
+ * Further speed up patch embed resample by replacing vmap with matmul (based on snippet by https://github.com/stas-sl).
195
+ * Add 3 initial native aspect NaFlexViT checkpoints created while testing, ImageNet-1k and 3 different pos embed configs w/ same hparams.
196
+
197
+ | Model | Top-1 Acc | Top-5 Acc | Params (M) | Eval Seq Len |
198
+ |:---|:---:|:---:|:---:|:---:|
199
+ | [naflexvit_base_patch16_par_gap.e300_s576_in1k](https://hf.co/timm/naflexvit_base_patch16_par_gap.e300_s576_in1k) | 83.67 | 96.45 | 86.63 | 576 |
200
+ | [naflexvit_base_patch16_parfac_gap.e300_s576_in1k](https://hf.co/timm/naflexvit_base_patch16_parfac_gap.e300_s576_in1k) | 83.63 | 96.41 | 86.46 | 576 |
201
+ | [naflexvit_base_patch16_gap.e300_s576_in1k](https://hf.co/timm/naflexvit_base_patch16_gap.e300_s576_in1k) | 83.50 | 96.46 | 86.63 | 576 |
202
+ * Support gradient checkpointing for `forward_intermediates` and fix some checkpointing bugs. Thanks https://github.com/brianhou0208
203
+ * Add 'corrected weight decay' (https://arxiv.org/abs/2506.02285) as option to AdamW (legacy), Adopt, Kron, Adafactor (BV), Lamb, LaProp, Lion, NadamW, RmsPropTF, SGDW optimizers
204
+ * Switch PE (perception encoder) ViT models to use native timm weights instead of remapping on the fly
205
+ * Fix cuda stream bug in prefetch loader
206
+
207
+ ## June 5, 2025
208
+ * Initial NaFlexVit model code. NaFlexVit is a Vision Transformer with:
209
+ 1. Encapsulated embedding and position encoding in a single module
210
+ 2. Support for nn.Linear patch embedding on pre-patchified (dictionary) inputs
211
+ 3. Support for NaFlex variable aspect, variable resolution (SigLip-2: https://arxiv.org/abs/2502.14786)
212
+ 4. Support for FlexiViT variable patch size (https://arxiv.org/abs/2212.08013)
213
+ 5. Support for NaViT fractional/factorized position embedding (https://arxiv.org/abs/2307.06304)
214
+ * Existing vit models in `vision_transformer.py` can be loaded into the NaFlexVit model by adding the `use_naflex=True` flag to `create_model`
215
+ * Some native weights coming soon
216
+ * A full NaFlex data pipeline is available that allows training / fine-tuning / evaluating with variable aspect / size images
217
+ * To enable in `train.py` and `validate.py` add the `--naflex-loader` arg, must be used with a NaFlexVit
218
+ * To evaluate an existing (classic) ViT loaded in NaFlexVit model w/ NaFlex data pipe:
219
+ * `python validate.py /imagenet --amp -j 8 --model vit_base_patch16_224 --model-kwargs use_naflex=True --naflex-loader --naflex-max-seq-len 256`
220
+ * The training has some extra args features worth noting
221
+ * The `--naflex-train-seq-lens'` argument specifies which sequence lengths to randomly pick from per batch during training
222
+ * The `--naflex-max-seq-len` argument sets the target sequence length for validation
223
+ * Adding `--model-kwargs enable_patch_interpolator=True --naflex-patch-sizes 12 16 24` will enable random patch size selection per-batch w/ interpolation
224
+ * The `--naflex-loss-scale` arg changes loss scaling mode per batch relative to the batch size, `timm` NaFlex loading changes the batch size for each seq len
225
+
226
+ ## May 28, 2025
227
+ * Add a number of small/fast models thanks to https://github.com/brianhou0208
228
+ * SwiftFormer - [(ICCV2023) SwiftFormer: Efficient Additive Attention for Transformer-based Real-time Mobile Vision Applications](https://github.com/Amshaker/SwiftFormer)
229
+ * FasterNet - [(CVPR2023) Run, Don’t Walk: Chasing Higher FLOPS for Faster Neural Networks](https://github.com/JierunChen/FasterNet)
230
+ * SHViT - [(CVPR2024) SHViT: Single-Head Vision Transformer with Memory Efficient](https://github.com/ysj9909/SHViT)
231
+ * StarNet - [(CVPR2024) Rewrite the Stars](https://github.com/ma-xu/Rewrite-the-Stars)
232
+ * GhostNet-V3 [GhostNetV3: Exploring the Training Strategies for Compact Models](https://github.com/huawei-noah/Efficient-AI-Backbones/tree/master/ghostnetv3_pytorch)
233
+ * Update EVA ViT (closest match) to support Perception Encoder models (https://arxiv.org/abs/2504.13181) from Meta, loading Hub weights but I still need to push dedicated `timm` weights
234
+ * Add some flexibility to ROPE impl
235
+ * Big increase in number of models supporting `forward_intermediates()` and some additional fixes thanks to https://github.com/brianhou0208
236
+ * DaViT, EdgeNeXt, EfficientFormerV2, EfficientViT(MIT), EfficientViT(MSRA), FocalNet, GCViT, HGNet /V2, InceptionNeXt, Inception-V4, MambaOut, MetaFormer, NesT, Next-ViT, PiT, PVT V2, RepGhostNet, RepViT, ResNetV2, ReXNet, TinyViT, TResNet, VoV
237
+ * TNT model updated w/ new weights `forward_intermediates()` thanks to https://github.com/brianhou0208
238
+ * Add `local-dir:` pretrained schema, can use `local-dir:/path/to/model/folder` for model name to source model / pretrained cfg & weights Hugging Face Hub models (config.json + weights file) from a local folder.
239
+ * Fixes, improvements for onnx export
240
+
241
+ ## Feb 21, 2025
242
+ * SigLIP 2 ViT image encoders added (https://huggingface.co/collections/timm/siglip-2-67b8e72ba08b09dd97aecaf9)
243
+ * Variable resolution / aspect NaFlex versions are a WIP
244
+ * Add 'SO150M2' ViT weights trained with SBB recipes, great results, better for ImageNet than previous attempt w/ less training.
245
+ * `vit_so150m2_patch16_reg1_gap_448.sbb_e200_in12k_ft_in1k` - 88.1% top-1
246
+ * `vit_so150m2_patch16_reg1_gap_384.sbb_e200_in12k_ft_in1k` - 87.9% top-1
247
+ * `vit_so150m2_patch16_reg1_gap_256.sbb_e200_in12k_ft_in1k` - 87.3% top-1
248
+ * `vit_so150m2_patch16_reg4_gap_256.sbb_e200_in12k`
249
+ * Updated InternViT-300M '2.5' weights
250
+ * Release 1.0.15
251
+
252
+ ## Feb 1, 2025
253
+ * FYI PyTorch 2.6 & Python 3.13 are tested and working w/ current main and released version of `timm`
254
+
255
+ ## Jan 27, 2025
256
+ * Add Kron Optimizer (PSGD w/ Kronecker-factored preconditioner)
257
+ * Code from https://github.com/evanatyourservice/kron_torch
258
+ * See also https://sites.google.com/site/lixilinx/home/psgd
259
+
260
+ ## Jan 19, 2025
261
+ * Fix loading of LeViT safetensor weights, remove conversion code which should have been deactivated
262
+ * Add 'SO150M' ViT weights trained with SBB recipes, decent results, but not optimal shape for ImageNet-12k/1k pretrain/ft
263
+ * `vit_so150m_patch16_reg4_gap_256.sbb_e250_in12k_ft_in1k` - 86.7% top-1
264
+ * `vit_so150m_patch16_reg4_gap_384.sbb_e250_in12k_ft_in1k` - 87.4% top-1
265
+ * `vit_so150m_patch16_reg4_gap_256.sbb_e250_in12k`
266
+ * Misc typing, typo, etc. cleanup
267
+ * 1.0.14 release to get above LeViT fix out
268
+
269
+ ## Jan 9, 2025
270
+ * Add support to train and validate in pure `bfloat16` or `float16`
271
+ * `wandb` project name arg added by https://github.com/caojiaolong, use arg.experiment for name
272
+ * Fix old issue w/ checkpoint saving not working on filesystem w/o hard-link support (e.g. FUSE fs mounts)
273
+ * 1.0.13 release
274
+
275
+ ## Jan 6, 2025
276
+ * Add `torch.utils.checkpoint.checkpoint()` wrapper in `timm.models` that defaults `use_reentrant=False`, unless `TIMM_REENTRANT_CKPT=1` is set in env.
277
+
278
+ ## Dec 31, 2024
279
+ * `convnext_nano` 384x384 ImageNet-12k pretrain & fine-tune. https://huggingface.co/models?search=convnext_nano%20r384
280
+ * Add AIM-v2 encoders from https://github.com/apple/ml-aim, see on Hub: https://huggingface.co/models?search=timm%20aimv2
281
+ * Add PaliGemma2 encoders from https://github.com/google-research/big_vision to existing PaliGemma, see on Hub: https://huggingface.co/models?search=timm%20pali2
282
+ * Add missing L/14 DFN2B 39B CLIP ViT, `vit_large_patch14_clip_224.dfn2b_s39b`
283
+ * Fix existing `RmsNorm` layer & fn to match standard formulation, use PT 2.5 impl when possible. Move old impl to `SimpleNorm` layer, it's LN w/o centering or bias. There were only two `timm` models using it, and they have been updated.
284
+ * Allow override of `cache_dir` arg for model creation
285
+ * Pass through `trust_remote_code` for HF datasets wrapper
286
+ * `inception_next_atto` model added by creator
287
+ * Adan optimizer caution, and Lamb decoupled weight decay options
288
+ * Some feature_info metadata fixed by https://github.com/brianhou0208
289
+ * All OpenCLIP and JAX (CLIP, SigLIP, Pali, etc) model weights that used load time remapping were given their own HF Hub instances so that they work with `hf-hub:` based loading, and thus will work with new Transformers `TimmWrapperModel`
290
+
291
+ ## Introduction
292
+
293
+ Py**T**orch **Im**age **M**odels (`timm`) is a collection of image models, layers, utilities, optimizers, schedulers, data-loaders / augmentations, and reference training / validation scripts that aim to pull together a wide variety of SOTA models with ability to reproduce ImageNet training results.
294
+
295
+ The work of many others is present here. I've tried to make sure all source material is acknowledged via links to github, arxiv papers, etc in the README, documentation, and code docstrings. Please let me know if I missed anything.
296
+
297
+ ## Features
298
+
299
+ ### Models
300
+
301
+ All model architecture families include variants with pretrained weights. There are specific model variants without any weights, it is NOT a bug. Help training new or better weights is always appreciated.
302
+
303
+ * Aggregating Nested Transformers - https://arxiv.org/abs/2105.12723
304
+ * BEiT - https://arxiv.org/abs/2106.08254
305
+ * BEiT-V2 - https://arxiv.org/abs/2208.06366
306
+ * BEiT3 - https://arxiv.org/abs/2208.10442
307
+ * Big Transfer ResNetV2 (BiT) - https://arxiv.org/abs/1912.11370
308
+ * Bottleneck Transformers - https://arxiv.org/abs/2101.11605
309
+ * CaiT (Class-Attention in Image Transformers) - https://arxiv.org/abs/2103.17239
310
+ * CoaT (Co-Scale Conv-Attentional Image Transformers) - https://arxiv.org/abs/2104.06399
311
+ * CoAtNet (Convolution and Attention) - https://arxiv.org/abs/2106.04803
312
+ * ConvNeXt - https://arxiv.org/abs/2201.03545
313
+ * ConvNeXt-V2 - http://arxiv.org/abs/2301.00808
314
+ * ConViT (Soft Convolutional Inductive Biases Vision Transformers)- https://arxiv.org/abs/2103.10697
315
+ * CspNet (Cross-Stage Partial Networks) - https://arxiv.org/abs/1911.11929
316
+ * DeiT - https://arxiv.org/abs/2012.12877
317
+ * DeiT-III - https://arxiv.org/pdf/2204.07118.pdf
318
+ * DenseNet - https://arxiv.org/abs/1608.06993
319
+ * DLA - https://arxiv.org/abs/1707.06484
320
+ * DPN (Dual-Path Network) - https://arxiv.org/abs/1707.01629
321
+ * EdgeNeXt - https://arxiv.org/abs/2206.10589
322
+ * EfficientFormer - https://arxiv.org/abs/2206.01191
323
+ * EfficientFormer-V2 - https://arxiv.org/abs/2212.08059
324
+ * EfficientNet (MBConvNet Family)
325
+ * EfficientNet NoisyStudent (B0-B7, L2) - https://arxiv.org/abs/1911.04252
326
+ * EfficientNet AdvProp (B0-B8) - https://arxiv.org/abs/1911.09665
327
+ * EfficientNet (B0-B7) - https://arxiv.org/abs/1905.11946
328
+ * EfficientNet-EdgeTPU (S, M, L) - https://ai.googleblog.com/2019/08/efficientnet-edgetpu-creating.html
329
+ * EfficientNet V2 - https://arxiv.org/abs/2104.00298
330
+ * FBNet-C - https://arxiv.org/abs/1812.03443
331
+ * MixNet - https://arxiv.org/abs/1907.09595
332
+ * MNASNet B1, A1 (Squeeze-Excite), and Small - https://arxiv.org/abs/1807.11626
333
+ * MobileNet-V2 - https://arxiv.org/abs/1801.04381
334
+ * Single-Path NAS - https://arxiv.org/abs/1904.02877
335
+ * TinyNet - https://arxiv.org/abs/2010.14819
336
+ * EfficientViT (MIT) - https://arxiv.org/abs/2205.14756
337
+ * EfficientViT (MSRA) - https://arxiv.org/abs/2305.07027
338
+ * EVA - https://arxiv.org/abs/2211.07636
339
+ * EVA-02 - https://arxiv.org/abs/2303.11331
340
+ * FasterNet - https://arxiv.org/abs/2303.03667
341
+ * FastViT - https://arxiv.org/abs/2303.14189
342
+ * FlexiViT - https://arxiv.org/abs/2212.08013
343
+ * FocalNet (Focal Modulation Networks) - https://arxiv.org/abs/2203.11926
344
+ * GCViT (Global Context Vision Transformer) - https://arxiv.org/abs/2206.09959
345
+ * GhostNet - https://arxiv.org/abs/1911.11907
346
+ * GhostNet-V2 - https://arxiv.org/abs/2211.12905
347
+ * GhostNet-V3 - https://arxiv.org/abs/2404.11202
348
+ * gMLP - https://arxiv.org/abs/2105.08050
349
+ * GPU-Efficient Networks - https://arxiv.org/abs/2006.14090
350
+ * Halo Nets - https://arxiv.org/abs/2103.12731
351
+ * HGNet / HGNet-V2 - TBD
352
+ * HRNet - https://arxiv.org/abs/1908.07919
353
+ * InceptionNeXt - https://arxiv.org/abs/2303.16900
354
+ * Inception-V3 - https://arxiv.org/abs/1512.00567
355
+ * Inception-ResNet-V2 and Inception-V4 - https://arxiv.org/abs/1602.07261
356
+ * Lambda Networks - https://arxiv.org/abs/2102.08602
357
+ * LeViT (Vision Transformer in ConvNet's Clothing) - https://arxiv.org/abs/2104.01136
358
+ * MambaOut - https://arxiv.org/abs/2405.07992
359
+ * MaxViT (Multi-Axis Vision Transformer) - https://arxiv.org/abs/2204.01697
360
+ * MetaFormer (PoolFormer-v2, ConvFormer, CAFormer) - https://arxiv.org/abs/2210.13452
361
+ * MLP-Mixer - https://arxiv.org/abs/2105.01601
362
+ * MobileCLIP - https://arxiv.org/abs/2311.17049
363
+ * MobileNet-V3 (MBConvNet w/ Efficient Head) - https://arxiv.org/abs/1905.02244
364
+ * FBNet-V3 - https://arxiv.org/abs/2006.02049
365
+ * HardCoRe-NAS - https://arxiv.org/abs/2102.11646
366
+ * LCNet - https://arxiv.org/abs/2109.15099
367
+ * MobileNetV4 - https://arxiv.org/abs/2404.10518
368
+ * MobileOne - https://arxiv.org/abs/2206.04040
369
+ * MobileViT - https://arxiv.org/abs/2110.02178
370
+ * MobileViT-V2 - https://arxiv.org/abs/2206.02680
371
+ * MViT-V2 (Improved Multiscale Vision Transformer) - https://arxiv.org/abs/2112.01526
372
+ * NASNet-A - https://arxiv.org/abs/1707.07012
373
+ * NesT - https://arxiv.org/abs/2105.12723
374
+ * Next-ViT - https://arxiv.org/abs/2207.05501
375
+ * NFNet-F - https://arxiv.org/abs/2102.06171
376
+ * NF-RegNet / NF-ResNet - https://arxiv.org/abs/2101.08692
377
+ * PE (Perception Encoder) - https://arxiv.org/abs/2504.13181
378
+ * PNasNet - https://arxiv.org/abs/1712.00559
379
+ * PoolFormer (MetaFormer) - https://arxiv.org/abs/2111.11418
380
+ * Pooling-based Vision Transformer (PiT) - https://arxiv.org/abs/2103.16302
381
+ * PVT-V2 (Improved Pyramid Vision Transformer) - https://arxiv.org/abs/2106.13797
382
+ * RDNet (DenseNets Reloaded) - https://arxiv.org/abs/2403.19588
383
+ * RegNet - https://arxiv.org/abs/2003.13678
384
+ * RegNetZ - https://arxiv.org/abs/2103.06877
385
+ * RepVGG - https://arxiv.org/abs/2101.03697
386
+ * RepGhostNet - https://arxiv.org/abs/2211.06088
387
+ * RepViT - https://arxiv.org/abs/2307.09283
388
+ * ResMLP - https://arxiv.org/abs/2105.03404
389
+ * ResNet/ResNeXt
390
+ * ResNet (v1b/v1.5) - https://arxiv.org/abs/1512.03385
391
+ * ResNeXt - https://arxiv.org/abs/1611.05431
392
+ * 'Bag of Tricks' / Gluon C, D, E, S variations - https://arxiv.org/abs/1812.01187
393
+ * Weakly-supervised (WSL) Instagram pretrained / ImageNet tuned ResNeXt101 - https://arxiv.org/abs/1805.00932
394
+ * Semi-supervised (SSL) / Semi-weakly Supervised (SWSL) ResNet/ResNeXts - https://arxiv.org/abs/1905.00546
395
+ * ECA-Net (ECAResNet) - https://arxiv.org/abs/1910.03151v4
396
+ * Squeeze-and-Excitation Networks (SEResNet) - https://arxiv.org/abs/1709.01507
397
+ * ResNet-RS - https://arxiv.org/abs/2103.07579
398
+ * Res2Net - https://arxiv.org/abs/1904.01169
399
+ * ResNeSt - https://arxiv.org/abs/2004.08955
400
+ * ReXNet - https://arxiv.org/abs/2007.00992
401
+ * ROPE-ViT - https://arxiv.org/abs/2403.13298
402
+ * SelecSLS - https://arxiv.org/abs/1907.00837
403
+ * Selective Kernel Networks - https://arxiv.org/abs/1903.06586
404
+ * Sequencer2D - https://arxiv.org/abs/2205.01972
405
+ * SHViT - https://arxiv.org/abs/2401.16456
406
+ * SigLIP (image encoder) - https://arxiv.org/abs/2303.15343
407
+ * SigLIP 2 (image encoder) - https://arxiv.org/abs/2502.14786
408
+ * StarNet - https://arxiv.org/abs/2403.19967
409
+ * SwiftFormer - https://arxiv.org/pdf/2303.15446
410
+ * Swin S3 (AutoFormerV2) - https://arxiv.org/abs/2111.14725
411
+ * Swin Transformer - https://arxiv.org/abs/2103.14030
412
+ * Swin Transformer V2 - https://arxiv.org/abs/2111.09883
413
+ * TinyViT - https://arxiv.org/abs/2207.10666
414
+ * Transformer-iN-Transformer (TNT) - https://arxiv.org/abs/2103.00112
415
+ * TResNet - https://arxiv.org/abs/2003.13630
416
+ * Twins (Spatial Attention in Vision Transformers) - https://arxiv.org/pdf/2104.13840.pdf
417
+ * VGG - https://arxiv.org/abs/1409.1556
418
+ * Visformer - https://arxiv.org/abs/2104.12533
419
+ * Vision Transformer - https://arxiv.org/abs/2010.11929
420
+ * ViTamin - https://arxiv.org/abs/2404.02132
421
+ * VOLO (Vision Outlooker) - https://arxiv.org/abs/2106.13112
422
+ * VovNet V2 and V1 - https://arxiv.org/abs/1911.06667
423
+ * Xception - https://arxiv.org/abs/1610.02357
424
+ * Xception (Modified Aligned, Gluon) - https://arxiv.org/abs/1802.02611
425
+ * Xception (Modified Aligned, TF) - https://arxiv.org/abs/1802.02611
426
+ * XCiT (Cross-Covariance Image Transformers) - https://arxiv.org/abs/2106.09681
427
+
428
+ ### Optimizers
429
+ To see full list of optimizers w/ descriptions: `timm.optim.list_optimizers(with_description=True)`
430
+
431
+ Included optimizers available via `timm.optim.create_optimizer_v2` factory method:
432
+ * `adabelief` an implementation of AdaBelief adapted from https://github.com/juntang-zhuang/Adabelief-Optimizer - https://arxiv.org/abs/2010.07468
433
+ * `adafactor` adapted from [FAIRSeq impl](https://github.com/pytorch/fairseq/blob/master/fairseq/optim/adafactor.py) - https://arxiv.org/abs/1804.04235
434
+ * `adafactorbv` adapted from [Big Vision](https://github.com/google-research/big_vision/blob/main/big_vision/optax.py) - https://arxiv.org/abs/2106.04560
435
+ * `adahessian` by [David Samuel](https://github.com/davda54/ada-hessian) - https://arxiv.org/abs/2006.00719
436
+ * `adamp` and `sgdp` by [Naver ClovAI](https://github.com/clovaai) - https://arxiv.org/abs/2006.08217
437
+ * `adamuon` and `nadamuon` as per https://github.com/Chongjie-Si/AdaMuon - https://arxiv.org/abs/2507.11005
438
+ * `adan` an implementation of Adan adapted from https://github.com/sail-sg/Adan - https://arxiv.org/abs/2208.06677
439
+ * `adopt` ADOPT adapted from https://github.com/iShohei220/adopt - https://arxiv.org/abs/2411.02853
440
+ * `kron` PSGD w/ Kronecker-factored preconditioner from https://github.com/evanatyourservice/kron_torch - https://sites.google.com/site/lixilinx/home/psgd
441
+ * `lamb` an implementation of Lamb and LambC (w/ trust-clipping) cleaned up and modified to support use with XLA - https://arxiv.org/abs/1904.00962
442
+ * `laprop` optimizer from https://github.com/Z-T-WANG/LaProp-Optimizer - https://arxiv.org/abs/2002.04839
443
+ * `lars` an implementation of LARS and LARC (w/ trust-clipping) - https://arxiv.org/abs/1708.03888
444
+ * `lion` and implementation of Lion adapted from https://github.com/google/automl/tree/master/lion - https://arxiv.org/abs/2302.06675
445
+ * `lookahead` adapted from impl by [Liam](https://github.com/alphadl/lookahead.pytorch) - https://arxiv.org/abs/1907.08610
446
+ * `madgrad` an implementation of MADGRAD adapted from https://github.com/facebookresearch/madgrad - https://arxiv.org/abs/2101.11075
447
+ * `mars` MARS optimizer from https://github.com/AGI-Arena/MARS - https://arxiv.org/abs/2411.10438
448
+ * `muon` MUON optimizer from https://github.com/KellerJordan/Muon with numerous additions and improved non-transformer behaviour
449
+ * `nadam` an implementation of Adam w/ Nesterov momentum
450
+ * `nadamw` an implementation of AdamW (Adam w/ decoupled weight-decay) w/ Nesterov momentum. A simplified impl based on https://github.com/mlcommons/algorithmic-efficiency
451
+ * `novograd` by [Masashi Kimura](https://github.com/convergence-lab/novograd) - https://arxiv.org/abs/1905.11286
452
+ * `radam` by [Liyuan Liu](https://github.com/LiyuanLucasLiu/RAdam) - https://arxiv.org/abs/1908.03265
453
+ * `rmsprop_tf` adapted from PyTorch RMSProp by myself. Reproduces much improved Tensorflow RMSProp behaviour
454
+ * `sgdw` and implementation of SGD w/ decoupled weight-decay
455
+ * `fused<name>` optimizers by name with [NVIDIA Apex](https://github.com/NVIDIA/apex/tree/master/apex/optimizers) installed
456
+ * `bnb<name>` optimizers by name with [BitsAndBytes](https://github.com/TimDettmers/bitsandbytes) installed
457
+ * `cadamw`, `clion`, and more 'Cautious' optimizers from https://github.com/kyleliang919/C-Optim - https://arxiv.org/abs/2411.16085
458
+ * `adam`, `adamw`, `rmsprop`, `adadelta`, `adagrad`, and `sgd` pass through to `torch.optim` implementations
459
+ * `c` suffix (eg `adamc`, `nadamc` to implement 'corrected weight decay' in https://arxiv.org/abs/2506.02285)
460
+
461
+ ### Augmentations
462
+ * Random Erasing from [Zhun Zhong](https://github.com/zhunzhong07/Random-Erasing/blob/master/transforms.py) - https://arxiv.org/abs/1708.04896)
463
+ * Mixup - https://arxiv.org/abs/1710.09412
464
+ * CutMix - https://arxiv.org/abs/1905.04899
465
+ * AutoAugment (https://arxiv.org/abs/1805.09501) and RandAugment (https://arxiv.org/abs/1909.13719) ImageNet configurations modeled after impl for EfficientNet training (https://github.com/tensorflow/tpu/blob/master/models/official/efficientnet/autoaugment.py)
466
+ * AugMix w/ JSD loss, JSD w/ clean + augmented mixing support works with AutoAugment and RandAugment as well - https://arxiv.org/abs/1912.02781
467
+ * SplitBachNorm - allows splitting batch norm layers between clean and augmented (auxiliary batch norm) data
468
+
469
+ ### Regularization
470
+ * DropPath aka "Stochastic Depth" - https://arxiv.org/abs/1603.09382
471
+ * DropBlock - https://arxiv.org/abs/1810.12890
472
+ * Blur Pooling - https://arxiv.org/abs/1904.11486
473
+
474
+ ### Other
475
+
476
+ Several (less common) features that I often utilize in my projects are included. Many of their additions are the reason why I maintain my own set of models, instead of using others' via PIP:
477
+
478
+ * All models have a common default configuration interface and API for
479
+ * accessing/changing the classifier - `get_classifier` and `reset_classifier`
480
+ * doing a forward pass on just the features - `forward_features` (see [documentation](https://huggingface.co/docs/timm/feature_extraction))
481
+ * these makes it easy to write consistent network wrappers that work with any of the models
482
+ * All models support multi-scale feature map extraction (feature pyramids) via create_model (see [documentation](https://huggingface.co/docs/timm/feature_extraction))
483
+ * `create_model(name, features_only=True, out_indices=..., output_stride=...)`
484
+ * `out_indices` creation arg specifies which feature maps to return, these indices are 0 based and generally correspond to the `C(i + 1)` feature level.
485
+ * `output_stride` creation arg controls output stride of the network by using dilated convolutions. Most networks are stride 32 by default. Not all networks support this.
486
+ * feature map channel counts, reduction level (stride) can be queried AFTER model creation via the `.feature_info` member
487
+ * All models have a consistent pretrained weight loader that adapts last linear if necessary, and from 3 to 1 channel input if desired
488
+ * High performance [reference training, validation, and inference scripts](https://huggingface.co/docs/timm/training_script) that work in several process/GPU modes:
489
+ * NVIDIA DDP w/ a single GPU per process, multiple processes with APEX present (AMP mixed-precision optional)
490
+ * PyTorch DistributedDataParallel w/ multi-gpu, single process (AMP disabled as it crashes when enabled)
491
+ * PyTorch w/ single GPU single process (AMP optional)
492
+ * A dynamic global pool implementation that allows selecting from average pooling, max pooling, average + max, or concat([average, max]) at model creation. All global pooling is adaptive average by default and compatible with pretrained weights.
493
+ * A 'Test Time Pool' wrapper that can wrap any of the included models and usually provides improved performance doing inference with input images larger than the training size. Idea adapted from original DPN implementation when I ported (https://github.com/cypw/DPNs)
494
+ * Learning rate schedulers
495
+ * Ideas adopted from
496
+ * [AllenNLP schedulers](https://github.com/allenai/allennlp/tree/master/allennlp/training/learning_rate_schedulers)
497
+ * [FAIRseq lr_scheduler](https://github.com/pytorch/fairseq/tree/master/fairseq/optim/lr_scheduler)
498
+ * SGDR: Stochastic Gradient Descent with Warm Restarts (https://arxiv.org/abs/1608.03983)
499
+ * Schedulers include `step`, `cosine` w/ restarts, `tanh` w/ restarts, `plateau`
500
+ * Space-to-Depth by [mrT23](https://github.com/mrT23/TResNet/blob/master/src/models/tresnet/layers/space_to_depth.py) (https://arxiv.org/abs/1801.04590)
501
+ * Adaptive Gradient Clipping (https://arxiv.org/abs/2102.06171, https://github.com/deepmind/deepmind-research/tree/master/nfnets)
502
+ * An extensive selection of channel and/or spatial attention modules:
503
+ * Bottleneck Transformer - https://arxiv.org/abs/2101.11605
504
+ * CBAM - https://arxiv.org/abs/1807.06521
505
+ * Effective Squeeze-Excitation (ESE) - https://arxiv.org/abs/1911.06667
506
+ * Efficient Channel Attention (ECA) - https://arxiv.org/abs/1910.03151
507
+ * Gather-Excite (GE) - https://arxiv.org/abs/1810.12348
508
+ * Global Context (GC) - https://arxiv.org/abs/1904.11492
509
+ * Halo - https://arxiv.org/abs/2103.12731
510
+ * Involution - https://arxiv.org/abs/2103.06255
511
+ * Lambda Layer - https://arxiv.org/abs/2102.08602
512
+ * Non-Local (NL) - https://arxiv.org/abs/1711.07971
513
+ * Squeeze-and-Excitation (SE) - https://arxiv.org/abs/1709.01507
514
+ * Selective Kernel (SK) - (https://arxiv.org/abs/1903.06586
515
+ * Split (SPLAT) - https://arxiv.org/abs/2004.08955
516
+ * Shifted Window (SWIN) - https://arxiv.org/abs/2103.14030
517
+
518
+ ## Results
519
+
520
+ Model validation results can be found in the [results tables](results/README.md)
521
+
522
+ ## Getting Started (Documentation)
523
+
524
+ The official documentation can be found at https://huggingface.co/docs/hub/timm. Documentation contributions are welcome.
525
+
526
+ [Getting Started with PyTorch Image Models (timm): A Practitioner’s Guide](https://towardsdatascience.com/getting-started-with-pytorch-image-models-timm-a-practitioners-guide-4e77b4bf9055-2/) by [Chris Hughes](https://github.com/Chris-hughes10) is an extensive blog post covering many aspects of `timm` in detail.
527
+
528
+ [timmdocs](http://timm.fast.ai/) is an alternate set of documentation for `timm`. A big thanks to [Aman Arora](https://github.com/amaarora) for his efforts creating timmdocs.
529
+
530
+ [paperswithcode](https://paperswithcode.com/lib/timm) is a good resource for browsing the models within `timm`.
531
+
532
+ ## Train, Validation, Inference Scripts
533
+
534
+ The root folder of the repository contains reference train, validation, and inference scripts that work with the included models and other features of this repository. They are adaptable for other datasets and use cases with a little hacking. See [documentation](https://huggingface.co/docs/timm/training_script).
535
+
536
+ ## Awesome PyTorch Resources
537
+
538
+ One of the greatest assets of PyTorch is the community and their contributions. A few of my favourite resources that pair well with the models and components here are listed below.
539
+
540
+ ### Object Detection, Instance and Semantic Segmentation
541
+ * Detectron2 - https://github.com/facebookresearch/detectron2
542
+ * Segmentation Models (Semantic) - https://github.com/qubvel/segmentation_models.pytorch
543
+ * EfficientDet (Obj Det, Semantic soon) - https://github.com/rwightman/efficientdet-pytorch
544
+
545
+ ### Computer Vision / Image Augmentation
546
+ * Albumentations - https://github.com/albumentations-team/albumentations
547
+ * Kornia - https://github.com/kornia/kornia
548
+
549
+ ### Knowledge Distillation
550
+ * RepDistiller - https://github.com/HobbitLong/RepDistiller
551
+ * torchdistill - https://github.com/yoshitomo-matsubara/torchdistill
552
+
553
+ ### Metric Learning
554
+ * PyTorch Metric Learning - https://github.com/KevinMusgrave/pytorch-metric-learning
555
+
556
+ ### Training / Frameworks
557
+ * fastai - https://github.com/fastai/fastai
558
+ * lightly_train - https://github.com/lightly-ai/lightly-train
559
+
560
+ ### Deployment
561
+ * timmx (Export timm models to ONNX, CoreML, LiteRT, TensorRT, and more) - https://github.com/Boulaouaney/timmx
562
+
563
+ ## Licenses
564
+
565
+ ### Code
566
+ The code here is licensed Apache 2.0. I've taken care to make sure any third party code included or adapted has compatible (permissive) licenses such as MIT, BSD, etc. I've made an effort to avoid any GPL / LGPL conflicts. That said, it is your responsibility to ensure you comply with licenses here and conditions of any dependent licenses. Where applicable, I've linked the sources/references for various components in docstrings. If you think I've missed anything please create an issue.
567
+
568
+ ### Pretrained Weights
569
+ So far all of the pretrained weights available here are pretrained on ImageNet with a select few that have some additional pretraining (see extra note below). ImageNet was released for non-commercial research purposes only (https://image-net.org/download). It's not clear what the implications of that are for the use of pretrained weights from that dataset. Any models I have trained with ImageNet are done for research purposes and one should assume that the original dataset license applies to the weights. It's best to seek legal advice if you intend to use the pretrained weights in a commercial product.
570
+
571
+ #### Pretrained on more than ImageNet
572
+ Several weights included or references here were pretrained with proprietary datasets that I do not have access to. These include the Facebook WSL, SSL, SWSL ResNe(Xt) and the Google Noisy Student EfficientNet models. The Facebook models have an explicit non-commercial license (CC-BY-NC 4.0, https://github.com/facebookresearch/semi-supervised-ImageNet1K-models, https://github.com/facebookresearch/WSL-Images). The Google models do not appear to have any restriction beyond the Apache 2.0 license (and ImageNet concerns). In either case, you should contact Facebook or Google with any questions.
573
+
574
+ ## Citing
575
+
576
+ ### BibTeX
577
+
578
+ ```bibtex
579
+ @misc{rw2019timm,
580
+ author = {Ross Wightman},
581
+ title = {PyTorch Image Models},
582
+ year = {2019},
583
+ publisher = {GitHub},
584
+ journal = {GitHub repository},
585
+ doi = {10.5281/zenodo.4414861},
586
+ howpublished = {\url{https://github.com/rwightman/pytorch-image-models}}
587
+ }
588
+ ```
589
+
590
+ ### Latest DOI
591
+
592
+ [![DOI](https://zenodo.org/badge/168799526.svg)](https://zenodo.org/badge/latestdoi/168799526)
.cache/pip/http-v2/7/f/f/b/a/7ffbaade46b578649cfc115650c307df3346f8f8e3d20f832aa9ec7b ADDED
Binary file (1.23 kB). View file
 
.cache/pip/http-v2/7/f/f/b/a/7ffbaade46b578649cfc115650c307df3346f8f8e3d20f832aa9ec7b.body ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f88193799d43dbf8c8a806d6405c9c52fe2af40bf75072a606357b33cc336c7f
3
+ size 621541
.cache/pip/http-v2/b/1/f/5/d/b1f5dc01896eee598e8915be35e61304ad2b16363d00711f8576642c ADDED
Binary file (1.9 kB). View file
 
.cache/pip/http-v2/b/1/f/5/d/b1f5dc01896eee598e8915be35e61304ad2b16363d00711f8576642c.body ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ec8606e8564f19e74ee05178d79403f084fa95690edb143c40fbbedc6c5360c
3
+ size 119472
.cache/pip/http-v2/b/9/9/a/d/b99ad330dfd2e9e0337861ace33d07fca2ddfd480ba4473963ebc23d ADDED
Binary file (1.23 kB). View file
 
.cache/pip/http-v2/b/e/5/9/9/be599e435b04e9191df28c1690b91394df11dcc43b78b8097f2cac95 ADDED
Binary file (1.9 kB). View file
 
.cache/pip/http-v2/b/e/5/9/9/be599e435b04e9191df28c1690b91394df11dcc43b78b8097f2cac95.body ADDED
Binary file (4.53 kB). View file
 
.cache/pip/http-v2/d/3/2/9/d/d329d269473dcb26bc2fcf82e354619e8463ba8855d5a3b77637c124.body ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:294158e2f650b2fbdd2647a2ee713502b6f4b27a4092c35ad6e0749ddc34f0f4
3
+ size 237138
.cache/pip/http-v2/d/a/8/1/4/da8145136a84a44f3223fc3ee57fc18e4604ae09f030d21a21c2ecb5.body ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e577b88da96b3a722ea5e2f042455ce6f715d398304d8e63b17d126ed7d89968
3
+ size 2597944
.cache/pip/http-v2/d/d/2/0/6/dd206ee8d449d4bec512242e8f8ebadb5a808c682766018f3921f62b ADDED
Binary file (1.27 kB). View file
 
.cache/pip/http-v2/d/d/2/0/6/dd206ee8d449d4bec512242e8f8ebadb5a808c682766018f3921f62b.body ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.1
2
+ Name: et_xmlfile
3
+ Version: 2.0.0
4
+ Summary: An implementation of lxml.xmlfile for the standard library
5
+ Home-page: https://foss.heptapod.net/openpyxl/et_xmlfile
6
+ Author: See AUTHORS.txt
7
+ Author-email: charlie.clark@clark-consulting.eu
8
+ License: MIT
9
+ Project-URL: Documentation, https://openpyxl.pages.heptapod.net/et_xmlfile/
10
+ Project-URL: Source, https://foss.heptapod.net/openpyxl/et_xmlfile
11
+ Project-URL: Tracker, https://foss.heptapod.net/openpyxl/et_xmfile/-/issues
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Operating System :: MacOS :: MacOS X
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Operating System :: POSIX
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Requires-Python: >=3.8
25
+ License-File: LICENCE.python
26
+ License-File: LICENCE.rst
27
+ License-File: AUTHORS.txt
28
+
29
+ .. image:: https://foss.heptapod.net/openpyxl/et_xmlfile/badges/branch/default/coverage.svg
30
+ :target: https://coveralls.io/bitbucket/openpyxl/et_xmlfile?branch=default
31
+ :alt: coverage status
32
+
33
+ et_xmfile
34
+ =========
35
+
36
+ XML can use lots of memory, and et_xmlfile is a low memory library for creating large XML files
37
+ And, although the standard library already includes an incremental parser, `iterparse` it has no equivalent when writing XML. Once an element has been added to the tree, it is written to
38
+ the file or stream and the memory is then cleared.
39
+
40
+ This module is based upon the `xmlfile module from lxml <http://lxml.de/api.html#incremental-xml-generation>`_ with the aim of allowing code to be developed that will work with both libraries.
41
+ It was developed initially for the openpyxl project, but is now a standalone module.
42
+
43
+ The code was written by Elias Rabel as part of the `Python Düsseldorf <http://pyddf.de>`_ openpyxl sprint in September 2014.
44
+
45
+ Proper support for incremental writing was provided by Daniel Hillier in 2024
46
+
47
+ Note on performance
48
+ -------------------
49
+
50
+ The code was not developed with performance in mind, but turned out to be faster than the existing SAX-based implementation but is generally slower than lxml's xmlfile.
51
+ There is one area where an optimisation for lxml may negatively affect the performance of et_xmfile and that is when using the `.element()` method on the xmlfile context manager. It is, therefore, recommended simply to create Elements write these directly, as in the sample code.
.cache/pip/http-v2/e/a/2/2/a/ea22a79fcbb7a5195dc8846d5b7ddabfe6981d47f448fe52cbe95a8a ADDED
Binary file (1.89 kB). View file
 
.cache/pip/http-v2/e/a/2/2/a/ea22a79fcbb7a5195dc8846d5b7ddabfe6981d47f448fe52cbe95a8a.body ADDED
Binary file (65.7 kB). View file
 
.cache/pip/http-v2/e/c/8/b/3/ec8b32f74b33a66cdb59c6ce388ac68e5697696325dcbe84554f832d ADDED
Binary file (1.27 kB). View file
 
.cache/pip/http-v2/e/c/8/b/3/ec8b32f74b33a66cdb59c6ce388ac68e5697696325dcbe84554f832d.body ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: alembic
3
+ Version: 1.18.5
4
+ Summary: A database migration tool for SQLAlchemy.
5
+ Author-email: Mike Bayer <mike_mp@zzzcomputing.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://alembic.sqlalchemy.org
8
+ Project-URL: Documentation, https://alembic.sqlalchemy.org/en/latest/
9
+ Project-URL: Changelog, https://alembic.sqlalchemy.org/en/latest/changelog.html
10
+ Project-URL: Source, https://github.com/sqlalchemy/alembic/
11
+ Project-URL: Issue Tracker, https://github.com/sqlalchemy/alembic/issues/
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Environment :: Console
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: Implementation :: CPython
23
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
24
+ Classifier: Topic :: Database :: Front-Ends
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/x-rst
27
+ License-File: LICENSE
28
+ Requires-Dist: SQLAlchemy>=1.4.23
29
+ Requires-Dist: Mako
30
+ Requires-Dist: typing-extensions>=4.12
31
+ Requires-Dist: tomli; python_version < "3.11"
32
+ Provides-Extra: tz
33
+ Requires-Dist: tzdata; extra == "tz"
34
+ Dynamic: license-file
35
+
36
+ Alembic is a database migrations tool written by the author
37
+ of `SQLAlchemy <http://www.sqlalchemy.org>`_. A migrations tool
38
+ offers the following functionality:
39
+
40
+ * Can emit ALTER statements to a database in order to change
41
+ the structure of tables and other constructs
42
+ * Provides a system whereby "migration scripts" may be constructed;
43
+ each script indicates a particular series of steps that can "upgrade" a
44
+ target database to a new version, and optionally a series of steps that can
45
+ "downgrade" similarly, doing the same steps in reverse.
46
+ * Allows the scripts to execute in some sequential manner.
47
+
48
+ The goals of Alembic are:
49
+
50
+ * Very open ended and transparent configuration and operation. A new
51
+ Alembic environment is generated from a set of templates which is selected
52
+ among a set of options when setup first occurs. The templates then deposit a
53
+ series of scripts that define fully how database connectivity is established
54
+ and how migration scripts are invoked; the migration scripts themselves are
55
+ generated from a template within that series of scripts. The scripts can
56
+ then be further customized to define exactly how databases will be
57
+ interacted with and what structure new migration files should take.
58
+ * Full support for transactional DDL. The default scripts ensure that all
59
+ migrations occur within a transaction - for those databases which support
60
+ this (Postgresql, Microsoft SQL Server), migrations can be tested with no
61
+ need to manually undo changes upon failure.
62
+ * Minimalist script construction. Basic operations like renaming
63
+ tables/columns, adding/removing columns, changing column attributes can be
64
+ performed through one line commands like alter_column(), rename_table(),
65
+ add_constraint(). There is no need to recreate full SQLAlchemy Table
66
+ structures for simple operations like these - the functions themselves
67
+ generate minimalist schema structures behind the scenes to achieve the given
68
+ DDL sequence.
69
+ * "auto generation" of migrations. While real world migrations are far more
70
+ complex than what can be automatically determined, Alembic can still
71
+ eliminate the initial grunt work in generating new migration directives
72
+ from an altered schema. The ``--autogenerate`` feature will inspect the
73
+ current status of a database using SQLAlchemy's schema inspection
74
+ capabilities, compare it to the current state of the database model as
75
+ specified in Python, and generate a series of "candidate" migrations,
76
+ rendering them into a new migration script as Python directives. The
77
+ developer then edits the new file, adding additional directives and data
78
+ migrations as needed, to produce a finished migration. Table and column
79
+ level changes can be detected, with constraints and indexes to follow as
80
+ well.
81
+ * Full support for migrations generated as SQL scripts. Those of us who
82
+ work in corporate environments know that direct access to DDL commands on a
83
+ production database is a rare privilege, and DBAs want textual SQL scripts.
84
+ Alembic's usage model and commands are oriented towards being able to run a
85
+ series of migrations into a textual output file as easily as it runs them
86
+ directly to a database. Care must be taken in this mode to not invoke other
87
+ operations that rely upon in-memory SELECTs of rows - Alembic tries to
88
+ provide helper constructs like bulk_insert() to help with data-oriented
89
+ operations that are compatible with script-based DDL.
90
+ * Non-linear, dependency-graph versioning. Scripts are given UUID
91
+ identifiers similarly to a DVCS, and the linkage of one script to the next
92
+ is achieved via human-editable markers within the scripts themselves.
93
+ The structure of a set of migration files is considered as a
94
+ directed-acyclic graph, meaning any migration file can be dependent
95
+ on any other arbitrary set of migration files, or none at
96
+ all. Through this open-ended system, migration files can be organized
97
+ into branches, multiple roots, and mergepoints, without restriction.
98
+ Commands are provided to produce new branches, roots, and merges of
99
+ branches automatically.
100
+ * Provide a library of ALTER constructs that can be used by any SQLAlchemy
101
+ application. The DDL constructs build upon SQLAlchemy's own DDLElement base
102
+ and can be used standalone by any application or script.
103
+ * At long last, bring SQLite and its inability to ALTER things into the fold,
104
+ but in such a way that SQLite's very special workflow needs are accommodated
105
+ in an explicit way that makes the most of a bad situation, through the
106
+ concept of a "batch" migration, where multiple changes to a table can
107
+ be batched together to form a series of instructions for a single, subsequent
108
+ "move-and-copy" workflow. You can even use "move-and-copy" workflow for
109
+ other databases, if you want to recreate a table in the background
110
+ on a busy system.
111
+
112
+ Documentation and status of Alembic is at https://alembic.sqlalchemy.org/
113
+
114
+ The SQLAlchemy Project
115
+ ======================
116
+
117
+ Alembic is part of the `SQLAlchemy Project <https://www.sqlalchemy.org>`_ and
118
+ adheres to the same standards and conventions as the core project.
119
+
120
+ Development / Bug reporting / Pull requests
121
+ ___________________________________________
122
+
123
+ Please refer to the
124
+ `SQLAlchemy Community Guide <https://www.sqlalchemy.org/develop.html>`_ for
125
+ guidelines on coding and participating in this project.
126
+
127
+ Code of Conduct
128
+ _______________
129
+
130
+ Above all, SQLAlchemy places great emphasis on polite, thoughtful, and
131
+ constructive communication between users and developers.
132
+ Please see our current Code of Conduct at
133
+ `Code of Conduct <https://www.sqlalchemy.org/codeofconduct.html>`_.
134
+
135
+ License
136
+ =======
137
+
138
+ Alembic is distributed under the `MIT license
139
+ <https://opensource.org/licenses/MIT>`_.
.cache/pip/http-v2/e/d/e/d/1/eded1062df3a835b1d654db11016327d0de7276866caf329f6f27b1c ADDED
Binary file (1.25 kB). View file
 
.cache/pip/http-v2/e/d/e/d/1/eded1062df3a835b1d654db11016327d0de7276866caf329f6f27b1c.body ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.1
2
+ Name: contourpy
3
+ Version: 1.3.3
4
+ Summary: Python library for calculating contours of 2D quadrilateral grids
5
+ Author-Email: Ian Thomas <ianthomas23@gmail.com>
6
+ License: BSD 3-Clause License
7
+
8
+ Copyright (c) 2021-2025, ContourPy Developers.
9
+ All rights reserved.
10
+
11
+ Redistribution and use in source and binary forms, with or without
12
+ modification, are permitted provided that the following conditions are met:
13
+
14
+ 1. Redistributions of source code must retain the above copyright notice, this
15
+ list of conditions and the following disclaimer.
16
+
17
+ 2. Redistributions in binary form must reproduce the above copyright notice,
18
+ this list of conditions and the following disclaimer in the documentation
19
+ and/or other materials provided with the distribution.
20
+
21
+ 3. Neither the name of the copyright holder nor the names of its
22
+ contributors may be used to endorse or promote products derived from
23
+ this software without specific prior written permission.
24
+
25
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
29
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
+
36
+ Classifier: Development Status :: 5 - Production/Stable
37
+ Classifier: Intended Audience :: Developers
38
+ Classifier: Intended Audience :: Science/Research
39
+ Classifier: License :: OSI Approved :: BSD License
40
+ Classifier: Programming Language :: C++
41
+ Classifier: Programming Language :: Python :: 3
42
+ Classifier: Programming Language :: Python :: 3.11
43
+ Classifier: Programming Language :: Python :: 3.12
44
+ Classifier: Programming Language :: Python :: 3.13
45
+ Classifier: Programming Language :: Python :: 3.14
46
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
47
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
48
+ Classifier: Topic :: Scientific/Engineering :: Visualization
49
+ Project-URL: Homepage, https://github.com/contourpy/contourpy
50
+ Project-URL: Changelog, https://contourpy.readthedocs.io/en/latest/changelog.html
51
+ Project-URL: Documentation, https://contourpy.readthedocs.io
52
+ Project-URL: Repository, https://github.com/contourpy/contourpy
53
+ Requires-Python: >=3.11
54
+ Requires-Dist: numpy>=1.25
55
+ Provides-Extra: docs
56
+ Requires-Dist: furo; extra == "docs"
57
+ Requires-Dist: sphinx>=7.2; extra == "docs"
58
+ Requires-Dist: sphinx-copybutton; extra == "docs"
59
+ Provides-Extra: bokeh
60
+ Requires-Dist: bokeh; extra == "bokeh"
61
+ Requires-Dist: selenium; extra == "bokeh"
62
+ Provides-Extra: mypy
63
+ Requires-Dist: contourpy[bokeh,docs]; extra == "mypy"
64
+ Requires-Dist: bokeh; extra == "mypy"
65
+ Requires-Dist: docutils-stubs; extra == "mypy"
66
+ Requires-Dist: mypy==1.17.0; extra == "mypy"
67
+ Requires-Dist: types-Pillow; extra == "mypy"
68
+ Provides-Extra: test
69
+ Requires-Dist: contourpy[test-no-images]; extra == "test"
70
+ Requires-Dist: matplotlib; extra == "test"
71
+ Requires-Dist: Pillow; extra == "test"
72
+ Provides-Extra: test-no-images
73
+ Requires-Dist: pytest; extra == "test-no-images"
74
+ Requires-Dist: pytest-cov; extra == "test-no-images"
75
+ Requires-Dist: pytest-rerunfailures; extra == "test-no-images"
76
+ Requires-Dist: pytest-xdist; extra == "test-no-images"
77
+ Requires-Dist: wurlitzer; extra == "test-no-images"
78
+ Description-Content-Type: text/markdown
79
+
80
+ <img alt="ContourPy" src="https://raw.githubusercontent.com/contourpy/contourpy/main/docs/_static/contourpy_logo_horiz.svg" height="90">
81
+
82
+ ContourPy is a Python library for calculating contours of 2D quadrilateral grids. It is written in C++11 and wrapped using pybind11.
83
+
84
+ It contains the 2005 and 2014 algorithms used in Matplotlib as well as a newer algorithm that includes more features and is available in both serial and multithreaded versions. It provides an easy way for Python libraries to use contouring algorithms without having to include Matplotlib as a dependency.
85
+
86
+ * **Documentation**: https://contourpy.readthedocs.io
87
+ * **Source code**: https://github.com/contourpy/contourpy
88
+
89
+ | | |
90
+ | --- | --- |
91
+ | Latest release | [![PyPI version](https://img.shields.io/pypi/v/contourpy.svg?label=pypi&color=fdae61)](https://pypi.python.org/pypi/contourpy) [![conda-forge version](https://img.shields.io/conda/v/conda-forge/contourpy.svg?label=conda-forge&color=a6d96a)](https://anaconda.org/conda-forge/contourpy) |
92
+ | Downloads | [![PyPi downloads](https://img.shields.io/pypi/dm/contourpy?label=pypi&style=flat&color=fdae61)](https://pepy.tech/project/contourpy) |
93
+ | Python version | [![Platforms](https://img.shields.io/pypi/pyversions/contourpy?color=fdae61)](https://pypi.org/project/contourpy/) |
94
+ | Coverage | [![Codecov](https://img.shields.io/codecov/c/gh/contourpy/contourpy?color=fdae61&label=codecov)](https://app.codecov.io/gh/contourpy/contourpy) |
.cache/pip/http-v2/f/1/9/c/b/f19cb9f2548ebec3162f98dc0753cc5fe07d32364a02b1720f376edb ADDED
Binary file (1.9 kB). View file
 
.cache/pip/http-v2/f/1/9/c/b/f19cb9f2548ebec3162f98dc0753cc5fe07d32364a02b1720f376edb.body ADDED
Binary file (26.5 kB). View file
 
.cache/pip/http-v2/f/6/4/9/7/f64975d28276977ea56e4922737def644a797957c860c54f5b5bc122.body ADDED
The diff for this file is too large to render. See raw diff
 
.cache/uv/.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ *
.cache/uv/.lock ADDED
File without changes
.cache/uv/CACHEDIR.TAG ADDED
@@ -0,0 +1 @@
 
 
1
+ Signature: 8a477f597d28d172789f06886806bc55
.cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub-1.26.0.dist-info/METADATA ADDED
@@ -0,0 +1,373 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: huggingface_hub
3
+ Version: 1.26.0
4
+ Summary: Client library to download and publish models, datasets and other repos on the huggingface.co hub
5
+ Home-page: https://github.com/huggingface/huggingface_hub
6
+ Author: Hugging Face, Inc.
7
+ Author-email: julien@huggingface.co
8
+ License: Apache-2.0
9
+ Keywords: model-hub machine-learning models natural-language-processing deep-learning pytorch pretrained-models
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Education
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Requires-Python: >=3.10.0
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: click<9.0.0,>=8.4.2
27
+ Requires-Dist: filelock>=3.10.0
28
+ Requires-Dist: fsspec>=2023.5.0
29
+ Requires-Dist: hf-xet<2.0.0,>=1.5.1; platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "arm64" or platform_machine == "aarch64"
30
+ Requires-Dist: httpx<1,>=0.23.0
31
+ Requires-Dist: packaging>=20.9
32
+ Requires-Dist: pyyaml>=5.1
33
+ Requires-Dist: tqdm>=4.42.1
34
+ Requires-Dist: typing-extensions>=4.1.0
35
+ Provides-Extra: oauth
36
+ Requires-Dist: authlib>=1.3.2; extra == "oauth"
37
+ Requires-Dist: fastapi; extra == "oauth"
38
+ Requires-Dist: httpx; extra == "oauth"
39
+ Requires-Dist: itsdangerous; extra == "oauth"
40
+ Provides-Extra: torch
41
+ Requires-Dist: torch; extra == "torch"
42
+ Requires-Dist: safetensors[torch]; extra == "torch"
43
+ Provides-Extra: fastai
44
+ Requires-Dist: toml; extra == "fastai"
45
+ Requires-Dist: fastai>=2.4; extra == "fastai"
46
+ Requires-Dist: fastcore>=1.3.27; extra == "fastai"
47
+ Provides-Extra: hf-xet
48
+ Requires-Dist: hf-xet<2.0.0,>=1.5.1; extra == "hf-xet"
49
+ Provides-Extra: mcp
50
+ Requires-Dist: mcp>=1.8.0; extra == "mcp"
51
+ Provides-Extra: testing
52
+ Requires-Dist: authlib>=1.3.2; extra == "testing"
53
+ Requires-Dist: fastapi; extra == "testing"
54
+ Requires-Dist: httpx; extra == "testing"
55
+ Requires-Dist: itsdangerous; extra == "testing"
56
+ Requires-Dist: jedi; extra == "testing"
57
+ Requires-Dist: Jinja2; extra == "testing"
58
+ Requires-Dist: pytest>=8.4.2; extra == "testing"
59
+ Requires-Dist: pytest-cov; extra == "testing"
60
+ Requires-Dist: pytest-env; extra == "testing"
61
+ Requires-Dist: pytest-xdist; extra == "testing"
62
+ Requires-Dist: pytest-vcr; extra == "testing"
63
+ Requires-Dist: pytest-asyncio; extra == "testing"
64
+ Requires-Dist: pytest-rerunfailures>=16.2; extra == "testing"
65
+ Requires-Dist: pytest-mock; extra == "testing"
66
+ Requires-Dist: urllib3<2.0; extra == "testing"
67
+ Requires-Dist: soundfile; extra == "testing"
68
+ Requires-Dist: Pillow; extra == "testing"
69
+ Requires-Dist: numpy; extra == "testing"
70
+ Requires-Dist: duckdb; extra == "testing"
71
+ Requires-Dist: fastapi; extra == "testing"
72
+ Provides-Extra: gradio
73
+ Requires-Dist: gradio>=5.0.0; extra == "gradio"
74
+ Requires-Dist: requests; extra == "gradio"
75
+ Provides-Extra: typing
76
+ Requires-Dist: typing-extensions>=4.8.0; extra == "typing"
77
+ Requires-Dist: types-PyYAML; extra == "typing"
78
+ Requires-Dist: types-simplejson; extra == "typing"
79
+ Requires-Dist: types-toml; extra == "typing"
80
+ Requires-Dist: types-tqdm; extra == "typing"
81
+ Requires-Dist: types-urllib3; extra == "typing"
82
+ Provides-Extra: quality
83
+ Requires-Dist: ruff>=0.9.0; extra == "quality"
84
+ Requires-Dist: mypy==1.15.0; extra == "quality"
85
+ Requires-Dist: libcst>=1.4.0; extra == "quality"
86
+ Requires-Dist: ty; extra == "quality"
87
+ Provides-Extra: all
88
+ Requires-Dist: authlib>=1.3.2; extra == "all"
89
+ Requires-Dist: fastapi; extra == "all"
90
+ Requires-Dist: httpx; extra == "all"
91
+ Requires-Dist: itsdangerous; extra == "all"
92
+ Requires-Dist: jedi; extra == "all"
93
+ Requires-Dist: Jinja2; extra == "all"
94
+ Requires-Dist: pytest>=8.4.2; extra == "all"
95
+ Requires-Dist: pytest-cov; extra == "all"
96
+ Requires-Dist: pytest-env; extra == "all"
97
+ Requires-Dist: pytest-xdist; extra == "all"
98
+ Requires-Dist: pytest-vcr; extra == "all"
99
+ Requires-Dist: pytest-asyncio; extra == "all"
100
+ Requires-Dist: pytest-rerunfailures>=16.2; extra == "all"
101
+ Requires-Dist: pytest-mock; extra == "all"
102
+ Requires-Dist: urllib3<2.0; extra == "all"
103
+ Requires-Dist: soundfile; extra == "all"
104
+ Requires-Dist: Pillow; extra == "all"
105
+ Requires-Dist: numpy; extra == "all"
106
+ Requires-Dist: duckdb; extra == "all"
107
+ Requires-Dist: fastapi; extra == "all"
108
+ Requires-Dist: ruff>=0.9.0; extra == "all"
109
+ Requires-Dist: mypy==1.15.0; extra == "all"
110
+ Requires-Dist: libcst>=1.4.0; extra == "all"
111
+ Requires-Dist: ty; extra == "all"
112
+ Requires-Dist: typing-extensions>=4.8.0; extra == "all"
113
+ Requires-Dist: types-PyYAML; extra == "all"
114
+ Requires-Dist: types-simplejson; extra == "all"
115
+ Requires-Dist: types-toml; extra == "all"
116
+ Requires-Dist: types-tqdm; extra == "all"
117
+ Requires-Dist: types-urllib3; extra == "all"
118
+ Provides-Extra: dev
119
+ Requires-Dist: authlib>=1.3.2; extra == "dev"
120
+ Requires-Dist: fastapi; extra == "dev"
121
+ Requires-Dist: httpx; extra == "dev"
122
+ Requires-Dist: itsdangerous; extra == "dev"
123
+ Requires-Dist: jedi; extra == "dev"
124
+ Requires-Dist: Jinja2; extra == "dev"
125
+ Requires-Dist: pytest>=8.4.2; extra == "dev"
126
+ Requires-Dist: pytest-cov; extra == "dev"
127
+ Requires-Dist: pytest-env; extra == "dev"
128
+ Requires-Dist: pytest-xdist; extra == "dev"
129
+ Requires-Dist: pytest-vcr; extra == "dev"
130
+ Requires-Dist: pytest-asyncio; extra == "dev"
131
+ Requires-Dist: pytest-rerunfailures>=16.2; extra == "dev"
132
+ Requires-Dist: pytest-mock; extra == "dev"
133
+ Requires-Dist: urllib3<2.0; extra == "dev"
134
+ Requires-Dist: soundfile; extra == "dev"
135
+ Requires-Dist: Pillow; extra == "dev"
136
+ Requires-Dist: numpy; extra == "dev"
137
+ Requires-Dist: duckdb; extra == "dev"
138
+ Requires-Dist: fastapi; extra == "dev"
139
+ Requires-Dist: ruff>=0.9.0; extra == "dev"
140
+ Requires-Dist: mypy==1.15.0; extra == "dev"
141
+ Requires-Dist: libcst>=1.4.0; extra == "dev"
142
+ Requires-Dist: ty; extra == "dev"
143
+ Requires-Dist: typing-extensions>=4.8.0; extra == "dev"
144
+ Requires-Dist: types-PyYAML; extra == "dev"
145
+ Requires-Dist: types-simplejson; extra == "dev"
146
+ Requires-Dist: types-toml; extra == "dev"
147
+ Requires-Dist: types-tqdm; extra == "dev"
148
+ Requires-Dist: types-urllib3; extra == "dev"
149
+ Dynamic: author
150
+ Dynamic: author-email
151
+ Dynamic: classifier
152
+ Dynamic: description
153
+ Dynamic: description-content-type
154
+ Dynamic: home-page
155
+ Dynamic: keywords
156
+ Dynamic: license
157
+ Dynamic: license-file
158
+ Dynamic: provides-extra
159
+ Dynamic: requires-dist
160
+ Dynamic: requires-python
161
+ Dynamic: summary
162
+
163
+ <p align="center">
164
+ <picture>
165
+ <source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub-dark.svg">
166
+ <source media="(prefers-color-scheme: light)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg">
167
+ <img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="352" height="59" style="max-width: 100%">
168
+ </picture>
169
+ <br/>
170
+ <br/>
171
+ </p>
172
+
173
+ <p align="center">
174
+ <i>The official CLI and Python client for the Hugging Face Hub.</i>
175
+ <br/>
176
+ <a href="#what-is-huggingface_hub">About</a>
177
+ ·
178
+ <a href="https://huggingface.co/docs/huggingface_hub">Documentation</a>
179
+ ·
180
+ <a href="https://huggingface.co/docs/huggingface_hub/en/installation">Install</a>
181
+ ·
182
+ <a href="https://huggingface.co/docs/huggingface_hub/en/guides/cli">CLI Guide</a>
183
+ ·
184
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/CONTRIBUTING.md">Contributing</a>
185
+ </p>
186
+
187
+ <p align="center">
188
+ <a href="https://huggingface.co/docs/huggingface_hub/en/index"><img alt="Documentation" src="https://img.shields.io/website/http/huggingface.co/docs/huggingface_hub/index.svg?down_color=red&down_message=offline&up_message=online&label=doc"></a>
189
+ <a href="https://github.com/huggingface/huggingface_hub/releases"><img alt="GitHub release" src="https://img.shields.io/github/release/huggingface/huggingface_hub.svg"></a>
190
+ <a href="https://github.com/huggingface/huggingface_hub"><img alt="PyPi version" src="https://img.shields.io/pypi/pyversions/huggingface_hub.svg"></a>
191
+ <a href="https://pypi.org/project/huggingface-hub"><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/huggingface_hub"></a>
192
+ <a href="https://codecov.io/gh/huggingface/huggingface_hub"><img alt="Code coverage" src="https://codecov.io/gh/huggingface/huggingface_hub/branch/main/graph/badge.svg?token=RXP95LE2XL"></a>
193
+ </p>
194
+
195
+ <h4 align="center">
196
+ <p>
197
+ <b>English</b> |
198
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_de.md">Deutsch</a> |
199
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_fr.md">Français</a> |
200
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_hi.md">हिंदी</a> |
201
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_ko.md">한국어</a> |
202
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_cn.md">中文 (简体)</a> |
203
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_kn.md">ಕನ್ನಡ</a>
204
+ </p>
205
+ </h4>
206
+
207
+ ## Quick start
208
+
209
+ Install the [`hf` CLI](https://huggingface.co/docs/huggingface_hub/en/guides/cli) with the standalone installer:
210
+
211
+ ```bash
212
+ # On macOS and Linux.
213
+ curl -LsSf https://hf.co/cli/install.sh | bash
214
+ ```
215
+
216
+ ```powershell
217
+ # On Windows.
218
+ powershell -ExecutionPolicy ByPass -c "irm https://hf.co/cli/install.ps1 | iex"
219
+ ```
220
+
221
+ Log in, then start working with the Hub:
222
+
223
+ ```bash
224
+ # Log in (use --token $HF_TOKEN in non-interactive environments)
225
+ hf auth login
226
+
227
+ # Find models served by Inference Providers
228
+ hf models ls --warm
229
+
230
+ # Download a model
231
+ hf download Qwen/Qwen3-0.6B
232
+
233
+ # Upload files to your own repo
234
+ hf upload username/my-cool-model ./model.safetensors
235
+
236
+ # Sync a local folder to a storage bucket
237
+ hf buckets sync ./checkpoints hf://buckets/username/my-bucket
238
+
239
+ # Run a job on Hugging Face infrastructure
240
+ hf jobs run python:3.12 python -c "print('Hello from the cloud!')"
241
+
242
+ # Discover everything else
243
+ hf --help
244
+ ```
245
+
246
+ The Hub uses tokens to authenticate applications (see [docs](https://huggingface.co/docs/hub/security-tokens)). Check out the [CLI guide](https://huggingface.co/docs/huggingface_hub/en/guides/cli) for a tour of the main features.
247
+
248
+ ## What is `huggingface_hub`?
249
+
250
+ The `huggingface_hub` library allows you to interact with the [Hugging Face Hub](https://huggingface.co/), a platform democratizing open-source Machine Learning for creators and collaborators. Discover pre-trained models and datasets for your projects, play with the thousands of machine learning apps hosted on the Hub, or create and share your own models, datasets and demos with the community. Everything ships in one package with two interfaces: the [`hf` CLI](https://huggingface.co/docs/huggingface_hub/en/guides/cli) for your terminal and the `huggingface_hub` library for Python — both designed to work well for humans and AI agents. Use them to:
251
+
252
+ - [Download files](https://huggingface.co/docs/huggingface_hub/en/guides/download) from the Hub.
253
+ - [Upload files](https://huggingface.co/docs/huggingface_hub/en/guides/upload) to the Hub.
254
+ - [Manage your repositories](https://huggingface.co/docs/huggingface_hub/en/guides/repository).
255
+ - [Run Inference](https://huggingface.co/docs/huggingface_hub/en/guides/inference) on deployed models.
256
+ - [Run Jobs](https://huggingface.co/docs/huggingface_hub/en/guides/jobs) on Hugging Face infrastructure.
257
+ - [Search](https://huggingface.co/docs/huggingface_hub/en/guides/search) for models, datasets and Spaces.
258
+ - [Share Model Cards](https://huggingface.co/docs/huggingface_hub/en/guides/model-cards) to document your models.
259
+ - [Engage with the community](https://huggingface.co/docs/huggingface_hub/en/guides/community) through PRs and comments.
260
+ - Do all of the above from the terminal with the [`hf` CLI](https://huggingface.co/docs/huggingface_hub/en/guides/cli).
261
+
262
+ ## Built for humans and AI agents
263
+
264
+ The `hf` CLI is designed for people and coding agents alike: the same commands adapt their output when run by an agent. If you use Claude Code, Codex, Cursor, or another coding agent, install the `hf` CLI Skill — a command reference generated from your installed CLI:
265
+
266
+ ```bash
267
+ # for Codex, Cursor, OpenCode, Pi and other agents that load skills from `.agents/skills`
268
+ hf skills add
269
+ # includes the above + Claude Code
270
+ hf skills add --claude
271
+ ```
272
+
273
+ Learn more in the [Hugging Face CLI for AI agents guide](https://huggingface.co/docs/hub/agents-cli) and the [announcement blog post](https://huggingface.co/blog/hf-cli-for-agents).
274
+
275
+ ## Use the Python library
276
+
277
+ Install the `huggingface_hub` package with [pip](https://pypi.org/project/huggingface-hub/) (this also installs the `hf` CLI):
278
+
279
+ ```bash
280
+ pip install huggingface_hub
281
+ ```
282
+
283
+ We recommend using [`uv`](https://docs.astral.sh/uv/) for a fast and reliable install:
284
+
285
+ ```bash
286
+ uv pip install huggingface_hub
287
+ ```
288
+
289
+ In order to keep the package minimal by default, `huggingface_hub` comes with optional dependencies useful for some use cases. For example, if you want to use the MCP module, run:
290
+
291
+ ```bash
292
+ pip install "huggingface_hub[mcp]"
293
+ ```
294
+
295
+ To learn more about installation and optional dependencies, check out the [installation guide](https://huggingface.co/docs/huggingface_hub/en/installation).
296
+
297
+ ### Download files
298
+
299
+ Download a single file
300
+
301
+ ```py
302
+ from huggingface_hub import hf_hub_download
303
+
304
+ hf_hub_download(repo_id="zai-org/GLM-5.2", filename="config.json")
305
+ ```
306
+
307
+ Or an entire repository
308
+
309
+ ```py
310
+ from huggingface_hub import snapshot_download
311
+
312
+ snapshot_download("sentence-transformers/all-MiniLM-L6-v2")
313
+ ```
314
+
315
+ Files will be downloaded in a local cache folder. More details in [this guide](https://huggingface.co/docs/huggingface_hub/en/guides/manage-cache).
316
+
317
+ ### Create a repository
318
+
319
+ ```py
320
+ from huggingface_hub import create_repo
321
+
322
+ create_repo(repo_id="super-cool-model")
323
+ ```
324
+
325
+ ### Upload files
326
+
327
+ Upload a single file
328
+
329
+ ```py
330
+ from huggingface_hub import upload_file
331
+
332
+ upload_file(
333
+ path_or_fileobj="/home/lysandre/dummy-test/README.md",
334
+ path_in_repo="README.md",
335
+ repo_id="lysandre/test-model",
336
+ )
337
+ ```
338
+
339
+ Or an entire folder
340
+
341
+ ```py
342
+ from huggingface_hub import upload_folder
343
+
344
+ upload_folder(
345
+ folder_path="/path/to/local/space",
346
+ repo_id="username/my-cool-space",
347
+ repo_type="space",
348
+ )
349
+ ```
350
+
351
+ More details in the [upload guide](https://huggingface.co/docs/huggingface_hub/en/guides/upload).
352
+
353
+ ## Integrating with the Hub.
354
+
355
+ We're partnering with cool open source ML libraries to provide free model hosting and versioning. You can find the existing integrations [here](https://huggingface.co/docs/hub/libraries).
356
+
357
+ The advantages are:
358
+
359
+ - Free model or dataset hosting for libraries and their users.
360
+ - Built-in file versioning, even with very large files, made possible by [Xet](https://huggingface.co/docs/hub/xet/index), the Hub's chunk-deduplicated storage backend.
361
+ - In-browser widgets to play with the uploaded models.
362
+ - Anyone can upload a new model for your library, they just need to add the corresponding tag for the model to be discoverable.
363
+ - Fast downloads! We use Cloudfront (a CDN) to geo-replicate downloads so they're blazing fast from anywhere on the globe.
364
+ - Usage stats and more features to come.
365
+
366
+ If you would like to integrate your library, feel free to open an issue to begin the discussion. We wrote a [step-by-step guide](https://huggingface.co/docs/hub/adding-a-library) with ❤️ showing how to do this integration.
367
+
368
+ ## Contributions (feature requests, bugs, etc.) are super welcome 💙💚💛💜🧡❤️
369
+
370
+ Everyone is welcome to contribute, and we value everybody's contribution. Code is not the only way to help the community.
371
+ Answering questions, helping others, reaching out and improving the documentations are immensely valuable to the community.
372
+ We wrote a [contribution guide](https://github.com/huggingface/huggingface_hub/blob/main/CONTRIBUTING.md) to summarize
373
+ how to get started to contribute to this repository.
.cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub-1.26.0.dist-info/RECORD ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ huggingface_hub/__init__.py,sha256=MHnwtoK4eZWretvLQzTgRce55TAwjlkZld6FvUq1TLY,60623
2
+ huggingface_hub/_buckets.py,sha256=XyLbsLzS2fpQz0aAIjKzV-1YbQ4XYZ4-HXQTVq0TXoU,45311
3
+ huggingface_hub/_commit_api.py,sha256=lalqhJKl8_RWVHgAdnzZKG_fy4E7fbyHIev6nDLrj4w,45378
4
+ huggingface_hub/_commit_scheduler.py,sha256=VG3zjb7xb66NrFMq_pB9dWIsoqSPoF6CntovV7vUiWg,14684
5
+ huggingface_hub/_dataset_viewer.py,sha256=LE9k4s0WJ0JNdriJ8L6qV_-xfbUVC1VEh7CBd0jOjLI,5675
6
+ huggingface_hub/_eval_results.py,sha256=Og7p7bCl2HQG6ZWlSDyir-CRTXjNWPu3S3q65cTGffs,8126
7
+ huggingface_hub/_inference_endpoints.py,sha256=TNCEvHfu5M790bQPl4BccRzcii8WS5FlDYGrGqQzdW4,17724
8
+ huggingface_hub/_jobs_api.py,sha256=f7NhziUMH6jWpWClnLPFx4XIZ0xVGAdTGfBxIn2IVy0,23679
9
+ huggingface_hub/_local_folder.py,sha256=KsetQw7pW0ZwFI2RLQPqVq0ZnORogPkBwRYcbRqNd5o,20654
10
+ huggingface_hub/_login.py,sha256=wAMdhqMSSh3GBJDozodmk4IIsAvb9J6LaLY9KnXFoyY,21818
11
+ huggingface_hub/_oauth.py,sha256=S8evEd8JLJHz-JiSjGH4WiIi_A7oDox_xH7E9rN1Jic,18628
12
+ huggingface_hub/_oidc.py,sha256=3kcCLavWQ5FQOwizUPzLaBb1ft2FIJo0bSXL24S3r4U,7098
13
+ huggingface_hub/_revision.py,sha256=NCmIVCR-_HjmxeYiDntcsTU-bLSfJLq8PLvvG8UhZtI,1696
14
+ huggingface_hub/_sandbox.py,sha256=XEXZi5S3rYyw_o3td3rB0xOVdmhpAlnyUykBsAw9KP8,80148
15
+ huggingface_hub/_sandbox_cache.py,sha256=UYpvHOWZj7CRhacYs5Ot-5N1wFcAapiAyniYdoX-jX8,5742
16
+ huggingface_hub/_snapshot_download.py,sha256=fOte9xmpaok0LGbubJZhSRd7t0nn-p00mWMebCx56qc,31029
17
+ huggingface_hub/_space_api.py,sha256=MF3ezhgl0Vpt3RP1wuwZ7VI9_rSyIlIJ5SmDzIwQlcQ,13424
18
+ huggingface_hub/_tensorboard_logger.py,sha256=GA-LhoG4Z-0Zq7w5B9vTIDJbWUkAhiG2d8a-ktlwGDY,8377
19
+ huggingface_hub/_tree_cache.py,sha256=M7CHMKhwY1cuhe9fb3WT1X8jmd9BXa2Sx_HS4TIXFgI,5843
20
+ huggingface_hub/_upload_large_folder.py,sha256=BWA1zyOK9W_3YUerX9YWQa3wAYtHRe_ypgsO79JEkqo,31235
21
+ huggingface_hub/_upload_pipeline.py,sha256=6YaQNtubAEaPyRoRBjPQrmsdSnCExg2KzfBuhjNqI5I,28994
22
+ huggingface_hub/_webhooks_payload.py,sha256=B9zqljcm20DGeVxJKba570i6RP-cR9CEupMGBuNDHHA,3544
23
+ huggingface_hub/_webhooks_server.py,sha256=VXOk3FHkbIc28phxknJfaFy5B_EoKOKihoCKyOaWZQk,15767
24
+ huggingface_hub/community.py,sha256=N5OE5Rbc2BMwpNXCFOPQAwn0otqQunsXdEnSE_0J2Xo,12325
25
+ huggingface_hub/constants.py,sha256=y4TqYE5UuXFrc-ivzpLiQKoKKw6xHY75SBEIgOuuD8g,13174
26
+ huggingface_hub/dataclasses.py,sha256=dkPHOKq1YVlto9TWMkeX8BnErmbZk6tVtqD1S_n6Cw8,25896
27
+ huggingface_hub/errors.py,sha256=MsfOFq6Sxo2bZ8PTPWbQb250v7aqZJO5-mmWSnX_kDk,18695
28
+ huggingface_hub/fastai_utils.py,sha256=jwKeVXH_VP0zxnOKVNQCVCkF-stH70l-bExbbrYkBKQ,16583
29
+ huggingface_hub/file_download.py,sha256=QT4ICMPp_CbLBVNn-qCYnyuwmA2mjjc546fYppt1m8Y,87740
30
+ huggingface_hub/hf_api.py,sha256=ByjtP6rHRHBeQIgYKc9AjysjA219t8O14tuXfVs-6YQ,672231
31
+ huggingface_hub/hf_file_system.py,sha256=39YZea452YnGVvHZosmL3_QtWaz7VS-4P2Mc-xI7K0E,60503
32
+ huggingface_hub/hub_mixin.py,sha256=ljKAtm3qQsY-ARtxY-PCFx0koFXLI37JytMrzpqfnQo,36912
33
+ huggingface_hub/lfs.py,sha256=8ymYNHRXgvgUUM9w0EAnC-vkSOOq_1EFJEJNoevoeE8,16588
34
+ huggingface_hub/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
+ huggingface_hub/repocard.py,sha256=7u7hiKjNuPYOwa3XPOPUnYPpuv4buya4WM47kVexklY,35602
36
+ huggingface_hub/repocard_data.py,sha256=f834MUSXGqrVcC02668r3ACrPzKKOAg75y3aB_hXm1U,34308
37
+ huggingface_hub/_hot_reload/__init__.py,sha256=nQEuyVZLAS_463Dff1JH5MorTpkYsBVFCyPhYWY3UyI,606
38
+ huggingface_hub/_hot_reload/client.py,sha256=Ax7qT4CUi5wrg3mDzqkAG8ZzDsCwdcIIS1FIXK0SqD8,4269
39
+ huggingface_hub/_hot_reload/sse_client.py,sha256=49kmsB2P9sxgbZ16ed6F4aLDs3rsHrNpbp6iKlvF90c,4948
40
+ huggingface_hub/_hot_reload/types.py,sha256=d3AOJCLUxT41Fhz4jUrFevm9bfpooe_3PQhpBdgNYSs,2725
41
+ huggingface_hub/cli/__init__.py,sha256=tWu3Is-m2tlJwXhM_vT2mPRgpnt9KhU9qvw5aRsnjU0,664
42
+ huggingface_hub/cli/_city_game.py,sha256=2qkC9dCtPwf4-aqrnbN-vApf0YqIcGGjn2v-etrTfqg,20585
43
+ huggingface_hub/cli/_cli_utils.py,sha256=Q5795puu89Kf4fEvQYPjyJmDnyqFEyEr5SW1xQXQk8I,41313
44
+ huggingface_hub/cli/_completion.py,sha256=BDP6Vob9TLFp6K3lr0XOY98FyD-rm22KrjwsO_YGNbE,3759
45
+ huggingface_hub/cli/_cp.py,sha256=Z-2Z_tBs1e4XBqRO5R9QnabU4qTi9HDlbA52jTBaCkY,10436
46
+ huggingface_hub/cli/_errors.py,sha256=X0rUTO-3eCK5v_MLGEza1BxcuXGccPY-h7ShzmuQc34,5907
47
+ huggingface_hub/cli/_file_listing.py,sha256=h_dTEphSqtvknzqJ_9cIK3Cjlz5M6cycYD3cqUW9Fn0,7986
48
+ huggingface_hub/cli/_framework.py,sha256=HqfAEYGWRSjKABAZi2zVNgryyU9QKW8u-tRXfR_4nQ8,27364
49
+ huggingface_hub/cli/_help_formatter.py,sha256=-vsa3HfHQFkKWms77EGyp9i22t44ETmVt2L-e8qP-KM,1288
50
+ huggingface_hub/cli/_output.py,sha256=OxFrvAcDU1TRDV0AbNh4EI1P6tqifSeVT-yqfF92U_0,14754
51
+ huggingface_hub/cli/_skills.py,sha256=b1dlasxALM5KsDG5R1azcETksQ6ssYYZN-kaz-RdHwg,12134
52
+ huggingface_hub/cli/auth.py,sha256=Ew79M60pTMCnS1ewKVK3fd8ZyfHrNjREOmNWuFXy37M,6056
53
+ huggingface_hub/cli/buckets.py,sha256=J8xMP88fQ6ri3f65Z8XEImI2GNA4KKWloLJJQCBezZw,21062
54
+ huggingface_hub/cli/cache.py,sha256=2T0oTYXsrtcJxhQENSpXnYYNUkagsvvdrf5gbCACBjA,28574
55
+ huggingface_hub/cli/collections.py,sha256=Ed41zJqrvK-AWkHdkeHWm_aJKR_ZeNIovCGvWG04itk,10120
56
+ huggingface_hub/cli/datasets.py,sha256=X1xMJTFhHH5NJtmjTS6NN1g4ffai6Abh_obDEJM5mvo,10497
57
+ huggingface_hub/cli/deprecated_cli.py,sha256=vAK_CR4NE9uzNJ0I59SyBnIln5nlypG4CPoohMoPMVg,1090
58
+ huggingface_hub/cli/discussions.py,sha256=obvvN4mtsFnfMs67YTZaMvHkVaM6A-FYr5n-wGkF_jE,14029
59
+ huggingface_hub/cli/download.py,sha256=o6fMKJoNQMxCm1RQUnX3blihJ17mantxkf0F68rZIxs,9669
60
+ huggingface_hub/cli/extensions.py,sha256=qNM1DmzcQXt8kPWQfISc8Pvyku8BxAs-BOVP6sKRBOM,25572
61
+ huggingface_hub/cli/hf.py,sha256=G2R-Mgo2AX09aRiAb-13eZbO441m9yDTwMCtSUf1iac,5208
62
+ huggingface_hub/cli/inference_endpoints.py,sha256=4pfvPm5PVQizStyXGRBnrev62KvhzSNEL65UEVtRcKw,17418
63
+ huggingface_hub/cli/jobs.py,sha256=EVGuxn2GZqkQolHib98PztJeJ64Opq-MjgIub2WTYb4,52840
64
+ huggingface_hub/cli/lfs.py,sha256=MAccazVPX0n-ySRaPocaQUHP7oBnVrvWZt0RhmNIavs,5936
65
+ huggingface_hub/cli/models.py,sha256=eG7H5yDjCVrdL7W_-wpcl70qXlv8bC-roSEu8AroPws,10148
66
+ huggingface_hub/cli/papers.py,sha256=HvT-8zj2fi14ua6awWpHphlbJ362FEJIwSCBJRQZ_cM,4982
67
+ huggingface_hub/cli/repo_files.py,sha256=sGbD5wND3miF71ThfOBJm4xzPRUpJBeLFdvyj229NAM,2443
68
+ huggingface_hub/cli/repos.py,sha256=QS3xYKvspLhCfO5VvpORrSiF6XhSVFclmBxsacVDP2c,20192
69
+ huggingface_hub/cli/sandbox.py,sha256=rTCZf6WhoDa7UiNhsTU_4Lh5uKqKYOs73xXGAAqJGdA,18379
70
+ huggingface_hub/cli/skills.py,sha256=JQkqD43bfr8IapIVp8rvQpd8NKA0dXSbGJD8g-u51w8,19473
71
+ huggingface_hub/cli/spaces.py,sha256=AU655GGrQmF1s1yO8yO6ml2Z8veE7zsh4UMuR5b13RI,40800
72
+ huggingface_hub/cli/system.py,sha256=NtICLnQ49BHFpm2Cl37IV_h21L6mufxVDfse8Lp38HA,1760
73
+ huggingface_hub/cli/upload.py,sha256=P6sq8Dj81a2wazUgZEqbliRleVAAmJrf8ajFDDzHrBE,11318
74
+ huggingface_hub/cli/upload_large_folder.py,sha256=A-2qxAdLrYd8IogfZS2nDhSR1cpA_aaxhXst638WkAk,4081
75
+ huggingface_hub/cli/webhooks.py,sha256=HdpPp01c6Ece_EuNNJr46rnRki3vF4j4o9-SqYRUHnM,8550
76
+ huggingface_hub/inference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
77
+ huggingface_hub/inference/_client.py,sha256=bN5cj4tBHPD6v603uq4CJjMB_mmmpdVcfXtl9XIOVqc,157679
78
+ huggingface_hub/inference/_common.py,sha256=X-fBP8s6xuNTAuQsGVIethE8dNQaa-mK7Ds54qVVDz8,14999
79
+ huggingface_hub/inference/_generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
+ huggingface_hub/inference/_generated/_async_client.py,sha256=imtfJD9m3qxeo_59gox3nnV8Tr8dfQF3dQF0Joy5K4g,160890
81
+ huggingface_hub/inference/_generated/types/__init__.py,sha256=e625ENOmTUM4uUL1eAlsZOK7CovNoGBDH-TxSNQhaC4,6869
82
+ huggingface_hub/inference/_generated/types/audio_classification.py,sha256=DGWEvrRPX7xpXlbYY4LMojGcULdEZFTshhNR81rTNcQ,1567
83
+ huggingface_hub/inference/_generated/types/audio_to_audio.py,sha256=2Ep4WkePL7oJwcp5nRJqApwviumGHbft9HhXE9XLHj4,891
84
+ huggingface_hub/inference/_generated/types/automatic_speech_recognition.py,sha256=X0uCj9qwAcOmlKtV3vWH5cAgLGY0PuYIy2eSH7GE1qs,5439
85
+ huggingface_hub/inference/_generated/types/base.py,sha256=EPWp1qudjeEimEAyQ-ptdxpAACoRM8tW342-Ds7pP3I,6938
86
+ huggingface_hub/inference/_generated/types/chat_completion.py,sha256=3yc06ZI0NCZzsaeoxSMWyIHqGc8Vn_6aExncuXa1llE,11100
87
+ huggingface_hub/inference/_generated/types/depth_estimation.py,sha256=5Kn4xNGJg235Cofr1lzO59eRGCuLTZun8z5t6a2do8Q,910
88
+ huggingface_hub/inference/_generated/types/document_question_answering.py,sha256=aUZcrDGexjw8Fnm2rACm_3my77V15NnQHZxj-sa7bjo,3146
89
+ huggingface_hub/inference/_generated/types/feature_extraction.py,sha256=DiO47PqwhdNta_KPDBsXfCPIL6BWNhyCLymxORlqUA0,1509
90
+ huggingface_hub/inference/_generated/types/fill_mask.py,sha256=NhEskgoiMst7U_0cV_S-wryga4_2T5LgpbyQ23vHMp0,1680
91
+ huggingface_hub/inference/_generated/types/image_classification.py,sha256=xWr4OY65EcIIhd7MI610a7xlaAVHQeydi8Gc7tlaPTU,1579
92
+ huggingface_hub/inference/_generated/types/image_segmentation.py,sha256=lZKzbn_gkSi1sYGLb9ryeRr0aDAVrfYh0H5Iiv5JNsY,1935
93
+ huggingface_hub/inference/_generated/types/image_text_to_image.py,sha256=pRQgYKXJbIpEjRBxuIE6NRDtk_km9DSTQ2s2qxkYJRM,2585
94
+ huggingface_hub/inference/_generated/types/image_text_to_video.py,sha256=MVhP8D4eYjpT3hWYkkpuiME-hWY09o7C4rIn_wmnAmY,2450
95
+ huggingface_hub/inference/_generated/types/image_to_image.py,sha256=P9TeMFSnZI_pa6DyinzDPWL0PNm_INJwsqFUEzpwIcU,2262
96
+ huggingface_hub/inference/_generated/types/image_to_text.py,sha256=DCDS0Nqi-4AuATitvZm4EgrzYQuQEQ5lzBcaHuCmHnY,4740
97
+ huggingface_hub/inference/_generated/types/image_to_video.py,sha256=iMCjiFTUza9AW_MyJ1videhYgvMY9QSzQ59kNdTE9QY,2206
98
+ huggingface_hub/inference/_generated/types/object_detection.py,sha256=zNILlyZJh59rNNfqXM5x9uprDCPfEU-bvBtabeKSMzI,1965
99
+ huggingface_hub/inference/_generated/types/question_answering.py,sha256=lIRf8DjRiAsjzWUBEsGt354SB4bvejLokf-8luHw6_o,2845
100
+ huggingface_hub/inference/_generated/types/sentence_similarity.py,sha256=eNGiO4dR-Lft9yOLE0E97jfVyOT_ExDWZW5GeJGdatU,1027
101
+ huggingface_hub/inference/_generated/types/summarization.py,sha256=5Dpt6LRteT-hO9esa3Ty_-xSL5U-zTtVZzy3iKwZRng,1472
102
+ huggingface_hub/inference/_generated/types/table_question_answering.py,sha256=bwn616XJ-eLa5JKzn3m9rZZ3z63INGEUwRSOCWlEh-4,2269
103
+ huggingface_hub/inference/_generated/types/text2text_generation.py,sha256=fotSlPWtIlp_LG26AQvNRXxU-jCUfda5PWsxCkbFeKM,1591
104
+ huggingface_hub/inference/_generated/types/text_classification.py,sha256=uamBzz4YzWQ9mb6yuriykX8r47ZHf0K3eJpOLzB2qJw,1439
105
+ huggingface_hub/inference/_generated/types/text_generation.py,sha256=FRUljypvCSQ2RaiylhlHeLJfHNy8qZvuty6SCB_zcaA,5813
106
+ huggingface_hub/inference/_generated/types/text_to_audio.py,sha256=CiaTUSBdFtOs3gGTosqyQrjCwrN8mVJLRxDDWUtwZpQ,4677
107
+ huggingface_hub/inference/_generated/types/text_to_image.py,sha256=Ju25WIDHE-1n8jlZ_udG4rpAaPYpmghR7-cDgVfuf48,1869
108
+ huggingface_hub/inference/_generated/types/text_to_speech.py,sha256=WqDzWkhZsDcjapkoFrkyjF903SKs7aHhjypsYrn8oBw,4693
109
+ huggingface_hub/inference/_generated/types/text_to_video.py,sha256=KjcDbtChwrIxIdTH6vcesUaMcjL2xjPf2nWEnHazj4Y,1756
110
+ huggingface_hub/inference/_generated/types/token_classification.py,sha256=8KRBlqgFDszaUnPMvdRkZNQaZBtDfBhKZ6SggQldQMM,1894
111
+ huggingface_hub/inference/_generated/types/translation.py,sha256=-j2PC1-qfoxvGMaKesqf5jXelqj0BDlEpfvZ7dsIEJM,1742
112
+ huggingface_hub/inference/_generated/types/video_classification.py,sha256=vfaCqp8MuRMMtGvYCX0x4-AcwEd71kPHgSYJTNIOxLQ,1668
113
+ huggingface_hub/inference/_generated/types/visual_question_answering.py,sha256=sWIB-SuEpW21oU6O5qQF3tt5PavUFsFOa8Xg4upTtek,1654
114
+ huggingface_hub/inference/_generated/types/zero_shot_classification.py,sha256=gx-7WHad7xsNa89iSKSteKHjaHrKbIyzN_nSdJN3HCY,1697
115
+ huggingface_hub/inference/_generated/types/zero_shot_image_classification.py,sha256=JZTQvcbSGrOQlWcPuJvAMT8YziDpBRn1O2RQSw507uY,1449
116
+ huggingface_hub/inference/_generated/types/zero_shot_object_detection.py,sha256=sjdpVUN5zW9aYBymLVUs6i5HVk2qkUBO9ysEjHmsXVM,1605
117
+ huggingface_hub/inference/_mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
118
+ huggingface_hub/inference/_mcp/_cli_hacks.py,sha256=kIA8FfRfOWS3SrZrMTbuVOjE6yxfKfMK75Co5egTWHA,3284
119
+ huggingface_hub/inference/_mcp/agent.py,sha256=ufIzMGHore5n252hV5GZPM0ouDXIl6tv5Jl_5gHXnbg,4250
120
+ huggingface_hub/inference/_mcp/cli.py,sha256=RKdVQ_VdEgf1AL_QBCvwrsUQ0Ux4R1yerrE46DrV5C0,9642
121
+ huggingface_hub/inference/_mcp/constants.py,sha256=0Ih6ivEvG-pfF8NwErFngzP4Rof4lQoz6ms_eKSAkUI,2463
122
+ huggingface_hub/inference/_mcp/mcp_client.py,sha256=dGp8PhN6aVw4bDnuSySFSiguHUiz-nzhgv89CVdO7pI,17243
123
+ huggingface_hub/inference/_mcp/types.py,sha256=yHNfPsM9MhD06oeKdkbmrBsW-3WhUeqA26fyfRfx_bk,929
124
+ huggingface_hub/inference/_mcp/utils.py,sha256=gxSB_rBjQ6VrkApKFsxk6-UzhijxkDVNuZrsjW5pL8k,4318
125
+ huggingface_hub/inference/_providers/__init__.py,sha256=TNWnSNPk0RmToBysTc5D1COm0vHEJoGom0Yh7oG2wC4,9838
126
+ huggingface_hub/inference/_providers/_common.py,sha256=9CjlMAtb7W0-GdB1Z-VkV0GKZ0Zm68rIuicdGE-765M,13716
127
+ huggingface_hub/inference/_providers/cerebras.py,sha256=QOJ-1U-os7uE7p6eUnn_P_APq-yQhx28be7c3Tq2EuA,210
128
+ huggingface_hub/inference/_providers/cohere.py,sha256=P9kbIuvQ2rXI1yNmgbw5VKFFTE0huLq2k-BCyDkDico,1226
129
+ huggingface_hub/inference/_providers/deepinfra.py,sha256=4Behgf5V7FTv7CbN6vPEIYwv1z4gztdRRU-KVoOgxVE,4703
130
+ huggingface_hub/inference/_providers/fal_ai.py,sha256=Y2vo5Dl3e8EoehplwNshu8LbDT1e7V4ZyhAMqs0wXws,11705
131
+ huggingface_hub/inference/_providers/featherless_ai.py,sha256=C8OHdFpoFyA--pawLTekUmUSRq4sw_r0D-cSPekD4kE,1347
132
+ huggingface_hub/inference/_providers/fireworks_ai.py,sha256=go6XPum8u0-g768HJ_r0S4Gb445gZJxnuY_acktz-9c,1188
133
+ huggingface_hub/inference/_providers/groq.py,sha256=JTk2JV4ZOlaohho7zLAFQtk92kGVsPmLJ1hmzcwsqvQ,315
134
+ huggingface_hub/inference/_providers/hf_inference.py,sha256=d2vdCKSi5CtyQqYndHHvH7SY131-7YHUK3yE7653eIc,9467
135
+ huggingface_hub/inference/_providers/novita.py,sha256=ATEoSdPAPLMfx3JpBc0sOyLh4upJYP6xHBuo4YEDYvg,2470
136
+ huggingface_hub/inference/_providers/nscale.py,sha256=T1L2JLI9LqYT9_YEdW76YEtxfDNtdGkoFhH-p2LmSxg,1767
137
+ huggingface_hub/inference/_providers/openai.py,sha256=wwjaaQ55xLmDsDnHpZk52xbuLoGZfWzJkFsE8AdFVaI,1054
138
+ huggingface_hub/inference/_providers/ovhcloud.py,sha256=tdmymlkbddMJKV7NRZ-tH2wymbLPFDTqUSXpWJUXyDQ,314
139
+ huggingface_hub/inference/_providers/publicai.py,sha256=1I2W6rORloB5QHSvky4njZO2XKLTwA-kPdNoauoT5rg,210
140
+ huggingface_hub/inference/_providers/replicate.py,sha256=hte0ZB2RtGFwpAuLrFp2Gbgsn3EOlccCnJkWTDTW__A,6027
141
+ huggingface_hub/inference/_providers/scaleway.py,sha256=MfIc7ZND1sPr__rOmNHZVg0VpECQo0bVyksgIm_32xQ,1174
142
+ huggingface_hub/inference/_providers/together.py,sha256=lrymDZ86n5yoR_Zz7o3AzzSePyo0s7BOBU5digLxb5o,12220
143
+ huggingface_hub/inference/_providers/wavespeed.py,sha256=MGM7Y7r2nQiH_EH0t5UE1o1fT-o3sS7RaQlicS9WHsg,5028
144
+ huggingface_hub/inference/_providers/zai_org.py,sha256=gLJZOEmCPmUZvdM7VDn2nxm4ac3veHdoMgQNR63UeWE,4739
145
+ huggingface_hub/serialization/__init__.py,sha256=jCiw_vVQYW52gwVfWiqgocf2Q19kGTQlRGVpf-4SLP8,963
146
+ huggingface_hub/serialization/_base.py,sha256=8vYeDIsqgyOO3I_uii44Bkb50LsMz3kkD4gwAPzhfWU,8436
147
+ huggingface_hub/serialization/_dduf.py,sha256=FmGRg5wkXI5sNCgZgCNJFmqb_nVrrQYOHf4Lqq0d64I,15385
148
+ huggingface_hub/serialization/_torch.py,sha256=BtaCP-G3oYRP6Pj9MhI-ygBsk3JbBPnVDW9huSOgtkk,46897
149
+ huggingface_hub/templates/datasetcard_template.md,sha256=W-EMqR6wndbrnZorkVv56URWPG49l7MATGeI015kTvs,5503
150
+ huggingface_hub/templates/modelcard_template.md,sha256=4AqArS3cqdtbit5Bo-DhjcnDFR-pza5hErLLTPM4Yuc,6870
151
+ huggingface_hub/utils/__init__.py,sha256=pdVhPWWZkv0QM7kAQw7Bf259RZdPtYBLQqQwLQN-VC4,4045
152
+ huggingface_hub/utils/_auth.py,sha256=Ykuq3yi67jxHmFdyLSc43xvGuCAIR7-h-dajX8IxpGQ,19958
153
+ huggingface_hub/utils/_cache_assets.py,sha256=nnzHRtQAR50dQeIK6qKddsmjjTW9v9HZ7b9bq7PJqss,5691
154
+ huggingface_hub/utils/_cache_manager.py,sha256=2StxP-nHZ5W9_hi8N9wBFqRNLw5HwO0h9HC7NTAGaFE,34955
155
+ huggingface_hub/utils/_chunk_utils.py,sha256=pTjy8Z-KLU4W_6D3OUh3E8lCodWDCd6aJwjNDU0C5U8,2121
156
+ huggingface_hub/utils/_datetime.py,sha256=tbNyI0Dkh27oScPUtLIT_8apqIIkXZYbigjOn9S3aMw,2755
157
+ huggingface_hub/utils/_deprecation.py,sha256=n4kNHbGipquSObJ-gxodcfd6lqoe_8s-VIsTuo3Oruk,4865
158
+ huggingface_hub/utils/_detect_agent.py,sha256=Iw2KW9BUZWfIypn9CtiTmEibHwKK9xx5Ar48z1cMU-Q,7337
159
+ huggingface_hub/utils/_dotenv.py,sha256=NdlEM8OXtzwlwmJCmdc6oGubFObrpgr408y8gnSs7ls,2604
160
+ huggingface_hub/utils/_experimental.py,sha256=q9vUvc1JybVFRQ0GRREG-BLouZEJC_40MxcwbAlOud0,2464
161
+ huggingface_hub/utils/_fixes.py,sha256=jTK1VLmc0ZC9ROSXjKoL5F6kOZFByzirRWIdXxhBfWU,4124
162
+ huggingface_hub/utils/_git_credential.py,sha256=1BhjvIScCOAToDORLOKrR3Szs-m0E5AYHPmC0SD7Nrs,4548
163
+ huggingface_hub/utils/_headers.py,sha256=Q9bu9mvOpm-9rfv-YRlr_Ywy_aMZkmRcN3MbVEcJAJA,8234
164
+ huggingface_hub/utils/_hf_uris.py,sha256=RTHrVKLT5vVU-ca8roXHrKwbN3njowanvxHjx5B4sUg,27558
165
+ huggingface_hub/utils/_http.py,sha256=C_mC63TsaxpmzyYBPHCneXKFLACEytAkBwxRwMNxcB4,46014
166
+ huggingface_hub/utils/_lfs.py,sha256=xMU-ROgNAUpDkzbH6yRZsE-eVYUYTNMGrgVb_QdTv-k,3942
167
+ huggingface_hub/utils/_oauth_device.py,sha256=o7ICmI01yDt1oAFNMUJvN1ThSfaCDpC8AHYSQgcnFGw,7983
168
+ huggingface_hub/utils/_pagination.py,sha256=h-TJjFbX3FqkA1T0tGZ0EhxMvuRSCg-UfL_a-BMs54I,1943
169
+ huggingface_hub/utils/_parsing.py,sha256=DVWuO6s_XMiGfXyc0jyX5hi_yGgBHpF9KLoeQM-VVK0,3586
170
+ huggingface_hub/utils/_paths.py,sha256=kWpUMIK9rmKb2LHgHCkk2DnroDzucrwbj-urCJCgfGw,5962
171
+ huggingface_hub/utils/_runtime.py,sha256=GVJ_Dt6y_48TZWl0ui9yPdW8M7rqGblRGyUqKaXxkCo,13493
172
+ huggingface_hub/utils/_safetensors.py,sha256=qFE7OA-vjU8X0zBBtOeNRzLu147KF-PdFoaxkYfWB4M,4426
173
+ huggingface_hub/utils/_subprocess.py,sha256=tFVBBNot_HLVqQ79y873TGb12C4PUTMwub-GhzDTemE,4542
174
+ huggingface_hub/utils/_telemetry.py,sha256=Tpa3YmOLhK_MEnL2i2fRLQy8aqAEZWbj6MKC18Hs8BA,4824
175
+ huggingface_hub/utils/_terminal.py,sha256=whHgs0Co-1LatoCmJE_ojqE_cWP6b5dWPWpU-uSFWUU,8969
176
+ huggingface_hub/utils/_typing.py,sha256=1LeE785YedppXSR9a1fQDu5rhTxX5v9kBYBaHrP65rA,3542
177
+ huggingface_hub/utils/_validators.py,sha256=tuC1U4yxB-4XKIajZMnKZUSKvZ6qPpydY8LItfa0g40,8419
178
+ huggingface_hub/utils/_verification.py,sha256=ZSilnolSkYmHB3vmBlWuuVr53xz59P5uGnxC3H-Hjc0,5434
179
+ huggingface_hub/utils/_xet.py,sha256=lVCUmCxzmBFYRSkJxFLtfhe7_HJWdLzJdENL-ln5Grc,6556
180
+ huggingface_hub/utils/_xet_progress_reporting.py,sha256=MnNCxB9ieflArNNyz3R4kpkjOdt6mQxi8qp8xqzXQTM,14162
181
+ huggingface_hub/utils/endpoint_helpers.py,sha256=9VtIAlxQ5H_4y30sjCAgbu7XCqAtNLC7aRYxaNn0hLI,2366
182
+ huggingface_hub/utils/insecure_hashlib.py,sha256=z3dVUFvdBZ8kQI_8Vzvvlr3ims-EBiY-SYPdnzIKOkw,1008
183
+ huggingface_hub/utils/logging.py,sha256=WaXk5gRa8Ml_LUIH34QCr8suYj8i_8Wot4IDnYJyWyM,4870
184
+ huggingface_hub/utils/sha.py,sha256=h8wxheZpcv671RhtiIFcFmQTDSrogN3kwQx3ZaNEUHg,2121
185
+ huggingface_hub/utils/tqdm.py,sha256=xXjKGy2y2gMqpKeMUqXcQWc66buW39NwkTr3hlWH6MY,16729
186
+ huggingface_hub-1.26.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
187
+ huggingface_hub-1.26.0.dist-info/METADATA,sha256=KcwO-q5qwA5Ebh_FICnvHDP8U6mPa8rdlnih7rnssYc,16314
188
+ huggingface_hub-1.26.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
189
+ huggingface_hub-1.26.0.dist-info/entry_points.txt,sha256=zP7F_bBSdircPQFysHQZ9F3Lcn5_dCSOEZxVlGCsG0w,212
190
+ huggingface_hub-1.26.0.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
191
+ huggingface_hub-1.26.0.dist-info/RECORD,,
.cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub-1.26.0.dist-info/WHEEL ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (83.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
.cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub-1.26.0.dist-info/entry_points.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ [console_scripts]
2
+ hf = huggingface_hub.cli.hf:main
3
+ huggingface-cli = huggingface_hub.cli.deprecated_cli:main
4
+ tiny-agents = huggingface_hub.inference._mcp.cli:app
5
+
6
+ [fsspec.specs]
7
+ hf = huggingface_hub.HfFileSystem
.cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub-1.26.0.dist-info/top_level.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ huggingface_hub
.cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub/errors.py ADDED
@@ -0,0 +1,617 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Contains all custom errors."""
2
+
3
+ from enum import Enum
4
+ from pathlib import Path
5
+
6
+ from httpx import HTTPError, Response
7
+
8
+
9
+ # CACHE ERRORS
10
+
11
+
12
+ class CacheNotFound(Exception):
13
+ """Exception thrown when the Huggingface cache is not found."""
14
+
15
+ cache_dir: str | Path
16
+
17
+ def __init__(self, msg: str, cache_dir: str | Path, *args, **kwargs):
18
+ super().__init__(msg, *args, **kwargs)
19
+ self.cache_dir = cache_dir
20
+
21
+
22
+ class CorruptedCacheException(Exception):
23
+ """Exception for any unexpected structure in the Huggingface cache-system."""
24
+
25
+
26
+ class CachedRepoTreeNotFoundError(Exception):
27
+ """Raised by [`get_cached_repo_tree`] when no tree listing is cached for the requested revision.
28
+
29
+ The tree listing is populated as a side effect of [`snapshot_download`].
30
+ """
31
+
32
+
33
+ # HEADERS ERRORS
34
+
35
+
36
+ class LocalTokenNotFoundError(EnvironmentError):
37
+ """Raised if local token is required but not found."""
38
+
39
+
40
+ # OIDC ERRORS
41
+
42
+
43
+ class OIDCError(Exception):
44
+ """Raised when keyless CI/CD auth via OIDC token exchange ("Trusted Publishers") cannot proceed.
45
+
46
+ Typically because `HF_OIDC_RESOURCE` is set but no id token is available: not running in a
47
+ supported CI provider and `HF_OIDC_ID_TOKEN` is unset.
48
+
49
+ See https://huggingface.co/docs/hub/trusted-publishers.
50
+ """
51
+
52
+
53
+ # DEVICE CODE OAUTH ERRORS
54
+
55
+
56
+ class OAuthErrorCode(str, Enum):
57
+ """Known OAuth `error` codes returned by the Hub's token endpoint (RFC 6749 / RFC 8628)."""
58
+
59
+ AUTHORIZATION_PENDING = "authorization_pending"
60
+ SLOW_DOWN = "slow_down"
61
+ EXPIRED_TOKEN = "expired_token"
62
+ ACCESS_DENIED = "access_denied"
63
+ INVALID_GRANT = "invalid_grant"
64
+
65
+
66
+ class DeviceCodeError(Exception):
67
+ """Raised when the Device Code OAuth login flow (RFC 8628) or an OAuth token refresh fails.
68
+
69
+ Covers failures at any step: requesting the device code, polling for the token,
70
+ authorization denied/expired, or unexpected server responses.
71
+
72
+ Attributes:
73
+ error_code (`str`, *optional*):
74
+ The OAuth `error` code returned by the server, if any. Known values are listed in
75
+ [`OAuthErrorCode`] but the server may return other codes.
76
+ """
77
+
78
+ def __init__(self, message: str, error_code: str | None = None):
79
+ super().__init__(message)
80
+ self.error_code = error_code
81
+
82
+
83
+ # HTTP ERRORS
84
+
85
+
86
+ class OfflineModeIsEnabled(ConnectionError):
87
+ """Raised when a request is made but `HF_HUB_OFFLINE=1` is set as environment variable."""
88
+
89
+
90
+ class HfHubHTTPError(HTTPError, OSError):
91
+ """
92
+ HTTPError to inherit from for any custom HTTP Error raised in HF Hub.
93
+
94
+ Any HTTPError is converted at least into a `HfHubHTTPError`. If some information is
95
+ sent back by the server, it will be added to the error message.
96
+
97
+ Added details:
98
+ - Request ID sourced from headers in order of precedence: "X-Request-Id", "X-Amzn-Trace-Id", "X-Amz-Cf-Id".
99
+ - Server error message from the header "X-Error-Message".
100
+ - Server error message if we can found one in the response body.
101
+
102
+ Example:
103
+ ```py
104
+ import httpx
105
+ from huggingface_hub.utils import get_session, hf_raise_for_status, HfHubHTTPError
106
+
107
+ response = get_session().post(...)
108
+ try:
109
+ hf_raise_for_status(response)
110
+ except HfHubHTTPError as e:
111
+ print(str(e)) # formatted message
112
+ e.request_id, e.server_message # details returned by server
113
+
114
+ # Complete the error message with additional information once it's raised
115
+ e.append_to_message("\n`create_commit` expects the repository to exist.")
116
+ raise
117
+ ```
118
+ """
119
+
120
+ def __init__(
121
+ self,
122
+ message: str,
123
+ *,
124
+ response: Response,
125
+ server_message: str | None = None,
126
+ ):
127
+ self.request_id = (
128
+ response.headers.get("x-request-id")
129
+ or response.headers.get("X-Amzn-Trace-Id")
130
+ or response.headers.get("x-amz-cf-id")
131
+ )
132
+ self.server_message = server_message
133
+ self.response = response
134
+ self.request = response.request
135
+ super().__init__(message)
136
+
137
+ def append_to_message(self, additional_message: str) -> None:
138
+ """Append additional information to the `HfHubHTTPError` initial message."""
139
+ self.args = (self.args[0] + additional_message,) + self.args[1:]
140
+
141
+ @classmethod
142
+ def _reconstruct_hf_hub_http_error(
143
+ cls, message: str, response: Response, server_message: str | None
144
+ ) -> "HfHubHTTPError":
145
+ return cls(message, response=response, server_message=server_message)
146
+
147
+ def __reduce_ex__(self, protocol):
148
+ """Fix pickling of Exception subclass with kwargs. We need to override __reduce_ex__ of the parent class"""
149
+ return (self.__class__._reconstruct_hf_hub_http_error, (str(self), self.response, self.server_message))
150
+
151
+
152
+ # INFERENCE CLIENT ERRORS
153
+
154
+
155
+ class InferenceTimeoutError(HTTPError, TimeoutError):
156
+ """Error raised when a model is unavailable or the request times out."""
157
+
158
+
159
+ # INFERENCE ENDPOINT ERRORS
160
+
161
+
162
+ class InferenceEndpointError(Exception):
163
+ """Generic exception when dealing with Inference Endpoints."""
164
+
165
+
166
+ class InferenceEndpointTimeoutError(InferenceEndpointError, TimeoutError):
167
+ """Exception for timeouts while waiting for Inference Endpoint."""
168
+
169
+
170
+ # SAFETENSORS ERRORS
171
+
172
+
173
+ class SafetensorsParsingError(Exception):
174
+ """Raised when failing to parse a safetensors file metadata.
175
+
176
+ This can be the case if the file is not a safetensors file or does not respect the specification.
177
+ """
178
+
179
+
180
+ class NotASafetensorsRepoError(Exception):
181
+ """Raised when a repo is not a Safetensors repo i.e. doesn't have either a `model.safetensors` or a
182
+ `model.safetensors.index.json` file.
183
+ """
184
+
185
+
186
+ # TEXT GENERATION ERRORS
187
+
188
+
189
+ class TextGenerationError(HTTPError):
190
+ """Generic error raised if text-generation went wrong."""
191
+
192
+
193
+ # Text Generation Inference Errors
194
+ class ValidationError(TextGenerationError):
195
+ """Server-side validation error."""
196
+
197
+
198
+ class GenerationError(TextGenerationError):
199
+ pass
200
+
201
+
202
+ class OverloadedError(TextGenerationError):
203
+ pass
204
+
205
+
206
+ class IncompleteGenerationError(TextGenerationError):
207
+ pass
208
+
209
+
210
+ class UnknownError(TextGenerationError):
211
+ pass
212
+
213
+
214
+ # VALIDATION ERRORS
215
+
216
+
217
+ class HFValidationError(ValueError):
218
+ """Generic exception thrown by `huggingface_hub` validators.
219
+
220
+ Inherits from [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError).
221
+ """
222
+
223
+
224
+ class HfUriError(ValueError):
225
+ """Raised when an `hf://...` URI is malformed.
226
+
227
+ See [`parse_hf_uri`] and the
228
+ [HF URIs reference](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/hf_uris)
229
+ for the canonical syntax.
230
+
231
+ Inherits from [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError).
232
+ """
233
+
234
+ def __init__(self, uri: str, msg: str):
235
+ self.uri = uri
236
+ self.msg = msg
237
+ full_msg = f"Invalid HF URI '{uri}'. {msg}" if uri else f"Invalid HF URI. {msg}"
238
+ super().__init__(full_msg)
239
+
240
+
241
+ # FILE METADATA ERRORS
242
+
243
+
244
+ class DryRunError(OSError):
245
+ """Error triggered when a dry run is requested but cannot be performed (e.g. invalid repo)."""
246
+
247
+
248
+ class FileMetadataError(OSError):
249
+ """Error triggered when the metadata of a file on the Hub cannot be retrieved (missing ETag or commit_hash).
250
+
251
+ Inherits from `OSError` for backward compatibility.
252
+ """
253
+
254
+
255
+ # BUCKET ERRORS
256
+
257
+
258
+ class BucketNotFoundError(HfHubHTTPError):
259
+ """
260
+ Raised when trying to access a bucket that does not exist.
261
+
262
+ Attributes:
263
+ bucket_id (`str` or `None`):
264
+ The bucket id (namespace/name) that was not found, if it could be determined from the request URL.
265
+
266
+ Example:
267
+
268
+ ```py
269
+ >>> from huggingface_hub import bucket_info
270
+ >>> bucket_info("<non_existent_bucket>")
271
+ (...)
272
+ huggingface_hub.errors.BucketNotFoundError: 404 Client Error. (Request ID: XXX)
273
+
274
+ Bucket Not Found for url: https://huggingface.co/api/buckets/namespace/name.
275
+ Please make sure you specified the correct bucket id (namespace/name).
276
+ If the bucket is private, make sure you are authenticated and your token has the required permissions.
277
+ ```
278
+ """
279
+
280
+ bucket_id: str | None = None
281
+
282
+
283
+ # JOB ERRORS
284
+
285
+
286
+ class JobNotFoundError(HfHubHTTPError):
287
+ """
288
+ Raised when trying to access a Job that does not exist.
289
+
290
+ Attributes:
291
+ job_id (`str`):
292
+ The job id that was not found.
293
+ """
294
+
295
+ job_id: str
296
+
297
+
298
+ # REPOSITORY ERRORS
299
+
300
+
301
+ class RepositoryNotFoundError(HfHubHTTPError):
302
+ """
303
+ Raised when trying to access a hf.co URL with an invalid repository name, or
304
+ with a private repo name the user does not have access to.
305
+
306
+ Attributes:
307
+ repo_id (`str` or `None`):
308
+ The repo id that was not found, if it could be determined from the request URL.
309
+ repo_type (`str` or `None`):
310
+ The repo type ("model", "dataset", or "space"), if it could be determined from the request URL.
311
+
312
+ Example:
313
+
314
+ ```py
315
+ >>> from huggingface_hub import model_info
316
+ >>> model_info("<non_existent_repository>")
317
+ (...)
318
+ huggingface_hub.errors.RepositoryNotFoundError: 401 Client Error. (Request ID: PvMw_VjBMjVdMz53WKIzP)
319
+
320
+ Repository Not Found for url: https://huggingface.co/api/models/%3Cnon_existent_repository%3E.
321
+ Please make sure you specified the correct `repo_id` and `repo_type`.
322
+ If the repo is private, make sure you are authenticated and your token has the required permissions.
323
+ Invalid username or password.
324
+ ```
325
+ """
326
+
327
+ repo_id: str | None = None
328
+ repo_type: str | None = None
329
+
330
+
331
+ class GatedRepoError(RepositoryNotFoundError):
332
+ """
333
+ Raised when trying to access a gated repository for which the user is not on the
334
+ authorized list.
335
+
336
+ Note: derives from `RepositoryNotFoundError` to ensure backward compatibility.
337
+
338
+ Example:
339
+
340
+ ```py
341
+ >>> from huggingface_hub import model_info
342
+ >>> model_info("<gated_repository>")
343
+ (...)
344
+ huggingface_hub.errors.GatedRepoError: 403 Client Error. (Request ID: ViT1Bf7O_026LGSQuVqfa)
345
+
346
+ Cannot access gated repo for url https://huggingface.co/api/models/ardent-figment/gated-model.
347
+ Access to model ardent-figment/gated-model is restricted and you are not in the authorized list.
348
+ Visit https://huggingface.co/ardent-figment/gated-model to ask for access.
349
+ ```
350
+ """
351
+
352
+
353
+ class DisabledRepoError(HfHubHTTPError):
354
+ """
355
+ Raised when trying to access a repository that has been disabled by its author.
356
+
357
+ Example:
358
+
359
+ ```py
360
+ >>> from huggingface_hub import dataset_info
361
+ >>> dataset_info("laion/laion-art")
362
+ (...)
363
+ huggingface_hub.errors.DisabledRepoError: 403 Client Error. (Request ID: Root=1-659fc3fa-3031673e0f92c71a2260dbe2;bc6f4dfb-b30a-4862-af0a-5cfe827610d8)
364
+
365
+ Cannot access repository for url https://huggingface.co/api/datasets/laion/laion-art.
366
+ Access to this resource is disabled.
367
+ ```
368
+ """
369
+
370
+
371
+ # REVISION ERROR
372
+
373
+
374
+ class RevisionNotFoundError(HfHubHTTPError):
375
+ """
376
+ Raised when trying to access a hf.co URL with a valid repository but an invalid
377
+ revision.
378
+
379
+ Attributes:
380
+ repo_id (`str` or `None`):
381
+ The repo id, if it could be determined from the request URL.
382
+ repo_type (`str` or `None`):
383
+ The repo type ("model", "dataset", or "space"), if it could be determined from the request URL.
384
+
385
+ Example:
386
+
387
+ ```py
388
+ >>> from huggingface_hub import hf_hub_download
389
+ >>> hf_hub_download('bert-base-cased', 'config.json', revision='<non-existent-revision>')
390
+ (...)
391
+ huggingface_hub.errors.RevisionNotFoundError: 404 Client Error. (Request ID: Mwhe_c3Kt650GcdKEFomX)
392
+
393
+ Revision Not Found for url: https://huggingface.co/bert-base-cased/resolve/%3Cnon-existent-revision%3E/config.json.
394
+ ```
395
+ """
396
+
397
+ repo_id: str | None = None
398
+ repo_type: str | None = None
399
+
400
+
401
+ class RevisionResolutionError(Exception):
402
+ """
403
+ Raised by [`HfApi.resolve_revision`] when a revision cannot be resolved to a commit hash: the Hub could not be
404
+ reached (offline mode, connection error, timeout, Hub downtime, ...) and no matching entry was found in the
405
+ local cache.
406
+ """
407
+
408
+
409
+ # ENTRY ERRORS
410
+ class EntryNotFoundError(Exception):
411
+ """
412
+ Raised when entry not found, either locally or remotely.
413
+
414
+ Example:
415
+
416
+ ```py
417
+ >>> from huggingface_hub import hf_hub_download
418
+ >>> hf_hub_download('bert-base-cased', '<non-existent-file>')
419
+ (...)
420
+ huggingface_hub.errors.RemoteEntryNotFoundError (...)
421
+ >>> hf_hub_download('bert-base-cased', '<non-existent-file>', local_files_only=True)
422
+ (...)
423
+ huggingface_hub.utils.errors.LocalEntryNotFoundError (...)
424
+ ```
425
+ """
426
+
427
+
428
+ class RemoteEntryNotFoundError(HfHubHTTPError, EntryNotFoundError):
429
+ """
430
+ Raised when trying to access a hf.co URL with a valid repository and revision
431
+ but an invalid filename.
432
+
433
+ Attributes:
434
+ repo_id (`str` or `None`):
435
+ The repo id, if it could be determined from the request URL.
436
+ repo_type (`str` or `None`):
437
+ The repo type ("model", "dataset", or "space"), if it could be determined from the request URL.
438
+
439
+ Example:
440
+
441
+ ```py
442
+ >>> from huggingface_hub import hf_hub_download
443
+ >>> hf_hub_download('bert-base-cased', '<non-existent-file>')
444
+ (...)
445
+ huggingface_hub.errors.EntryNotFoundError: 404 Client Error. (Request ID: 53pNl6M0MxsnG5Sw8JA6x)
446
+
447
+ Entry Not Found for url: https://huggingface.co/bert-base-cased/resolve/main/%3Cnon-existent-file%3E.
448
+ ```
449
+ """
450
+
451
+ repo_id: str | None = None
452
+ repo_type: str | None = None
453
+
454
+
455
+ class LocalEntryNotFoundError(FileNotFoundError, EntryNotFoundError):
456
+ """
457
+ Raised when trying to access a file or snapshot that is not on the disk when network is
458
+ disabled or unavailable (connection issue). The entry may exist on the Hub.
459
+
460
+ Example:
461
+
462
+ ```py
463
+ >>> from huggingface_hub import hf_hub_download
464
+ >>> hf_hub_download('bert-base-cased', '<non-cached-file>', local_files_only=True)
465
+ (...)
466
+ huggingface_hub.errors.LocalEntryNotFoundError: Cannot find the requested files in the disk cache and outgoing traffic has been disabled. To enable hf.co look-ups and downloads online, set 'local_files_only' to False.
467
+ ```
468
+ """
469
+
470
+ def __init__(self, message: str):
471
+ super().__init__(message)
472
+
473
+
474
+ class IncompleteSnapshotError(LocalEntryNotFoundError):
475
+ """
476
+ Raised by [`snapshot_download`] when the Hub cannot be reached (offline, connection issue, or
477
+ `local_files_only=True`) and the cached snapshot is known to be incomplete: some files listed in
478
+ the repository's cached tree listing are missing from the local snapshot.
479
+
480
+ This is a subclass of [`LocalEntryNotFoundError`] for backward compatibility.
481
+
482
+ The `snapshot_path` attribute holds the path to the incomplete local snapshot, so a downstream library can locate
483
+ the latest cached files even though they are known to be incomplete.
484
+ """
485
+
486
+ def __init__(self, message: str, snapshot_path: str):
487
+ super().__init__(message)
488
+ self.snapshot_path = snapshot_path
489
+
490
+
491
+ # REQUEST ERROR
492
+ class BadRequestError(HfHubHTTPError, ValueError):
493
+ """
494
+ Raised by `hf_raise_for_status` when the server returns a HTTP 400 error.
495
+
496
+ Example:
497
+
498
+ ```py
499
+ >>> resp = httpx.post("hf.co/api/check", ...)
500
+ >>> hf_raise_for_status(resp, endpoint_name="check")
501
+ huggingface_hub.errors.BadRequestError: Bad request for check endpoint: {details} (Request ID: XXX)
502
+ ```
503
+ """
504
+
505
+
506
+ # DDUF file format ERROR
507
+
508
+
509
+ class DDUFError(Exception):
510
+ """Base exception for errors related to the DDUF format."""
511
+
512
+
513
+ class DDUFCorruptedFileError(DDUFError):
514
+ """Exception thrown when the DDUF file is corrupted."""
515
+
516
+
517
+ class DDUFExportError(DDUFError):
518
+ """Base exception for errors during DDUF export."""
519
+
520
+
521
+ class DDUFInvalidEntryNameError(DDUFExportError):
522
+ """Exception thrown when the entry name is invalid."""
523
+
524
+
525
+ # STRICT DATACLASSES ERRORS
526
+
527
+
528
+ class StrictDataclassError(Exception):
529
+ """Base exception for strict dataclasses."""
530
+
531
+
532
+ class StrictDataclassDefinitionError(StrictDataclassError):
533
+ """Exception thrown when a strict dataclass is defined incorrectly."""
534
+
535
+
536
+ class StrictDataclassFieldValidationError(StrictDataclassError):
537
+ """Exception thrown when a strict dataclass fails validation for a given field."""
538
+
539
+ def __init__(self, field: str, cause: Exception):
540
+ error_message = f"Validation error for field '{field}':"
541
+ error_message += f"\n {cause.__class__.__name__}: {cause}"
542
+ super().__init__(error_message)
543
+
544
+
545
+ class StrictDataclassClassValidationError(StrictDataclassError):
546
+ """Exception thrown when a strict dataclass fails validation on a class validator."""
547
+
548
+ def __init__(self, validator: str, cause: Exception):
549
+ error_message = f"Class validation error for validator '{validator}':"
550
+ error_message += f"\n {cause.__class__.__name__}: {cause}"
551
+ super().__init__(error_message)
552
+
553
+
554
+ # XET ERRORS
555
+
556
+
557
+ class XetDownloadError(Exception):
558
+ """Exception thrown when the download from Xet Storage fails."""
559
+
560
+
561
+ # LFS ERRORS
562
+
563
+
564
+ class FileDuplicationError(Exception):
565
+ """Raised when duplicating files across repos fails."""
566
+
567
+
568
+ # CLI ERRORS
569
+
570
+
571
+ class CLIError(Exception):
572
+ """CLI error with clean message (no traceback by default)."""
573
+
574
+
575
+ class ConfirmationError(CLIError):
576
+ """Raised when a confirmation prompt is declined (non-interactive mode)."""
577
+
578
+
579
+ class CLIExtensionInstallError(CLIError):
580
+ """Error during CLI extension installation."""
581
+
582
+
583
+ # SANDBOX ERRORS
584
+
585
+
586
+ class SandboxError(Exception):
587
+ """Base exception for sandbox operations (see `huggingface_hub.Sandbox`).
588
+
589
+ Attributes:
590
+ status_code: The HTTP status returned by the in-sandbox server, if the error
591
+ originated from an API response (e.g. `404` for a missing file). `None` otherwise.
592
+ """
593
+
594
+ def __init__(self, message: str, *, status_code: int | None = None) -> None:
595
+ super().__init__(message)
596
+ self.status_code = status_code
597
+
598
+
599
+ class SandboxCommandError(SandboxError):
600
+ """Raised when a command run in a sandbox exits with a non-zero code.
601
+
602
+ Attributes:
603
+ cmd: The command that failed.
604
+ result: The full `SandboxCommandResult` (exit_code, stdout, stderr, ...).
605
+ """
606
+
607
+ def __init__(self, cmd, result) -> None:
608
+ self.cmd = cmd
609
+ self.result = result
610
+ stderr_tail = result.stderr[-1000:] if result.stderr else "<empty>"
611
+ if result.timed_out:
612
+ reason = "timed out"
613
+ elif result.signal is not None:
614
+ reason = f"was killed by signal {result.signal}"
615
+ else:
616
+ reason = f"exited with code {result.exit_code}"
617
+ super().__init__(f"Command {cmd!r} {reason}. stderr:\n{stderr_tail}")
.cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub/fastai_utils.py ADDED
@@ -0,0 +1,414 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+ from pathlib import Path
4
+ from pickle import DEFAULT_PROTOCOL, PicklingError
5
+ from typing import Any
6
+
7
+ from packaging import version
8
+
9
+ from huggingface_hub import constants, snapshot_download
10
+ from huggingface_hub.hf_api import HfApi
11
+ from huggingface_hub.utils import (
12
+ SoftTemporaryDirectory,
13
+ get_fastai_version,
14
+ get_fastcore_version,
15
+ get_python_version,
16
+ )
17
+
18
+ from .utils import logging, validate_hf_hub_args
19
+
20
+
21
+ logger = logging.get_logger(__name__)
22
+
23
+
24
+ def _check_fastai_fastcore_versions(
25
+ fastai_min_version: str = "2.4",
26
+ fastcore_min_version: str = "1.3.27",
27
+ ):
28
+ """
29
+ Checks that the installed fastai and fastcore versions are compatible for pickle serialization.
30
+
31
+ Args:
32
+ fastai_min_version (`str`, *optional*):
33
+ The minimum fastai version supported.
34
+ fastcore_min_version (`str`, *optional*):
35
+ The minimum fastcore version supported.
36
+
37
+ > [!TIP]
38
+ > Raises the following error:
39
+ >
40
+ > - [`ImportError`](https://docs.python.org/3/library/exceptions.html#ImportError)
41
+ > if the fastai or fastcore libraries are not available or are of an invalid version.
42
+ """
43
+
44
+ if (get_fastcore_version() or get_fastai_version()) == "N/A":
45
+ raise ImportError(
46
+ f"fastai>={fastai_min_version} and fastcore>={fastcore_min_version} are"
47
+ f" required. Currently using fastai=={get_fastai_version()} and"
48
+ f" fastcore=={get_fastcore_version()}."
49
+ )
50
+
51
+ current_fastai_version = version.Version(get_fastai_version())
52
+ current_fastcore_version = version.Version(get_fastcore_version())
53
+
54
+ if current_fastai_version < version.Version(fastai_min_version):
55
+ raise ImportError(
56
+ "`push_to_hub_fastai` and `from_pretrained_fastai` require a"
57
+ f" fastai>={fastai_min_version} version, but you are using fastai version"
58
+ f" {get_fastai_version()} which is incompatible. Upgrade with `pip install"
59
+ " fastai==2.5.6`."
60
+ )
61
+
62
+ if current_fastcore_version < version.Version(fastcore_min_version):
63
+ raise ImportError(
64
+ "`push_to_hub_fastai` and `from_pretrained_fastai` require a"
65
+ f" fastcore>={fastcore_min_version} version, but you are using fastcore"
66
+ f" version {get_fastcore_version()} which is incompatible. Upgrade with"
67
+ " `pip install fastcore==1.3.27`."
68
+ )
69
+
70
+
71
+ def _check_fastai_fastcore_pyproject_versions(
72
+ storage_folder: str,
73
+ fastai_min_version: str = "2.4",
74
+ fastcore_min_version: str = "1.3.27",
75
+ ):
76
+ """
77
+ Checks that the `pyproject.toml` file in the directory `storage_folder` has fastai and fastcore versions
78
+ that are compatible with `from_pretrained_fastai` and `push_to_hub_fastai`. If `pyproject.toml` does not exist
79
+ or does not contain versions for fastai and fastcore, then it logs a warning.
80
+
81
+ Args:
82
+ storage_folder (`str`):
83
+ Folder to look for the `pyproject.toml` file.
84
+ fastai_min_version (`str`, *optional*):
85
+ The minimum fastai version supported.
86
+ fastcore_min_version (`str`, *optional*):
87
+ The minimum fastcore version supported.
88
+
89
+ > [!TIP]
90
+ > Raises the following errors:
91
+ >
92
+ > - [`ImportError`](https://docs.python.org/3/library/exceptions.html#ImportError)
93
+ > if the `toml` module is not installed.
94
+ > - [`ImportError`](https://docs.python.org/3/library/exceptions.html#ImportError)
95
+ > if the `pyproject.toml` indicates a lower than minimum supported version of fastai or fastcore.
96
+ """
97
+
98
+ try:
99
+ import toml
100
+ except ModuleNotFoundError:
101
+ raise ImportError(
102
+ "`push_to_hub_fastai` and `from_pretrained_fastai` require the toml module."
103
+ " Install it with `pip install toml`."
104
+ )
105
+
106
+ # Checks that a `pyproject.toml`, with `build-system` and `requires` sections, exists in the repository. If so, get a list of required packages.
107
+ if not os.path.isfile(f"{storage_folder}/pyproject.toml"):
108
+ logger.warning(
109
+ "There is no `pyproject.toml` in the repository that contains the fastai"
110
+ " `Learner`. The `pyproject.toml` would allow us to verify that your fastai"
111
+ " and fastcore versions are compatible with those of the model you want to"
112
+ " load."
113
+ )
114
+ return
115
+ pyproject_toml = toml.load(f"{storage_folder}/pyproject.toml")
116
+
117
+ if "build-system" not in pyproject_toml.keys():
118
+ logger.warning(
119
+ "There is no `build-system` section in the pyproject.toml of the repository"
120
+ " that contains the fastai `Learner`. The `build-system` would allow us to"
121
+ " verify that your fastai and fastcore versions are compatible with those"
122
+ " of the model you want to load."
123
+ )
124
+ return
125
+ build_system_toml = pyproject_toml["build-system"]
126
+
127
+ if "requires" not in build_system_toml.keys():
128
+ logger.warning(
129
+ "There is no `requires` section in the pyproject.toml of the repository"
130
+ " that contains the fastai `Learner`. The `requires` would allow us to"
131
+ " verify that your fastai and fastcore versions are compatible with those"
132
+ " of the model you want to load."
133
+ )
134
+ return
135
+ package_versions = build_system_toml["requires"]
136
+
137
+ # Extracts contains fastai and fastcore versions from `pyproject.toml` if available.
138
+ # If the package is specified but not the version (e.g. "fastai" instead of "fastai=2.4"), the default versions are the highest.
139
+ fastai_packages = [pck for pck in package_versions if pck.startswith("fastai")]
140
+ if len(fastai_packages) == 0:
141
+ logger.warning("The repository does not have a fastai version specified in the `pyproject.toml`.")
142
+ # fastai_version is an empty string if not specified
143
+ else:
144
+ fastai_version = str(fastai_packages[0]).partition("=")[2]
145
+ if fastai_version != "" and version.Version(fastai_version) < version.Version(fastai_min_version):
146
+ raise ImportError(
147
+ "`from_pretrained_fastai` requires"
148
+ f" fastai>={fastai_min_version} version but the model to load uses"
149
+ f" {fastai_version} which is incompatible."
150
+ )
151
+
152
+ fastcore_packages = [pck for pck in package_versions if pck.startswith("fastcore")]
153
+ if len(fastcore_packages) == 0:
154
+ logger.warning("The repository does not have a fastcore version specified in the `pyproject.toml`.")
155
+ # fastcore_version is an empty string if not specified
156
+ else:
157
+ fastcore_version = str(fastcore_packages[0]).partition("=")[2]
158
+ if fastcore_version != "" and version.Version(fastcore_version) < version.Version(fastcore_min_version):
159
+ raise ImportError(
160
+ "`from_pretrained_fastai` requires"
161
+ f" fastcore>={fastcore_min_version} version, but you are using fastcore"
162
+ f" version {fastcore_version} which is incompatible."
163
+ )
164
+
165
+
166
+ README_TEMPLATE = """---
167
+ tags:
168
+ - fastai
169
+ ---
170
+
171
+ # Amazing!
172
+
173
+ 🥳 Congratulations on hosting your fastai model on the Hugging Face Hub!
174
+
175
+ # Some next steps
176
+ 1. Fill out this model card with more information (see the template below and the [documentation here](https://huggingface.co/docs/hub/model-repos))!
177
+
178
+ 2. Create a demo in Gradio or Streamlit using 🤗 Spaces ([documentation here](https://huggingface.co/docs/hub/spaces)).
179
+
180
+ 3. Join the fastai community on the [Fastai Discord](https://discord.com/invite/YKrxeNn)!
181
+
182
+ Greetings fellow fastlearner 🤝! Don't forget to delete this content from your model card.
183
+
184
+
185
+ ---
186
+
187
+
188
+ # Model card
189
+
190
+ ## Model description
191
+ More information needed
192
+
193
+ ## Intended uses & limitations
194
+ More information needed
195
+
196
+ ## Training and evaluation data
197
+ More information needed
198
+ """
199
+
200
+ PYPROJECT_TEMPLATE = f"""[build-system]
201
+ requires = ["setuptools>=40.8.0", "wheel", "python={get_python_version()}", "fastai={get_fastai_version()}", "fastcore={get_fastcore_version()}"]
202
+ build-backend = "setuptools.build_meta:__legacy__"
203
+ """
204
+
205
+
206
+ def _create_model_card(repo_dir: Path):
207
+ """
208
+ Creates a model card for the repository.
209
+
210
+ Args:
211
+ repo_dir (`Path`):
212
+ Directory where model card is created.
213
+ """
214
+ readme_path = repo_dir / "README.md"
215
+
216
+ if not readme_path.exists():
217
+ with readme_path.open("w", encoding="utf-8") as f:
218
+ f.write(README_TEMPLATE)
219
+
220
+
221
+ def _create_model_pyproject(repo_dir: Path):
222
+ """
223
+ Creates a `pyproject.toml` for the repository.
224
+
225
+ Args:
226
+ repo_dir (`Path`):
227
+ Directory where `pyproject.toml` is created.
228
+ """
229
+ pyproject_path = repo_dir / "pyproject.toml"
230
+
231
+ if not pyproject_path.exists():
232
+ with pyproject_path.open("w", encoding="utf-8") as f:
233
+ f.write(PYPROJECT_TEMPLATE)
234
+
235
+
236
+ def _save_pretrained_fastai(
237
+ learner,
238
+ save_directory: str | Path,
239
+ config: dict[str, Any] | None = None,
240
+ ):
241
+ """
242
+ Saves a fastai learner to `save_directory` in pickle format using the default pickle protocol for the version of python used.
243
+
244
+ Args:
245
+ learner (`Learner`):
246
+ The `fastai.Learner` you'd like to save.
247
+ save_directory (`str` or `Path`):
248
+ Specific directory in which you want to save the fastai learner.
249
+ config (`dict`, *optional*):
250
+ Configuration object. Will be uploaded as a .json file. Example: 'https://huggingface.co/espejelomar/fastai-pet-breeds-classification/blob/main/config.json'.
251
+
252
+ > [!TIP]
253
+ > Raises the following error:
254
+ >
255
+ > - [`RuntimeError`](https://docs.python.org/3/library/exceptions.html#RuntimeError)
256
+ > if the config file provided is not a dictionary.
257
+ """
258
+ _check_fastai_fastcore_versions()
259
+
260
+ os.makedirs(save_directory, exist_ok=True)
261
+
262
+ # if the user provides config then we update it with the fastai and fastcore versions in CONFIG_TEMPLATE.
263
+ if config is not None:
264
+ if not isinstance(config, dict):
265
+ raise RuntimeError(f"Provided config should be a dict. Got: '{type(config)}'")
266
+ path = os.path.join(save_directory, constants.CONFIG_NAME)
267
+ with open(path, "w") as f:
268
+ json.dump(config, f)
269
+
270
+ _create_model_card(Path(save_directory))
271
+ _create_model_pyproject(Path(save_directory))
272
+
273
+ # learner.export saves the model in `self.path`.
274
+ learner.path = Path(save_directory)
275
+ os.makedirs(save_directory, exist_ok=True)
276
+ try:
277
+ learner.export(
278
+ fname="model.pkl",
279
+ pickle_protocol=DEFAULT_PROTOCOL,
280
+ )
281
+ except PicklingError:
282
+ raise PicklingError(
283
+ "You are using a lambda function, i.e., an anonymous function. `pickle`"
284
+ " cannot pickle function objects and requires that all functions have"
285
+ " names. One possible solution is to name the function."
286
+ )
287
+
288
+
289
+ @validate_hf_hub_args
290
+ def from_pretrained_fastai(
291
+ repo_id: str,
292
+ revision: str | None = None,
293
+ ):
294
+ """
295
+ Load pretrained fastai model from the Hub or from a local directory.
296
+
297
+ Args:
298
+ repo_id (`str`):
299
+ The location where the pickled fastai.Learner is. It can be either of the two:
300
+ - Hosted on the Hugging Face Hub. E.g.: 'espejelomar/fatai-pet-breeds-classification' or 'distilgpt2'.
301
+ You can add a `revision` by appending `@` at the end of `repo_id`. E.g.: `dbmdz/bert-base-german-cased@main`.
302
+ Revision is the specific model version to use. Since we use a git-based system for storing models and other
303
+ artifacts on the Hugging Face Hub, it can be a branch name, a tag name, or a commit id.
304
+ - Hosted locally. `repo_id` would be a directory containing the pickle and a pyproject.toml
305
+ indicating the fastai and fastcore versions used to build the `fastai.Learner`. E.g.: `./my_model_directory/`.
306
+ revision (`str`, *optional*):
307
+ Revision at which the repo's files are downloaded. See documentation of `snapshot_download`.
308
+
309
+ Returns:
310
+ The `fastai.Learner` model in the `repo_id` repo.
311
+ """
312
+ _check_fastai_fastcore_versions()
313
+
314
+ # Load the `repo_id` repo.
315
+ # `snapshot_download` returns the folder where the model was stored.
316
+ # `cache_dir` will be the default '/root/.cache/huggingface/hub'
317
+ if not os.path.isdir(repo_id):
318
+ storage_folder = snapshot_download(
319
+ repo_id=repo_id,
320
+ revision=revision,
321
+ library_name="fastai",
322
+ library_version=get_fastai_version(),
323
+ )
324
+ else:
325
+ storage_folder = repo_id
326
+
327
+ _check_fastai_fastcore_pyproject_versions(storage_folder)
328
+
329
+ from fastai.learner import load_learner # type: ignore
330
+
331
+ return load_learner(os.path.join(storage_folder, "model.pkl"))
332
+
333
+
334
+ @validate_hf_hub_args
335
+ def push_to_hub_fastai(
336
+ learner,
337
+ *,
338
+ repo_id: str,
339
+ commit_message: str = "Push FastAI model using huggingface_hub.",
340
+ private: bool | None = None,
341
+ token: str | None = None,
342
+ config: dict | None = None,
343
+ branch: str | None = None,
344
+ create_pr: bool | None = None,
345
+ allow_patterns: list[str] | str | None = None,
346
+ ignore_patterns: list[str] | str | None = None,
347
+ delete_patterns: list[str] | str | None = None,
348
+ api_endpoint: str | None = None,
349
+ ):
350
+ """
351
+ Upload learner checkpoint files to the Hub.
352
+
353
+ Use `allow_patterns` and `ignore_patterns` to precisely filter which files should be pushed to the hub. Use
354
+ `delete_patterns` to delete existing remote files in the same commit. See [`upload_folder`] reference for more
355
+ details.
356
+
357
+ Args:
358
+ learner (`Learner`):
359
+ The `fastai.Learner' you'd like to push to the Hub.
360
+ repo_id (`str`):
361
+ The repository id for your model in Hub in the format of "namespace/repo_name". The namespace can be your individual account or an organization to which you have write access (for example, 'stanfordnlp/stanza-de').
362
+ commit_message (`str`, *optional*):
363
+ Message to commit while pushing. Will default to :obj:`"add model"`.
364
+ private (`bool`, *optional*):
365
+ Whether or not the repository created should be private.
366
+ If `None` (default), will default to been public except if the organization's default is private.
367
+ token (`str`, *optional*):
368
+ The Hugging Face account token to use as HTTP bearer authorization for remote files. If :obj:`None`, the token will be asked by a prompt.
369
+ config (`dict`, *optional*):
370
+ Configuration object to be saved alongside the model weights.
371
+ branch (`str`, *optional*):
372
+ The git branch on which to push the model. This defaults to
373
+ the default branch as specified in your repository, which
374
+ defaults to `"main"`.
375
+ create_pr (`boolean`, *optional*):
376
+ Whether or not to create a Pull Request from `branch` with that commit.
377
+ Defaults to `False`.
378
+ api_endpoint (`str`, *optional*):
379
+ The API endpoint to use when pushing the model to the hub.
380
+ allow_patterns (`list[str]` or `str`, *optional*):
381
+ If provided, only files matching at least one pattern are pushed.
382
+ ignore_patterns (`list[str]` or `str`, *optional*):
383
+ If provided, files matching any of the patterns are not pushed.
384
+ delete_patterns (`list[str]` or `str`, *optional*):
385
+ If provided, remote files matching any of the patterns will be deleted from the repo.
386
+
387
+ Returns:
388
+ The url of the commit of your model in the given repository.
389
+
390
+ > [!TIP]
391
+ > Raises the following error:
392
+ >
393
+ > - [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
394
+ > if the user is not log on to the Hugging Face Hub.
395
+ """
396
+ _check_fastai_fastcore_versions()
397
+ api = HfApi(endpoint=api_endpoint)
398
+ repo_id = api.create_repo(repo_id=repo_id, token=token, private=private, exist_ok=True).repo_id
399
+
400
+ # Push the files to the repo in a single commit
401
+ with SoftTemporaryDirectory() as tmp:
402
+ saved_path = Path(tmp) / repo_id
403
+ _save_pretrained_fastai(learner, saved_path, config=config)
404
+ return api.upload_folder(
405
+ repo_id=repo_id,
406
+ token=token,
407
+ folder_path=saved_path,
408
+ commit_message=commit_message,
409
+ revision=branch,
410
+ create_pr=create_pr,
411
+ allow_patterns=allow_patterns,
412
+ ignore_patterns=ignore_patterns,
413
+ delete_patterns=delete_patterns,
414
+ )
.cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub/hf_api.py ADDED
The diff for this file is too large to render. See raw diff
 
.cache/uv/archive-v0/YbGpm6nADP0vFoZFy8BvB/huggingface_hub/hub_mixin.py ADDED
@@ -0,0 +1,834 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import inspect
2
+ import json
3
+ import os
4
+ from collections.abc import Callable
5
+ from dataclasses import Field, asdict, dataclass, is_dataclass
6
+ from pathlib import Path
7
+ from typing import Any, ClassVar, Protocol, TypeVar
8
+
9
+ import packaging.version
10
+
11
+ from . import constants
12
+ from .errors import EntryNotFoundError, HfHubHTTPError
13
+ from .file_download import hf_hub_download
14
+ from .hf_api import HfApi
15
+ from .repocard import ModelCard, ModelCardData
16
+ from .utils import (
17
+ SoftTemporaryDirectory,
18
+ is_jsonable,
19
+ is_safetensors_available,
20
+ is_simple_optional_type,
21
+ is_torch_available,
22
+ logging,
23
+ unwrap_simple_optional_type,
24
+ validate_hf_hub_args,
25
+ )
26
+
27
+
28
+ if is_torch_available():
29
+ import torch # type: ignore
30
+
31
+ if is_safetensors_available():
32
+ import safetensors
33
+ from safetensors.torch import load_model as load_model_as_safetensor
34
+ from safetensors.torch import save_model as save_model_as_safetensor
35
+
36
+
37
+ logger = logging.get_logger(__name__)
38
+
39
+
40
+ # Type alias for dataclass instances, copied from https://github.com/python/typeshed/blob/9f28171658b9ca6c32a7cb93fbb99fc92b17858b/stdlib/_typeshed/__init__.pyi#L349
41
+ class DataclassInstance(Protocol):
42
+ __dataclass_fields__: ClassVar[dict[str, Field]]
43
+
44
+
45
+ # Generic variable that is either ModelHubMixin or a subclass thereof
46
+ T = TypeVar("T", bound="ModelHubMixin")
47
+ # Generic variable to represent an args type
48
+ ARGS_T = TypeVar("ARGS_T")
49
+ ENCODER_T = Callable[[ARGS_T], Any]
50
+ DECODER_T = Callable[[Any], ARGS_T]
51
+ CODER_T = tuple[ENCODER_T, DECODER_T]
52
+
53
+
54
+ DEFAULT_MODEL_CARD = """
55
+ ---
56
+ # For reference on model card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1
57
+ # Doc / guide: https://huggingface.co/docs/hub/model-cards
58
+ {{ card_data }}
59
+ ---
60
+
61
+ This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
62
+ - Code: {{ repo_url | default("[More Information Needed]", true) }}
63
+ - Paper: {{ paper_url | default("[More Information Needed]", true) }}
64
+ - Docs: {{ docs_url | default("[More Information Needed]", true) }}
65
+ """
66
+
67
+
68
+ @dataclass
69
+ class MixinInfo:
70
+ model_card_template: str
71
+ model_card_data: ModelCardData
72
+ docs_url: str | None = None
73
+ paper_url: str | None = None
74
+ repo_url: str | None = None
75
+
76
+
77
+ class ModelHubMixin:
78
+ """
79
+ A generic mixin to integrate ANY machine learning framework with the Hub.
80
+
81
+ To integrate your framework, your model class must inherit from this class. Custom logic for saving/loading models
82
+ have to be overwritten in [`_from_pretrained`] and [`_save_pretrained`]. [`PyTorchModelHubMixin`] is a good example
83
+ of mixin integration with the Hub. Check out our [integration guide](../guides/integrations) for more instructions.
84
+
85
+ When inheriting from [`ModelHubMixin`], you can define class-level attributes. These attributes are not passed to
86
+ `__init__` but to the class definition itself. This is useful to define metadata about the library integrating
87
+ [`ModelHubMixin`].
88
+
89
+ For more details on how to integrate the mixin with your library, checkout the [integration guide](../guides/integrations).
90
+
91
+ Args:
92
+ repo_url (`str`, *optional*):
93
+ URL of the library repository. Used to generate model card.
94
+ paper_url (`str`, *optional*):
95
+ URL of the library paper. Used to generate model card.
96
+ docs_url (`str`, *optional*):
97
+ URL of the library documentation. Used to generate model card.
98
+ model_card_template (`str`, *optional*):
99
+ Template of the model card. Used to generate model card. Defaults to a generic template.
100
+ language (`str` or `list[str]`, *optional*):
101
+ Language supported by the library. Used to generate model card.
102
+ library_name (`str`, *optional*):
103
+ Name of the library integrating ModelHubMixin. Used to generate model card.
104
+ license (`str`, *optional*):
105
+ License of the library integrating ModelHubMixin. Used to generate model card.
106
+ E.g: "apache-2.0"
107
+ license_name (`str`, *optional*):
108
+ Name of the library integrating ModelHubMixin. Used to generate model card.
109
+ Only used if `license` is set to `other`.
110
+ E.g: "coqui-public-model-license".
111
+ license_link (`str`, *optional*):
112
+ URL to the license of the library integrating ModelHubMixin. Used to generate model card.
113
+ Only used if `license` is set to `other` and `license_name` is set.
114
+ E.g: "https://coqui.ai/cpml".
115
+ pipeline_tag (`str`, *optional*):
116
+ Tag of the pipeline. Used to generate model card. E.g. "text-classification".
117
+ tags (`list[str]`, *optional*):
118
+ Tags to be added to the model card. Used to generate model card. E.g. ["computer-vision"]
119
+ coders (`dict[Type, tuple[Callable, Callable]]`, *optional*):
120
+ Dictionary of custom types and their encoders/decoders. Used to encode/decode arguments that are not
121
+ jsonable by default. E.g. dataclasses, argparse.Namespace, OmegaConf, etc.
122
+
123
+ Example:
124
+
125
+ ```python
126
+ >>> from huggingface_hub import ModelHubMixin
127
+
128
+ # Inherit from ModelHubMixin
129
+ >>> class MyCustomModel(
130
+ ... ModelHubMixin,
131
+ ... library_name="my-library",
132
+ ... tags=["computer-vision"],
133
+ ... repo_url="https://github.com/huggingface/my-cool-library",
134
+ ... paper_url="https://arxiv.org/abs/2304.12244",
135
+ ... docs_url="https://huggingface.co/docs/my-cool-library",
136
+ ... # ^ optional metadata to generate model card
137
+ ... ):
138
+ ... def __init__(self, size: int = 512, device: str = "cpu"):
139
+ ... # define how to initialize your model
140
+ ... super().__init__()
141
+ ... ...
142
+ ...
143
+ ... def _save_pretrained(self, save_directory: Path) -> None:
144
+ ... # define how to serialize your model
145
+ ... ...
146
+ ...
147
+ ... @classmethod
148
+ ... def from_pretrained(
149
+ ... cls: type[T],
150
+ ... pretrained_model_name_or_path: Union[str, Path],
151
+ ... *,
152
+ ... force_download: bool = False,
153
+ ... token: Optional[Union[str, bool]] = None,
154
+ ... cache_dir: Optional[Union[str, Path]] = None,
155
+ ... local_files_only: bool = False,
156
+ ... revision: Optional[str] = None,
157
+ ... **model_kwargs,
158
+ ... ) -> T:
159
+ ... # define how to deserialize your model
160
+ ... ...
161
+
162
+ >>> model = MyCustomModel(size=256, device="gpu")
163
+
164
+ # Save model weights to local directory
165
+ >>> model.save_pretrained("my-awesome-model")
166
+
167
+ # Push model weights to the Hub
168
+ >>> model.push_to_hub("my-awesome-model")
169
+
170
+ # Download and initialize weights from the Hub
171
+ >>> reloaded_model = MyCustomModel.from_pretrained("username/my-awesome-model")
172
+ >>> reloaded_model.size
173
+ 256
174
+
175
+ # Model card has been correctly populated
176
+ >>> from huggingface_hub import ModelCard
177
+ >>> card = ModelCard.load("username/my-awesome-model")
178
+ >>> card.data.tags
179
+ ["x-custom-tag", "pytorch_model_hub_mixin", "model_hub_mixin"]
180
+ >>> card.data.library_name
181
+ "my-library"
182
+ ```
183
+ """
184
+
185
+ _hub_mixin_config: dict | DataclassInstance | None = None
186
+ # ^ optional config attribute automatically set in `from_pretrained`
187
+ _hub_mixin_info: MixinInfo
188
+ # ^ information about the library integrating ModelHubMixin (used to generate model card)
189
+ _hub_mixin_inject_config: bool # whether `_from_pretrained` expects `config` or not
190
+ _hub_mixin_init_parameters: dict[str, inspect.Parameter] # __init__ parameters
191
+ _hub_mixin_jsonable_default_values: dict[str, Any] # default values for __init__ parameters
192
+ _hub_mixin_jsonable_custom_types: tuple[type, ...] # custom types that can be encoded/decoded
193
+ _hub_mixin_coders: dict[type, CODER_T] # encoders/decoders for custom types
194
+ # ^ internal values to handle config
195
+
196
+ def __init_subclass__(
197
+ cls,
198
+ *,
199
+ # Generic info for model card
200
+ repo_url: str | None = None,
201
+ paper_url: str | None = None,
202
+ docs_url: str | None = None,
203
+ # Model card template
204
+ model_card_template: str = DEFAULT_MODEL_CARD,
205
+ # Model card metadata
206
+ language: list[str] | None = None,
207
+ library_name: str | None = None,
208
+ license: str | None = None,
209
+ license_name: str | None = None,
210
+ license_link: str | None = None,
211
+ pipeline_tag: str | None = None,
212
+ tags: list[str] | None = None,
213
+ # How to encode/decode arguments with custom type into a JSON config?
214
+ coders: None
215
+ | (
216
+ dict[type, CODER_T]
217
+ # Key is a type.
218
+ # Value is a tuple (encoder, decoder).
219
+ # Example: {MyCustomType: (lambda x: x.value, lambda data: MyCustomType(data))}
220
+ ) = None,
221
+ ) -> None:
222
+ """Inspect __init__ signature only once when subclassing + handle modelcard."""
223
+ super().__init_subclass__()
224
+
225
+ # Will be reused when creating modelcard
226
+ tags = tags or []
227
+ tags.append("model_hub_mixin")
228
+
229
+ # Initialize MixinInfo if not existent
230
+ info = MixinInfo(model_card_template=model_card_template, model_card_data=ModelCardData())
231
+
232
+ # If parent class has a MixinInfo, inherit from it as a copy
233
+ if hasattr(cls, "_hub_mixin_info"):
234
+ # Inherit model card template from parent class if not explicitly set
235
+ if model_card_template == DEFAULT_MODEL_CARD:
236
+ info.model_card_template = cls._hub_mixin_info.model_card_template
237
+
238
+ # Inherit from parent model card data
239
+ info.model_card_data = ModelCardData(**cls._hub_mixin_info.model_card_data.to_dict())
240
+
241
+ # Inherit other info
242
+ info.docs_url = cls._hub_mixin_info.docs_url
243
+ info.paper_url = cls._hub_mixin_info.paper_url
244
+ info.repo_url = cls._hub_mixin_info.repo_url
245
+ cls._hub_mixin_info = info
246
+
247
+ # Update MixinInfo with metadata
248
+ if model_card_template is not None and model_card_template != DEFAULT_MODEL_CARD:
249
+ info.model_card_template = model_card_template
250
+ if repo_url is not None:
251
+ info.repo_url = repo_url
252
+ if paper_url is not None:
253
+ info.paper_url = paper_url
254
+ if docs_url is not None:
255
+ info.docs_url = docs_url
256
+ if language is not None:
257
+ info.model_card_data.language = language
258
+ if library_name is not None:
259
+ info.model_card_data.library_name = library_name
260
+ if license is not None:
261
+ info.model_card_data.license = license
262
+ if license_name is not None:
263
+ info.model_card_data.license_name = license_name
264
+ if license_link is not None:
265
+ info.model_card_data.license_link = license_link
266
+ if pipeline_tag is not None:
267
+ info.model_card_data.pipeline_tag = pipeline_tag
268
+ if tags is not None:
269
+ normalized_tags = list(tags)
270
+ if info.model_card_data.tags is not None:
271
+ info.model_card_data.tags.extend(normalized_tags)
272
+ else:
273
+ info.model_card_data.tags = normalized_tags
274
+
275
+ if info.model_card_data.tags is not None:
276
+ info.model_card_data.tags = sorted(set(info.model_card_data.tags))
277
+
278
+ # Handle encoders/decoders for args
279
+ cls._hub_mixin_coders = coders or {}
280
+ cls._hub_mixin_jsonable_custom_types = tuple(cls._hub_mixin_coders.keys())
281
+
282
+ # Inspect __init__ signature to handle config
283
+ cls._hub_mixin_init_parameters = dict(inspect.signature(cls.__init__).parameters)
284
+ cls._hub_mixin_jsonable_default_values = {
285
+ param.name: cls._encode_arg(param.default)
286
+ for param in cls._hub_mixin_init_parameters.values()
287
+ if param.default is not inspect.Parameter.empty and cls._is_jsonable(param.default)
288
+ }
289
+ cls._hub_mixin_inject_config = "config" in inspect.signature(cls._from_pretrained).parameters
290
+
291
+ def __new__(cls: type[T], *args, **kwargs) -> T:
292
+ """Create a new instance of the class and handle config.
293
+
294
+ 3 cases:
295
+ - If `self._hub_mixin_config` is already set, do nothing.
296
+ - If `config` is passed as a dataclass, set it as `self._hub_mixin_config`.
297
+ - Otherwise, build `self._hub_mixin_config` from default values and passed values.
298
+ """
299
+ instance = super().__new__(cls)
300
+
301
+ # If `config` is already set, return early
302
+ if instance._hub_mixin_config is not None:
303
+ return instance
304
+
305
+ # Infer passed values
306
+ passed_values = {
307
+ **{
308
+ key: value
309
+ for key, value in zip(
310
+ # [1:] to skip `self` parameter
311
+ list(cls._hub_mixin_init_parameters)[1:],
312
+ args,
313
+ )
314
+ },
315
+ **kwargs,
316
+ }
317
+
318
+ # If config passed as dataclass => set it and return early
319
+ if is_dataclass(passed_values.get("config")):
320
+ instance._hub_mixin_config = passed_values["config"]
321
+ return instance
322
+
323
+ # Otherwise, build config from default + passed values
324
+ init_config = {
325
+ # default values
326
+ **cls._hub_mixin_jsonable_default_values,
327
+ # passed values
328
+ **{
329
+ key: cls._encode_arg(value) # Encode custom types as jsonable value
330
+ for key, value in passed_values.items()
331
+ if instance._is_jsonable(value) # Only if jsonable or we have a custom encoder
332
+ },
333
+ }
334
+ passed_config = init_config.pop("config", {})
335
+
336
+ # Populate `init_config` with provided config
337
+ if isinstance(passed_config, dict):
338
+ init_config.update(passed_config)
339
+
340
+ # Set `config` attribute and return
341
+ if init_config != {}:
342
+ instance._hub_mixin_config = init_config
343
+ return instance
344
+
345
+ @classmethod
346
+ def _is_jsonable(cls, value: Any) -> bool:
347
+ """Check if a value is JSON serializable."""
348
+ if is_dataclass(value):
349
+ return True
350
+ if isinstance(value, cls._hub_mixin_jsonable_custom_types):
351
+ return True
352
+ return is_jsonable(value)
353
+
354
+ @classmethod
355
+ def _encode_arg(cls, arg: Any) -> Any:
356
+ """Encode an argument into a JSON serializable format."""
357
+ if is_dataclass(arg):
358
+ return asdict(arg) # type: ignore[arg-type]
359
+ for type_, (encoder, _) in cls._hub_mixin_coders.items():
360
+ if isinstance(arg, type_):
361
+ if arg is None:
362
+ return None
363
+ return encoder(arg)
364
+ return arg
365
+
366
+ @classmethod
367
+ def _decode_arg(cls, expected_type: type[ARGS_T], value: Any) -> ARGS_T | None:
368
+ """Decode a JSON serializable value into an argument."""
369
+ if is_simple_optional_type(expected_type):
370
+ if value is None:
371
+ return None
372
+ expected_type = unwrap_simple_optional_type(expected_type) # type: ignore
373
+ # Dataclass => handle it
374
+ if is_dataclass(expected_type):
375
+ return _load_dataclass(expected_type, value) # type: ignore
376
+ # Otherwise => check custom decoders
377
+ for type_, (_, decoder) in cls._hub_mixin_coders.items():
378
+ if inspect.isclass(expected_type) and issubclass(expected_type, type_):
379
+ return decoder(value)
380
+ # Otherwise => don't decode
381
+ return value
382
+
383
+ def save_pretrained(
384
+ self,
385
+ save_directory: str | Path,
386
+ *,
387
+ config: dict | DataclassInstance | None = None,
388
+ repo_id: str | None = None,
389
+ push_to_hub: bool = False,
390
+ model_card_kwargs: dict[str, Any] | None = None,
391
+ **push_to_hub_kwargs,
392
+ ) -> str | None:
393
+ """
394
+ Save weights in local directory.
395
+
396
+ Args:
397
+ save_directory (`str` or `Path`):
398
+ Path to directory in which the model weights and configuration will be saved.
399
+ config (`dict` or `DataclassInstance`, *optional*):
400
+ Model configuration specified as a key/value dictionary or a dataclass instance.
401
+ push_to_hub (`bool`, *optional*, defaults to `False`):
402
+ Whether or not to push your model to the Huggingface Hub after saving it.
403
+ repo_id (`str`, *optional*):
404
+ ID of your repository on the Hub. Used only if `push_to_hub=True`. Will default to the folder name if
405
+ not provided.
406
+ model_card_kwargs (`dict[str, Any]`, *optional*):
407
+ Additional arguments passed to the model card template to customize the model card.
408
+ push_to_hub_kwargs:
409
+ Additional key word arguments passed along to the [`~ModelHubMixin.push_to_hub`] method.
410
+ Returns:
411
+ `str` or `None`: url of the commit on the Hub if `push_to_hub=True`, `None` otherwise.
412
+ """
413
+ save_directory = Path(save_directory)
414
+ save_directory.mkdir(parents=True, exist_ok=True)
415
+
416
+ # Remove config.json if already exists. After `_save_pretrained` we don't want to overwrite config.json
417
+ # as it might have been saved by the custom `_save_pretrained` already. However we do want to overwrite
418
+ # an existing config.json if it was not saved by `_save_pretrained`.
419
+ config_path = save_directory / constants.CONFIG_NAME
420
+ config_path.unlink(missing_ok=True)
421
+
422
+ # save model weights/files (framework-specific)
423
+ self._save_pretrained(save_directory)
424
+
425
+ # save config (if provided and if not serialized yet in `_save_pretrained`)
426
+ if config is None:
427
+ config = self._hub_mixin_config
428
+ if config is not None:
429
+ if is_dataclass(config):
430
+ config = asdict(config) # type: ignore[arg-type]
431
+ if not config_path.exists():
432
+ config_str = json.dumps(config, sort_keys=True, indent=2)
433
+ config_path.write_text(config_str)
434
+
435
+ # save model card
436
+ model_card_path = save_directory / "README.md"
437
+ model_card_kwargs = model_card_kwargs if model_card_kwargs is not None else {}
438
+ if not model_card_path.exists(): # do not overwrite if already exists
439
+ self.generate_model_card(**model_card_kwargs).save(save_directory / "README.md")
440
+
441
+ # push to the Hub if required
442
+ if push_to_hub:
443
+ kwargs = push_to_hub_kwargs.copy() # soft-copy to avoid mutating input
444
+ if config is not None: # kwarg for `push_to_hub`
445
+ kwargs["config"] = config
446
+ if repo_id is None:
447
+ repo_id = save_directory.name # Defaults to `save_directory` name
448
+ return self.push_to_hub(repo_id=repo_id, model_card_kwargs=model_card_kwargs, **kwargs)
449
+ return None
450
+
451
+ def _save_pretrained(self, save_directory: Path) -> None:
452
+ """
453
+ Overwrite this method in subclass to define how to save your model.
454
+ Check out our [integration guide](../guides/integrations) for instructions.
455
+
456
+ Args:
457
+ save_directory (`str` or `Path`):
458
+ Path to directory in which the model weights and configuration will be saved.
459
+ """
460
+ raise NotImplementedError
461
+
462
+ @classmethod
463
+ @validate_hf_hub_args
464
+ def from_pretrained(
465
+ cls: type[T],
466
+ pretrained_model_name_or_path: str | Path,
467
+ *,
468
+ force_download: bool = False,
469
+ token: str | bool | None = None,
470
+ cache_dir: str | Path | None = None,
471
+ local_files_only: bool = False,
472
+ revision: str | None = None,
473
+ **model_kwargs,
474
+ ) -> T:
475
+ """
476
+ Download a model from the Huggingface Hub and instantiate it.
477
+
478
+ Args:
479
+ pretrained_model_name_or_path (`str`, `Path`):
480
+ - Either the `model_id` (string) of a model hosted on the Hub, e.g. `bigscience/bloom`.
481
+ - Or a path to a `directory` containing model weights saved using
482
+ [`~transformers.PreTrainedModel.save_pretrained`], e.g., `../path/to/my_model_directory/`.
483
+ revision (`str`, *optional*):
484
+ Revision of the model on the Hub. Can be a branch name, a git tag or any commit id.
485
+ Defaults to the latest commit on `main` branch.
486
+ force_download (`bool`, *optional*, defaults to `False`):
487
+ Whether to force (re-)downloading the model weights and configuration files from the Hub, overriding
488
+ the existing cache.
489
+ token (`str` or `bool`, *optional*):
490
+ The token to use as HTTP bearer authorization for remote files. By default, it will use the token
491
+ cached when running `hf auth login`.
492
+ cache_dir (`str`, `Path`, *optional*):
493
+ Path to the folder where cached files are stored.
494
+ local_files_only (`bool`, *optional*, defaults to `False`):
495
+ If `True`, avoid downloading the file and return the path to the local cached file if it exists.
496
+ model_kwargs (`dict`, *optional*):
497
+ Additional kwargs to pass to the model during initialization.
498
+ """
499
+ model_id = str(pretrained_model_name_or_path)
500
+ config_file: str | None = None
501
+ if os.path.isdir(model_id):
502
+ if constants.CONFIG_NAME in os.listdir(model_id):
503
+ config_file = os.path.join(model_id, constants.CONFIG_NAME)
504
+ else:
505
+ logger.warning(f"{constants.CONFIG_NAME} not found in {Path(model_id).resolve()}")
506
+ else:
507
+ try:
508
+ config_file = hf_hub_download(
509
+ repo_id=model_id,
510
+ filename=constants.CONFIG_NAME,
511
+ revision=revision,
512
+ cache_dir=cache_dir,
513
+ force_download=force_download,
514
+ token=token,
515
+ local_files_only=local_files_only,
516
+ )
517
+ except HfHubHTTPError as e:
518
+ logger.info(f"{constants.CONFIG_NAME} not found on the HuggingFace Hub: {str(e)}")
519
+
520
+ # Read config
521
+ config = None
522
+ if config_file is not None:
523
+ with open(config_file, encoding="utf-8") as f:
524
+ config = json.load(f)
525
+
526
+ # Decode custom types in config
527
+ for key, value in config.items():
528
+ if key in cls._hub_mixin_init_parameters:
529
+ expected_type = cls._hub_mixin_init_parameters[key].annotation
530
+ if expected_type is not inspect.Parameter.empty:
531
+ config[key] = cls._decode_arg(expected_type, value)
532
+
533
+ # Populate model_kwargs from config
534
+ for param in cls._hub_mixin_init_parameters.values():
535
+ if param.name not in model_kwargs and param.name in config:
536
+ model_kwargs[param.name] = config[param.name]
537
+
538
+ # Check if `config` argument was passed at init
539
+ if "config" in cls._hub_mixin_init_parameters and "config" not in model_kwargs:
540
+ # Decode `config` argument if it was passed
541
+ config_annotation = cls._hub_mixin_init_parameters["config"].annotation
542
+ config = cls._decode_arg(config_annotation, config)
543
+
544
+ # Forward config to model initialization
545
+ model_kwargs["config"] = config
546
+
547
+ # Inject config if `**kwargs` are expected
548
+ if is_dataclass(cls):
549
+ for key in cls.__dataclass_fields__:
550
+ if key not in model_kwargs and key in config:
551
+ model_kwargs[key] = config[key]
552
+ elif any(param.kind == inspect.Parameter.VAR_KEYWORD for param in cls._hub_mixin_init_parameters.values()):
553
+ for key, value in config.items(): # type: ignore[union-attr]
554
+ if key not in model_kwargs:
555
+ model_kwargs[key] = value
556
+
557
+ # Finally, also inject if `_from_pretrained` expects it
558
+ if cls._hub_mixin_inject_config and "config" not in model_kwargs:
559
+ model_kwargs["config"] = config
560
+
561
+ instance = cls._from_pretrained(
562
+ model_id=str(model_id),
563
+ revision=revision,
564
+ cache_dir=cache_dir,
565
+ force_download=force_download,
566
+ local_files_only=local_files_only,
567
+ token=token,
568
+ **model_kwargs,
569
+ )
570
+
571
+ # Implicitly set the config as instance attribute if not already set by the class
572
+ # This way `config` will be available when calling `save_pretrained` or `push_to_hub`.
573
+ if config is not None and (getattr(instance, "_hub_mixin_config", None) in (None, {})):
574
+ instance._hub_mixin_config = config
575
+
576
+ return instance
577
+
578
+ @classmethod
579
+ def _from_pretrained(
580
+ cls: type[T],
581
+ *,
582
+ model_id: str,
583
+ revision: str | None,
584
+ cache_dir: str | Path | None,
585
+ force_download: bool,
586
+ local_files_only: bool,
587
+ token: str | bool | None,
588
+ **model_kwargs,
589
+ ) -> T:
590
+ """Overwrite this method in subclass to define how to load your model from pretrained.
591
+
592
+ Use [`hf_hub_download`] or [`snapshot_download`] to download files from the Hub before loading them. Most
593
+ args taken as input can be directly passed to those 2 methods. If needed, you can add more arguments to this
594
+ method using "model_kwargs". For example [`PyTorchModelHubMixin._from_pretrained`] takes as input a `map_location`
595
+ parameter to set on which device the model should be loaded.
596
+
597
+ Check out our [integration guide](../guides/integrations) for more instructions.
598
+
599
+ Args:
600
+ model_id (`str`):
601
+ ID of the model to load from the Huggingface Hub (e.g. `bigscience/bloom`).
602
+ revision (`str`, *optional*):
603
+ Revision of the model on the Hub. Can be a branch name, a git tag or any commit id. Defaults to the
604
+ latest commit on `main` branch.
605
+ force_download (`bool`, *optional*, defaults to `False`):
606
+ Whether to force (re-)downloading the model weights and configuration files from the Hub, overriding
607
+ the existing cache.
608
+ token (`str` or `bool`, *optional*):
609
+ The token to use as HTTP bearer authorization for remote files. By default, it will use the token
610
+ cached when running `hf auth login`.
611
+ cache_dir (`str`, `Path`, *optional*):
612
+ Path to the folder where cached files are stored.
613
+ local_files_only (`bool`, *optional*, defaults to `False`):
614
+ If `True`, avoid downloading the file and return the path to the local cached file if it exists.
615
+ model_kwargs:
616
+ Additional keyword arguments passed along to the [`~ModelHubMixin._from_pretrained`] method.
617
+ """
618
+ raise NotImplementedError
619
+
620
+ @validate_hf_hub_args
621
+ def push_to_hub(
622
+ self,
623
+ repo_id: str,
624
+ *,
625
+ config: dict | DataclassInstance | None = None,
626
+ commit_message: str = "Push model using huggingface_hub.",
627
+ private: bool | None = None,
628
+ token: str | None = None,
629
+ branch: str | None = None,
630
+ create_pr: bool | None = None,
631
+ allow_patterns: list[str] | str | None = None,
632
+ ignore_patterns: list[str] | str | None = None,
633
+ delete_patterns: list[str] | str | None = None,
634
+ model_card_kwargs: dict[str, Any] | None = None,
635
+ ) -> str:
636
+ """
637
+ Upload model checkpoint to the Hub.
638
+
639
+ Use `allow_patterns` and `ignore_patterns` to precisely filter which files should be pushed to the hub. Use
640
+ `delete_patterns` to delete existing remote files in the same commit. See [`upload_folder`] reference for more
641
+ details.
642
+
643
+ Args:
644
+ repo_id (`str`):
645
+ ID of the repository to push to (example: `"username/my-model"`).
646
+ config (`dict` or `DataclassInstance`, *optional*):
647
+ Model configuration specified as a key/value dictionary or a dataclass instance.
648
+ commit_message (`str`, *optional*):
649
+ Message to commit while pushing.
650
+ private (`bool`, *optional*):
651
+ Whether the repository created should be private.
652
+ If `None` (default), the repo will be public unless the organization's default is private.
653
+ token (`str`, *optional*):
654
+ The token to use as HTTP bearer authorization for remote files. By default, it will use the token
655
+ cached when running `hf auth login`.
656
+ branch (`str`, *optional*):
657
+ The git branch on which to push the model. This defaults to `"main"`.
658
+ create_pr (`boolean`, *optional*):
659
+ Whether or not to create a Pull Request from `branch` with that commit. Defaults to `False`.
660
+ allow_patterns (`list[str]` or `str`, *optional*):
661
+ If provided, only files matching at least one pattern are pushed.
662
+ ignore_patterns (`list[str]` or `str`, *optional*):
663
+ If provided, files matching any of the patterns are not pushed.
664
+ delete_patterns (`list[str]` or `str`, *optional*):
665
+ If provided, remote files matching any of the patterns will be deleted from the repo.
666
+ model_card_kwargs (`dict[str, Any]`, *optional*):
667
+ Additional arguments passed to the model card template to customize the model card.
668
+
669
+ Returns:
670
+ The url of the commit of your model in the given repository.
671
+ """
672
+ api = HfApi(token=token)
673
+ repo_id = api.create_repo(repo_id=repo_id, private=private, exist_ok=True).repo_id
674
+
675
+ # Push the files to the repo in a single commit
676
+ with SoftTemporaryDirectory() as tmp:
677
+ saved_path = Path(tmp) / repo_id
678
+ self.save_pretrained(saved_path, config=config, model_card_kwargs=model_card_kwargs)
679
+ return api.upload_folder(
680
+ repo_id=repo_id,
681
+ repo_type="model",
682
+ folder_path=saved_path,
683
+ commit_message=commit_message,
684
+ revision=branch,
685
+ create_pr=create_pr,
686
+ allow_patterns=allow_patterns,
687
+ ignore_patterns=ignore_patterns,
688
+ delete_patterns=delete_patterns,
689
+ )
690
+
691
+ def generate_model_card(self, *args, **kwargs) -> ModelCard:
692
+ card = ModelCard.from_template(
693
+ card_data=self._hub_mixin_info.model_card_data,
694
+ template_str=self._hub_mixin_info.model_card_template,
695
+ repo_url=self._hub_mixin_info.repo_url,
696
+ paper_url=self._hub_mixin_info.paper_url,
697
+ docs_url=self._hub_mixin_info.docs_url,
698
+ **kwargs,
699
+ )
700
+ return card
701
+
702
+
703
+ class PyTorchModelHubMixin(ModelHubMixin):
704
+ """
705
+ Implementation of [`ModelHubMixin`] to provide model Hub upload/download capabilities to PyTorch models. The model
706
+ is set in evaluation mode by default using `model.eval()` (dropout modules are deactivated). To train the model,
707
+ you should first set it back in training mode with `model.train()`.
708
+
709
+ See [`ModelHubMixin`] for more details on how to use the mixin.
710
+
711
+ Example:
712
+
713
+ ```python
714
+ >>> import torch
715
+ >>> import torch.nn as nn
716
+ >>> from huggingface_hub import PyTorchModelHubMixin
717
+
718
+ >>> class MyModel(
719
+ ... nn.Module,
720
+ ... PyTorchModelHubMixin,
721
+ ... library_name="keras-nlp",
722
+ ... repo_url="https://github.com/keras-team/keras-nlp",
723
+ ... paper_url="https://arxiv.org/abs/2304.12244",
724
+ ... docs_url="https://keras.io/keras_nlp/",
725
+ ... # ^ optional metadata to generate model card
726
+ ... ):
727
+ ... def __init__(self, hidden_size: int = 512, vocab_size: int = 30000, output_size: int = 4):
728
+ ... super().__init__()
729
+ ... self.param = nn.Parameter(torch.rand(hidden_size, vocab_size))
730
+ ... self.linear = nn.Linear(output_size, vocab_size)
731
+
732
+ ... def forward(self, x):
733
+ ... return self.linear(x + self.param)
734
+ >>> model = MyModel(hidden_size=256)
735
+
736
+ # Save model weights to local directory
737
+ >>> model.save_pretrained("my-awesome-model")
738
+
739
+ # Push model weights to the Hub
740
+ >>> model.push_to_hub("my-awesome-model")
741
+
742
+ # Download and initialize weights from the Hub
743
+ >>> model = MyModel.from_pretrained("username/my-awesome-model")
744
+ >>> model.hidden_size
745
+ 256
746
+ ```
747
+ """
748
+
749
+ def __init_subclass__(cls, *args, tags: list[str] | None = None, **kwargs) -> None:
750
+ tags = tags or []
751
+ tags.append("pytorch_model_hub_mixin")
752
+ kwargs["tags"] = tags
753
+ return super().__init_subclass__(*args, **kwargs)
754
+
755
+ def _save_pretrained(self, save_directory: Path) -> None:
756
+ """Save weights from a Pytorch model to a local directory."""
757
+ model_to_save = self.module if hasattr(self, "module") else self # type: ignore
758
+ save_model_as_safetensor(model_to_save, str(save_directory / constants.SAFETENSORS_SINGLE_FILE)) # type: ignore [arg-type]
759
+
760
+ @classmethod
761
+ def _from_pretrained(
762
+ cls,
763
+ *,
764
+ model_id: str,
765
+ revision: str | None,
766
+ cache_dir: str | Path | None,
767
+ force_download: bool,
768
+ local_files_only: bool,
769
+ token: str | bool | None,
770
+ map_location: str = "cpu",
771
+ strict: bool = False,
772
+ **model_kwargs,
773
+ ):
774
+ """Load Pytorch pretrained weights and return the loaded model."""
775
+ model = cls(**model_kwargs)
776
+ if os.path.isdir(model_id):
777
+ print("Loading weights from local directory")
778
+ model_file = os.path.join(model_id, constants.SAFETENSORS_SINGLE_FILE)
779
+ return cls._load_as_safetensor(model, model_file, map_location, strict)
780
+ else:
781
+ try:
782
+ model_file = hf_hub_download(
783
+ repo_id=model_id,
784
+ filename=constants.SAFETENSORS_SINGLE_FILE,
785
+ revision=revision,
786
+ cache_dir=cache_dir,
787
+ force_download=force_download,
788
+ token=token,
789
+ local_files_only=local_files_only,
790
+ )
791
+ return cls._load_as_safetensor(model, model_file, map_location, strict)
792
+ except EntryNotFoundError:
793
+ model_file = hf_hub_download(
794
+ repo_id=model_id,
795
+ filename=constants.PYTORCH_WEIGHTS_NAME,
796
+ revision=revision,
797
+ cache_dir=cache_dir,
798
+ force_download=force_download,
799
+ token=token,
800
+ local_files_only=local_files_only,
801
+ )
802
+ return cls._load_as_pickle(model, model_file, map_location, strict)
803
+
804
+ @classmethod
805
+ def _load_as_pickle(cls, model: T, model_file: str, map_location: str, strict: bool) -> T:
806
+ state_dict = torch.load(model_file, map_location=torch.device(map_location), weights_only=True)
807
+ model.load_state_dict(state_dict, strict=strict) # type: ignore
808
+ model.eval() # type: ignore
809
+ return model
810
+
811
+ @classmethod
812
+ def _load_as_safetensor(cls, model: T, model_file: str, map_location: str, strict: bool) -> T:
813
+ if packaging.version.parse(safetensors.__version__) < packaging.version.parse("0.4.3"): # type: ignore [attr-defined]
814
+ load_model_as_safetensor(model, model_file, strict=strict) # type: ignore [arg-type]
815
+ if map_location != "cpu":
816
+ logger.warning(
817
+ "Loading model weights on other devices than 'cpu' is not supported natively in your version of safetensors."
818
+ " This means that the model is loaded on 'cpu' first and then copied to the device."
819
+ " This leads to a slower loading time."
820
+ " Please update safetensors to version 0.4.3 or above for improved performance."
821
+ )
822
+ model.to(map_location) # type: ignore [attr-defined]
823
+ else:
824
+ safetensors.torch.load_model(model, model_file, strict=strict, device=map_location) # type: ignore [arg-type]
825
+ model.eval() # type: ignore
826
+ return model
827
+
828
+
829
+ def _load_dataclass(datacls: type[DataclassInstance], data: dict) -> DataclassInstance:
830
+ """Load a dataclass instance from a dictionary.
831
+
832
+ Fields not expected by the dataclass are ignored.
833
+ """
834
+ return datacls(**{k: v for k, v in data.items() if k in datacls.__dataclass_fields__})