'use client' import { useState } from 'react' import type { TrainingConfig } from '../types' const BUNDESLAENDER = [ { code: 'ni', name: 'Niedersachsen', allowed: true }, { code: 'by', name: 'Bayern', allowed: true }, { code: 'nw', name: 'NRW', allowed: true }, { code: 'he', name: 'Hessen', allowed: true }, { code: 'bw', name: 'Baden-Wuerttemberg', allowed: true }, { code: 'rp', name: 'Rheinland-Pfalz', allowed: true }, { code: 'sn', name: 'Sachsen', allowed: true }, { code: 'sh', name: 'Schleswig-Holstein', allowed: true }, { code: 'th', name: 'Thueringen', allowed: true }, { code: 'be', name: 'Berlin', allowed: false }, { code: 'bb', name: 'Brandenburg', allowed: false }, { code: 'hb', name: 'Bremen', allowed: false }, { code: 'hh', name: 'Hamburg', allowed: false }, { code: 'mv', name: 'Mecklenburg-Vorpommern', allowed: false }, { code: 'sl', name: 'Saarland', allowed: false }, { code: 'st', name: 'Sachsen-Anhalt', allowed: false }, ] export function NewTrainingModal({ isOpen, onClose, onSubmit }: { isOpen: boolean onClose: () => void onSubmit: (config: Partial) => void }) { const [step, setStep] = useState(1) const [config, setConfig] = useState>({ batch_size: 16, learning_rate: 0.00005, epochs: 10, warmup_steps: 500, weight_decay: 0.01, gradient_accumulation: 4, mixed_precision: true, bundeslaender: [], }) if (!isOpen) return null return (
{/* Header */}

Neue Indexierung starten

Schritt {step} von 3

{/* Step Indicator */} {/* Step Content */}
{step === 1 && ( )} {step === 2 && ( )} {step === 3 && ( )}
{/* Footer */}
) } // --- Internal step components --- function StepIndicator({ currentStep }: { currentStep: number }) { return (
{[1, 2, 3].map((s) => (
{s < currentStep ? '\u2713' : s}
{s < 3 && (
)}
))}
Daten Parameter Bestaetigen
) } function BundeslaenderStep({ config, setConfig }: { config: Partial setConfig: (config: Partial) => void }) { return (

Waehlen Sie die Bundeslaender fuer die Indexierung

Nur Bundeslaender mit verfuegbaren Dokumenten koennen ausgewaehlt werden.

{BUNDESLAENDER.map((bl) => ( ))}
) } function ParameterStep({ config, setConfig }: { config: Partial setConfig: (config: Partial) => void }) { return (

Indexierungs-Parameter

Diese Parameter steuern die Batch-Verarbeitung der Dokumente.

setConfig({ ...config, batch_size: parseInt(e.target.value) })} className="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700" />

Dokumente pro Batch

setConfig({ ...config, epochs: parseInt(e.target.value) })} className="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700" />

Fuer Validierung

setConfig({ ...config, mixed_precision: e.target.checked })} className="w-4 h-4 text-blue-600 rounded" />
) } function ConfirmStep({ config }: { config: Partial }) { return (

Konfiguration bestaetigen

Bundeslaender {config.bundeslaender?.length || 0} ausgewaehlt
Batch Size {config.batch_size}
Parallele Verarbeitung {config.mixed_precision ? 'Aktiviert' : 'Deaktiviert'}

Was passiert: Die ausgewaehlten Dokumente werden extrahiert, in Chunks aufgeteilt, und als Vektoren in Qdrant indexiert. Dieser Prozess kann je nach Datenmenge einige Minuten dauern.

) }