Skip to content

Commit 46802dc

Browse files
authored
Merge pull request transformerlab#778 from transformerlab/fix/audio-screen
Add no model is running pop-up upon model disconnection to audio screen
2 parents 7d2bcf1 + a2157c6 commit 46802dc

File tree

1 file changed

+27
-0
lines changed
  • src/renderer/components/Experiment/Audio

1 file changed

+27
-0
lines changed

src/renderer/components/Experiment/Audio/Audio.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
DialogTitle,
2323
Divider,
2424
Card,
25+
Alert,
2526
} from '@mui/joy';
2627
import { useAPI } from '../../../lib/transformerlab-api-sdk';
2728
import AudioHistory from './AudioHistory';
@@ -133,6 +134,8 @@ export default function Audio() {
133134
experimentInfo?.config?.foundation_model_architecture;
134135
const adaptor = experimentInfo?.config?.adaptor || '';
135136

137+
const { models } = chatAPI.useModelStatus();
138+
136139
// Fetch model config from gallery
137140
const processedModelId = currentModel
138141
? currentModel.replace(/\//g, '~~~')
@@ -257,6 +260,7 @@ export default function Audio() {
257260
flexDirection: 'column',
258261
height: '100%',
259262
overflow: 'hidden',
263+
position: 'relative',
260264
}}
261265
>
262266
{/* Top Header */}
@@ -518,6 +522,29 @@ export default function Audio() {
518522
<DialogTitle>Generation Settings</DialogTitle>
519523
</ModalDialog>
520524
</Modal>
525+
526+
{/* No Model Running Modal */}
527+
<Sheet
528+
sx={{
529+
position: 'absolute',
530+
top: '0%',
531+
left: '0%',
532+
zIndex: 10000,
533+
backgroundColor: 'var(--joy-palette-neutral-softBg)',
534+
opacity: 0.9,
535+
borderRadius: 'md',
536+
padding: 2,
537+
height: !models?.[0]?.id && experimentInfo ? '90dvh' : 'inherit',
538+
width: !models?.[0]?.id && experimentInfo ? '100dvh' : 'inherit',
539+
visibility: !models?.[0]?.id && experimentInfo ? 'visible' : 'hidden',
540+
}}
541+
>
542+
<Alert
543+
sx={{ position: 'relative', top: '50%', justifyContent: 'center' }}
544+
>
545+
No Model is Running
546+
</Alert>
547+
</Sheet>
521548
</Box>
522549
);
523550
}

0 commit comments

Comments
 (0)