function getComponentTypeForMlpFromUrl()

in neuron_viewer/src/TransformerDebugger/utils/urlParams.ts [88:101]


function getComponentTypeForMlpFromUrl(query: URLSearchParams): ComponentTypeForMlp {
  const componentTypeForMlpStr = query.get(QueryParams.componentTypeForMlp.key);
  switch (componentTypeForMlpStr) {
    case "neuron":
      return ComponentTypeForMlp.NEURON;
    case "autoencoder": // Legacy value from when the parameter was named "inferenceMode".
    case "autoencoder_latent":
      return ComponentTypeForMlp.AUTOENCODER_LATENT;
    case null:
      return QueryParams.componentTypeForMlp.defaultValue;
    default:
      throw new Error(`Invalid component type for MLP: ${componentTypeForMlpStr}`);
  }
}