Skip to main content

Module tensor_map

Module tensor_map 

Source
Expand description

Maps tabfm/src/pytorch/model.py state_dict keys (from torch.load(pytorch_model.bin), after conversion to safetensors) to canonical GGUF tensor names.

There’s no pre-existing GGUF naming convention for this architecture family, so this module defines one. Stack prefixes mirror the five weight-sharing sub-networks in TabFM.forward:

  • cell <- cell_embedder (per-cell Fourier embedding)
  • colenc1 <- col_embedder (SetTransformer, stage 1)
  • colenc2 <- col_embedder_2 (SetTransformer, stage 2)
  • rowenc1 <- row_interactor (RoPE cross-column attention, stage 1)
  • rowenc2 <- row_interactor_2 (RoPE cross-column attention, stage 2)
  • icl <- icl_predictor (24-block in-context-learning attention) cls_tokens is a top-level parameter with no stack.

Column stacks nest two MultiheadAttentionBlocks per transformer block (mab1, mab2 — induced-attention query/apply pair); row and ICL stacks have one attention+FFN sublayer per block. Both share the same leaf naming for a block’s attention/FFN/norm weights.

Functions§

map_tensor_name