Module: Ignis::AI::WeightMap

Defined in:
lib/nnw/ai/weight_map.rb

Overview

Weight mapping from HuggingFace model naming conventions to Ignis parameter names. Used by Safetensors.load_model to map HF checkpoint keys to Ignis module keys.

Class Method Summary collapse

Class Method Details

.for(architecture) ⇒ Hash{String => String}

Get the weight map for a given model architecture.

Parameters:

  • architecture (Symbol)

    :gpt2, :llama, :bert

Returns:

  • (Hash{String => String})

    HF key → Ignis key



12
13
14
15
16
17
18
19
20
# File 'lib/nnw/ai/weight_map.rb', line 12

def for(architecture)
  case architecture
  when :gpt2    then gpt2_map
  when :llama   then llama_map
  when :bert    then bert_map
  else
    raise ArgumentError, "Unknown architecture: #{architecture}. Supported: :gpt2, :llama, :bert"
  end
end