diff --git "a/index.html" "b/index.html" --- "a/index.html" +++ "b/index.html" @@ -61,6 +61,7875 @@ } + + +

Bloatedness Visualizer

@@ -120,43 +7989,10 @@ const addTabBtn = document.getElementById('add-tab-btn'); // --- Example Code --- - const exampleCodeMain = ` -# A specific model implementation that uses an external class -class MyAwesomeModel(BaseModel, AttentionMixin): - def __init__(self, config): - super().__init__(config) - self._init_attention(config) - - def forward(self, input_ids) -> BaseModelOutputWithPast: - """The main forward pass for the model.""" - x = self._split_heads(input_ids) - # The return type is a class not defined in this file - return BaseModelOutputWithPast(last_hidden_state=x) -`; - - const exampleCodeDeps = ` -# This class is an external dependency, not defined here -# from modeling_outputs import BaseModelOutputWithPast - -# A common mixin for attention mechanisms -class AttentionMixin: - def _init_attention(self, config): - self.num_heads = config.num_heads - self.head_dim = config.hidden_size // config.num_heads - - def _split_heads(self, tensor): - # Logic to split tensor for multi-head attention - return tensor - -# A base class for all models, similar to PreTrainedModel -class BaseModel: - def __init__(self, config): - self.config = config - - def from_pretrained(cls, model_name): - # Load weights - pass -`; + const exampleCodeMain = document.getElementById("main-code").textContent; + + const exampleCodeDeps = document.getElementById("dependencies").textContent; + // --- Tab Management --- let tabCounter = 0;