Skip to content

Commit

Permalink
Show error when model fails to load
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ckoates committed Jul 3, 2024
1 parent 53f6bd3 commit 08477ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ export default function Home() {

{vad.loading ? (
<p>Loading speech detection...</p>
) : vad.errored ? (
<p>Failed to load speech detection.</p>
) : (
<p>Start talking to chat.</p>
)}
Expand All @@ -177,8 +179,9 @@ export default function Home() {
className={clsx(
"absolute size-36 blur-3xl rounded-full bg-gradient-to-b from-red-200 to-red-400 dark:from-red-600 dark:to-red-800 -z-50 transition ease-in-out",
{
"opacity-0": vad.loading,
"opacity-30": !vad.userSpeaking && !vad.loading,
"opacity-0": vad.loading || vad.errored,
"opacity-30":
!vad.loading && !vad.errored && !vad.userSpeaking,
"opacity-100 scale-110": vad.userSpeaking,
}
)}
Expand Down

0 comments on commit 08477ea

Please sign in to comment.