File size: 1,315 Bytes
4a70176 6ebf2fd de6e73e 31283f8 948b11c 322c234 59a1fe9 948b11c de6e73e 25e8265 25647ae 25e8265 5b8fd7e 4a70176 948b11c 4a70176 948b11c 9283c8b 6ebf2fd 4a70176 6ebf2fd 948b11c de6e73e 6ebf2fd de6e73e 4a70176 948b11c 4a70176 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
import React from 'react'
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue
} from '@/components/ui/select'
export const supportedPipelines = [
'feature-extraction',
'image-classification',
'text-generation',
'text-classification',
'text-to-speech',
'zero-shot-classification'
// 'summarization',
// 'translation'
]
interface PipelineSelectorProps {
pipeline: string
setPipeline: (pipeline: string) => void
}
const PipelineSelector: React.FC<PipelineSelectorProps> = ({
pipeline,
setPipeline
}) => {
const formatPipelineName = (pipelineId: string) => {
return pipelineId
.split('-')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ')
}
return (
<Select value={pipeline} onValueChange={setPipeline}>
<SelectTrigger className="w-full text-sm xl:text-base">
<SelectValue placeholder="Select a pipeline" />
</SelectTrigger>
<SelectContent>
{supportedPipelines.map((p) => (
<SelectItem
key={p}
value={p}
className="text-sm xl:text-base data-[state=checked]:font-bold"
>
{formatPipelineName(p)}
</SelectItem>
))}
</SelectContent>
</Select>
)
}
export default PipelineSelector
|