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/torch/fx/experimental/debug.py from jonl521/modeling_simple: direct link, hf CLI and curl.
- Browser
- Download file 811 Bytes
-
https://huggingface.co/jonl521/modeling_simple/resolve/main/.venv/lib/python3.14/site-packages/torch/fx/experimental/debug.py
- Command line
-
hf download hf://jonl521/modeling_simple/.venv/lib/python3.14/site-packages/torch/fx/experimental/debug.py
-
curl -L -o debug.py https://huggingface.co/jonl521/modeling_simple/resolve/main/.venv/lib/python3.14/site-packages/torch/fx/experimental/debug.py
811 Bytes
| from collections.abc import Sequence | |
| import torch.fx as fx | |
| __all__ = ["set_trace"] | |
| def set_trace(gm: fx.GraphModule) -> fx.GraphModule: | |
| """ | |
| Sets a breakpoint in `gm`'s generated python code. It drops into pdb when | |
| `gm` gets run. | |
| Args: | |
| gm: graph module to insert breakpoint. It is then recompiled for it to | |
| take effect. | |
| Returns: | |
| the `gm` with breakpoint inserted. | |
| """ | |
| def insert_pdb(body: Sequence[str]) -> list[str]: | |
| return ["import pdb; pdb.set_trace()\n", *body] | |
| with gm.graph.on_generate_code( | |
| make_transformer=lambda cur_transform: ( | |
| # new code transformer to register | |
| lambda body: (insert_pdb(cur_transform(body) if cur_transform else body)) | |
| ) | |
| ): | |
| gm.recompile() | |
| return gm | |