Jupyter kernel crashes/restarts when loading local HuggingFace .safetensors model with AutoModelForCausalLM
21:00 02 Mar 2026

I am attempting to load a large local Hugging Face model (

./ltx-2-19b-dev.safetensors", .safetensors format) inside JupyterLab using transformers, but the kernel crashes immediately during from_pretrained() without any Python traceback.

When I run this code:

from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "./ltx-2-19b-dev.safetensors"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)

The kernel immediately restarts and I get a popup saying something like:

The kernel for Untitled.ipynb appears to have died. It will restart automatically.

There is no Python traceback shown in the notebook — it just crashes.

Why would AutoModelForCausalLM.from_pretrained() cause the kernel to crash without a traceback?

python jupyter-notebook huggingface-transformers large-language-model safe-tensors