import { useState } from "react"; import { Box, Button, Chip, Paper, Stack, TextField, Typography, } from "@mui/material"; import RocketLaunchRoundedIcon from "@mui/icons-material/RocketLaunchRounded"; interface Props { onSubmit: (input: string) => void; disabled?: boolean; } const SAMPLES = [ { label: "Llama 1B", value: "TinyLlama/TinyLlama-1.1B-Chat-v1.0" }, { label: "Qwen2.5 0.5B", value: "Qwen/Qwen2.5-0.5B-Instruct" }, { label: "GPT-2", value: "gpt2" }, { label: "DistilBERT", value: "distilbert-base-uncased" }, { label: "ViT", value: "google/vit-base-patch16-224" }, { label: "T5 small", value: "google-t5/t5-small" }, ]; export function ModelInput({ onSubmit, disabled }: Props) { const [value, setValue] = useState("TinyLlama/TinyLlama-1.1B-Chat-v1.0"); return ( Visualize any Hugging Face model Paste a Hugging Face URL or repo id. Reads only the safetensors header + the model's source — no weights, no backend, no wait queue. { e.preventDefault(); if (value.trim()) onSubmit(value.trim()); }} sx={{ mt: 4, display: "flex", gap: 1.5, flexWrap: "wrap" }} > setValue(e.target.value)} placeholder="meta-llama/Llama-3.2-1B or https://huggingface.co/..." fullWidth sx={{ flex: 1, minWidth: 240 }} disabled={disabled} /> {SAMPLES.map((s) => ( { setValue(s.value); onSubmit(s.value); }} sx={{ borderColor: "rgba(155,180,255,0.25)" }} /> ))} ); }