export function getTopTokenSupported()

in neuron_viewer/src/types.ts [48:68]


export function getTopTokenSupported(nodeType: NodeType) {
  // Define if a node supports top input-token or top output-token requests
  switch (nodeType) {
    case NodeType.MLP_NEURON:
    case NodeType.AUTOENCODER_LATENT:
    case NodeType.MLP_AUTOENCODER_LATENT:
    case NodeType.RESIDUAL_STREAM_CHANNEL:
      return TopTokenSupported.BOTH;
    case NodeType.ATTENTION_AUTOENCODER_LATENT:
    case NodeType.AUTOENCODER_LATENT_BY_TOKEN_PAIR:
      return TopTokenSupported.OUTPUT;
    case NodeType.ATTENTION_HEAD:
    case NodeType.QK_CHANNEL:
    case NodeType.V_CHANNEL:
    case NodeType.LAYER:
    case NodeType.VOCAB_TOKEN:
      return TopTokenSupported.NONE;
    default:
      return assertUnreachable(nodeType);
  }
}