import { useEffect, useState } from 'react'
import PipelineSelector from './components/PipelineSelector'
import ZeroShotClassification from './components/ZeroShotClassification'
import TextClassification from './components/TextClassification'
import Header from './Header'
import Footer from './Footer'
import { useModel } from './contexts/ModelContext'
import { getModelsByPipeline } from './lib/huggingface'
import ModelSelector from './components/ModelSelector'
import ModelInfo from './components/ModelInfo'
function App() {
const { pipeline, setPipeline, progress, status, modelInfo, setModels } =
useModel()
useEffect(() => {
const fetchModels = async () => {
const fetchedModels = await getModelsByPipeline(pipeline)
setModels(fetchedModels)
console.log(fetchedModels)
}
fetchModels()
}, [setModels, pipeline])
return (
{/* Pipeline Selection */}
{/* Model Loading Progress */}
{status === 'progress' && (
Loading Model...
{progress.toFixed(2)}%
)}
{/* Pipeline Description */}
{pipeline === 'zero-shot-classification'
? 'Zero-Shot Classification'
: 'Text-Classification'}
{pipeline === 'zero-shot-classification'
? 'Classify text into custom categories without training data. Perfect for organizing content, routing messages, or analyzing feedback.'
: 'Classify text into predefined categories. Ideal for sentiment analysis, spam detection, or topic categorization.'}
{/* Pipeline Component */}
{pipeline === 'zero-shot-classification' && (
)}
{pipeline === 'text-classification' && }
)
}
export default App