import React from "react"; export default function ModelStructure({ structure }) { if (!structure) return null; const items = { model_type: "Model Type", hidden_size: "Hidden Size", num_attention_heads: "Number of Attention Heads", num_hidden_layers: "Number of Hidden Layers", image_size: "Image Size", intermediate_size: "Intermediate Size", patch_size: "Patch Size", vocab_size: "Vocab Size", } // Find which keys in structure match our interest list const matched = Object.keys(items).filter((k) => k in structure && !!structure[k]); return (
{matched.length === 0 ? (
{structure.model_type}
) : (
{matched.map((k) => (
{items[k]}:
{String(structure[k])}
))}
)}
); }