Performance improvements to captioner. Add ability to set a default caption for ace captioner to avoid needing to caption the audio so we only transcribe
This commit is contained in:
@@ -111,6 +111,8 @@ export const CaptionDatasetModal: React.FC = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const additionalSections = selectedCaptionOption?.additionalSections || [];
|
||||
|
||||
return (
|
||||
<Modal isOpen={open} onClose={handleClose} title="Caption Dataset" size="lg">
|
||||
<div className="space-y-4 text-gray-200">
|
||||
@@ -159,7 +161,7 @@ export const CaptionDatasetModal: React.FC = () => {
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
{selectedCaptionOption?.additionalSections?.includes('caption.model_name_or_path2') && (
|
||||
{additionalSections.includes('caption.model_name_or_path2') && (
|
||||
<div className="mt-4">
|
||||
<CreatableSelectInput
|
||||
label="Name or Path 2"
|
||||
@@ -175,6 +177,22 @@ export const CaptionDatasetModal: React.FC = () => {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{additionalSections.includes('caption.fixed_caption') && (
|
||||
<div className="mt-4">
|
||||
<TextInput
|
||||
label="Fixed Caption"
|
||||
value={jobConfig.config.process[0].caption.fixed_caption || ''}
|
||||
onChange={value => {
|
||||
if (value?.trim() === '') {
|
||||
//@ts-ignore
|
||||
value = undefined;
|
||||
}
|
||||
setJobConfig(value, 'config.process[0].caption.fixed_caption');
|
||||
}}
|
||||
placeholder="Enter fixed caption (if you want the same caption for all audio files)"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 mt-4">
|
||||
<div>
|
||||
<SelectInput
|
||||
@@ -191,7 +209,7 @@ export const CaptionDatasetModal: React.FC = () => {
|
||||
}}
|
||||
options={quantizationOptions}
|
||||
/>
|
||||
{selectedCaptionOption?.additionalSections?.includes('caption.max_res') && (
|
||||
{additionalSections.includes('caption.max_res') && (
|
||||
<div className="mt-4">
|
||||
<SelectInput
|
||||
label="Max Resolution"
|
||||
@@ -206,7 +224,7 @@ export const CaptionDatasetModal: React.FC = () => {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{selectedCaptionOption?.additionalSections?.includes('caption.max_new_tokens') && (
|
||||
{additionalSections.includes('caption.max_new_tokens') && (
|
||||
<div className="mt-4">
|
||||
<SelectInput
|
||||
label="Max New Tokens"
|
||||
@@ -237,7 +255,7 @@ export const CaptionDatasetModal: React.FC = () => {
|
||||
</FormGroup>
|
||||
</div>
|
||||
</div>
|
||||
{selectedCaptionOption?.additionalSections?.includes('caption.caption_prompt') && (
|
||||
{additionalSections.includes('caption.caption_prompt') && (
|
||||
<div className="mt-4">
|
||||
<TextAreaInput
|
||||
label="Caption Prompt"
|
||||
|
||||
@@ -68,7 +68,7 @@ export const Modal: React.FC<ModalProps> = ({
|
||||
>
|
||||
{/* Modal panel */}
|
||||
<div
|
||||
className={`relative mx-auto w-full ${sizeClasses[size]} rounded-lg bg-gray-800 border border-gray-700 shadow-xl transition-all`}
|
||||
className={`relative mx-auto w-full ${sizeClasses[size]} rounded-lg bg-white dark:bg-gray-900 border border-gray-700 shadow-xl transition-all`}
|
||||
onClick={e => e.stopPropagation()}
|
||||
>
|
||||
{/* Modal header */}
|
||||
|
||||
@@ -12,7 +12,7 @@ const Select = dynamic(() => import('react-select'), { ssr: false });
|
||||
|
||||
const labelClasses = 'block text-xs mb-1 mt-2 text-gray-300';
|
||||
const inputClasses =
|
||||
'w-full text-sm px-3 py-1 bg-gray-800 border border-gray-700 rounded-sm focus:ring-2 focus:ring-gray-600 focus:border-transparent';
|
||||
'w-full text-sm px-3 py-1 bg-gray-950 dark:bg-gray-800 border border-gray-700 rounded-sm text-gray-100 placeholder:text-gray-500 focus:ring-2 focus:ring-gray-600 focus:border-transparent';
|
||||
|
||||
export interface InputProps {
|
||||
label?: string;
|
||||
@@ -584,7 +584,7 @@ export const SliderInput: React.FC<SliderInputProps> = props => {
|
||||
</div>
|
||||
|
||||
{showValue && (
|
||||
<div className="min-w-[3.5rem] text-right text-sm px-3 py-1 bg-gray-800 border border-gray-700 rounded-sm">
|
||||
<div className="min-w-[3.5rem] text-right text-sm px-3 py-1 bg-gray-950 dark:bg-gray-800 border border-gray-700 rounded-sm">
|
||||
{Number.isFinite(value) ? value : ''}
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user