mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-02 16:45:15 -07:00
Refactor ProviderSettings component for improved readability and maintainability
- Removed unnecessary line breaks in the rendering of radio buttons and labels for a cleaner code structure. - Added missing imports for numpy and scipy in build_binary.py to ensure proper functionality. - Updated binary Assets.car file to reflect recent changes.
This commit is contained in:
@@ -13,7 +13,6 @@ import {
|
|||||||
AlertDialogHeader,
|
AlertDialogHeader,
|
||||||
AlertDialogTitle,
|
AlertDialogTitle,
|
||||||
} from '@/components/ui/alert-dialog';
|
} from '@/components/ui/alert-dialog';
|
||||||
import { Badge } from '@/components/ui/badge';
|
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
@@ -205,11 +204,7 @@ export function ProviderSettings() {
|
|||||||
className={`flex items-center justify-between py-2 ${isMacOS() ? 'opacity-50' : ''}`}
|
className={`flex items-center justify-between py-2 ${isMacOS() ? 'opacity-50' : ''}`}
|
||||||
>
|
>
|
||||||
<div className="flex items-center space-x-3 flex-1">
|
<div className="flex items-center space-x-3 flex-1">
|
||||||
<RadioGroupItem
|
<RadioGroupItem value="pytorch-cuda" id="cuda" disabled={isMacOS() || isStarting} />
|
||||||
value="pytorch-cuda"
|
|
||||||
id="cuda"
|
|
||||||
disabled={isMacOS() || isStarting}
|
|
||||||
/>
|
|
||||||
<Label
|
<Label
|
||||||
htmlFor="cuda"
|
htmlFor="cuda"
|
||||||
className={`flex-1 ${isMacOS() || isStarting ? 'cursor-not-allowed' : 'cursor-pointer'}`}
|
className={`flex-1 ${isMacOS() || isStarting ? 'cursor-not-allowed' : 'cursor-pointer'}`}
|
||||||
@@ -265,7 +260,10 @@ export function ProviderSettings() {
|
|||||||
<div className="flex items-center justify-between py-2">
|
<div className="flex items-center justify-between py-2">
|
||||||
<div className="flex items-center space-x-3 flex-1">
|
<div className="flex items-center space-x-3 flex-1">
|
||||||
<RadioGroupItem value="pytorch-cpu" id="cpu" disabled={isStarting} />
|
<RadioGroupItem value="pytorch-cpu" id="cpu" disabled={isStarting} />
|
||||||
<Label htmlFor="cpu" className={`flex-1 ${isStarting ? 'cursor-not-allowed' : 'cursor-pointer'}`}>
|
<Label
|
||||||
|
htmlFor="cpu"
|
||||||
|
className={`flex-1 ${isStarting ? 'cursor-not-allowed' : 'cursor-pointer'}`}
|
||||||
|
>
|
||||||
<div className="font-medium">PyTorch CPU</div>
|
<div className="font-medium">PyTorch CPU</div>
|
||||||
<div className="text-sm text-muted-foreground">
|
<div className="text-sm text-muted-foreground">
|
||||||
Works on any system, slower inference
|
Works on any system, slower inference
|
||||||
@@ -317,7 +315,10 @@ export function ProviderSettings() {
|
|||||||
{isMacOS() && (
|
{isMacOS() && (
|
||||||
<div className="flex items-center space-x-3 py-2">
|
<div className="flex items-center space-x-3 py-2">
|
||||||
<RadioGroupItem value="apple-mlx" id="mlx" disabled={isStarting} />
|
<RadioGroupItem value="apple-mlx" id="mlx" disabled={isStarting} />
|
||||||
<Label htmlFor="mlx" className={`flex-1 ${isStarting ? 'cursor-not-allowed' : 'cursor-pointer'}`}>
|
<Label
|
||||||
|
htmlFor="mlx"
|
||||||
|
className={`flex-1 ${isStarting ? 'cursor-not-allowed' : 'cursor-pointer'}`}
|
||||||
|
>
|
||||||
<div className="font-medium">MLX (Apple Silicon)</div>
|
<div className="font-medium">MLX (Apple Silicon)</div>
|
||||||
<div className="text-sm text-muted-foreground">
|
<div className="text-sm text-muted-foreground">
|
||||||
Bundled with the app - optimized for M-series chips
|
Bundled with the app - optimized for M-series chips
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ def build_server():
|
|||||||
'--hidden-import', 'backend.utils.progress',
|
'--hidden-import', 'backend.utils.progress',
|
||||||
'--hidden-import', 'backend.utils.hf_progress',
|
'--hidden-import', 'backend.utils.hf_progress',
|
||||||
'--hidden-import', 'backend.utils.validation',
|
'--hidden-import', 'backend.utils.validation',
|
||||||
|
'--hidden-import', 'numpy',
|
||||||
|
'--hidden-import', 'numpy.core',
|
||||||
|
'--hidden-import', 'numpy.core._multiarray_umath',
|
||||||
|
'--hidden-import', 'scipy',
|
||||||
|
'--hidden-import', 'scipy.signal',
|
||||||
'--hidden-import', 'fastapi',
|
'--hidden-import', 'fastapi',
|
||||||
'--hidden-import', 'uvicorn',
|
'--hidden-import', 'uvicorn',
|
||||||
'--hidden-import', 'sqlalchemy',
|
'--hidden-import', 'sqlalchemy',
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user