import { useEffect, useState } from 'react' import { Settings } from 'lucide-react' import ZeroShotClassification from './components/ZeroShotClassification' import TextClassification from './components/TextClassification' import Header from './Header' import { useModel } from './contexts/ModelContext' import { getModelsByPipeline } from './lib/huggingface' import TextGeneration from './components/TextGeneration' import FeatureExtraction from './components/FeatureExtraction' import Sidebar from './components/Sidebar' import ModelReadme from './components/ModelReadme' import { PipelineLayout } from './components/PipelineLayout' function App() { const [isSidebarOpen, setIsSidebarOpen] = useState(false) const { pipeline, setModels, setModelInfo, modelInfo, setIsFetching } = useModel() useEffect(() => { setModelInfo(null) setModels([]) setIsFetching(true) const fetchModels = async () => { try { const fetchedModels = await getModelsByPipeline(pipeline) setModels(fetchedModels) } catch (error) { console.error('Error fetching models:', error) setIsFetching(false) } } fetchModels() }, [setModels, setModelInfo, setIsFetching, pipeline]) return (
{/* Header is h-16 = 4rem */} {/* Main Content */}
{/* Mobile menu button */}
{/* Model README Button */}
{modelInfo?.readme && ( )}
{/* Pipeline Component */}
{pipeline === 'zero-shot-classification' && ( )} {pipeline === 'text-classification' && } {pipeline === 'text-generation' && } {pipeline === 'feature-extraction' && }
{/* Sidebar */} setIsSidebarOpen(false)} />
) } export default App