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/functorch/dim/magic_trace.py from jonl521/modeling_simple: direct link, hf CLI and curl.
- Browser
- Download file 1.33 kB
-
https://huggingface.co/jonl521/modeling_simple/resolve/main/.venv/lib/python3.14/site-packages/functorch/dim/magic_trace.py
- Command line
-
hf download hf://jonl521/modeling_simple/.venv/lib/python3.14/site-packages/functorch/dim/magic_trace.py
-
curl -L -o magic_trace.py https://huggingface.co/jonl521/modeling_simple/resolve/main/.venv/lib/python3.14/site-packages/functorch/dim/magic_trace.py
1.33 kB
| # Copyright (c) Facebook, Inc. and its affiliates. | |
| # All rights reserved. | |
| # | |
| # This source code is licensed under the BSD-style license found in the | |
| # LICENSE file in the root directory of this source tree. | |
| import os | |
| import signal | |
| import subprocess | |
| from contextlib import contextmanager | |
| def magic_trace(output="trace.fxt", magic_trace_cache="/tmp/magic-trace"): | |
| pid = os.getpid() | |
| if not os.path.exists(magic_trace_cache): | |
| print(f"Downloading magic_trace to: {magic_trace_cache}") | |
| subprocess.run( | |
| [ | |
| "wget", | |
| "-O", | |
| magic_trace_cache, | |
| "-q", | |
| "https://github.com/janestreet/magic-trace/releases/download/v1.0.2/magic-trace", | |
| ] | |
| ) | |
| subprocess.run(["chmod", "+x", magic_trace_cache]) | |
| args = [magic_trace_cache, "attach", "-pid", str(pid), "-o", output] | |
| p = subprocess.Popen(args, stderr=subprocess.PIPE, encoding="utf-8") | |
| while True: | |
| x = p.stderr.readline() | |
| print(x) | |
| if "Attached" in x: | |
| break | |
| try: | |
| yield | |
| finally: | |
| p.send_signal(signal.SIGINT) | |
| r = p.wait() | |
| print(p.stderr.read()) | |
| p.stderr.close() | |
| if r != 0: | |
| raise ValueError(f"magic_trace exited abnormally: {r}") | |