Instructions to use jonl521/modeling_simple with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jonl521/modeling_simple with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("jonl521/modeling_simple", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download .venv/lib/python3.14/site-packages/numpy/tests/test_lazyloading.py from jonl521/modeling_simple: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/jonl521/modeling_simple/resolve/main/.venv/lib/python3.14/site-packages/numpy/tests/test_lazyloading.py
- Command line
-
hf download hf://jonl521/modeling_simple/.venv/lib/python3.14/site-packages/numpy/tests/test_lazyloading.py
-
curl -L -o test_lazyloading.py https://huggingface.co/jonl521/modeling_simple/resolve/main/.venv/lib/python3.14/site-packages/numpy/tests/test_lazyloading.py
1.26 kB
| import subprocess | |
| import sys | |
| import textwrap | |
| import pytest | |
| from numpy.testing import IS_WASM | |
| def test_lazy_load(): | |
| # gh-22045. lazyload doesn't import submodule names into the namespace | |
| # Test within a new process, to ensure that we do not mess with the | |
| # global state during the test run (could lead to cryptic test failures). | |
| # This is generally unsafe, especially, since we also reload the C-modules. | |
| code = textwrap.dedent(r""" | |
| import sys | |
| from importlib.util import LazyLoader, find_spec, module_from_spec | |
| # create lazy load of numpy as np | |
| spec = find_spec("numpy") | |
| module = module_from_spec(spec) | |
| sys.modules["numpy"] = module | |
| loader = LazyLoader(spec.loader) | |
| loader.exec_module(module) | |
| np = module | |
| # test a subpackage import | |
| from numpy.lib import recfunctions # noqa: F401 | |
| # test triggering the import of the package | |
| np.ndarray | |
| """) | |
| p = subprocess.run( | |
| (sys.executable, '-c', code), | |
| stdout=subprocess.PIPE, | |
| stderr=subprocess.STDOUT, | |
| encoding='utf-8', | |
| check=False, | |
| ) | |
| assert p.returncode == 0, p.stdout | |