Spaces:
Running
Running
jhj0517
commited on
Commit
·
f137136
1
Parent(s):
25f5dd6
Add missing parameter
Browse files
modules/whisper/data_classes.py
CHANGED
@@ -87,6 +87,7 @@ class VadParams(BaseParams):
|
|
87 |
class DiarizationParams(BaseParams):
|
88 |
"""Speaker diarization parameters"""
|
89 |
is_diarize: bool = Field(default=False, description="Enable speaker diarization")
|
|
|
90 |
hf_token: str = Field(
|
91 |
default="",
|
92 |
description="Hugging Face token for downloading diarization models"
|
@@ -95,8 +96,7 @@ class DiarizationParams(BaseParams):
|
|
95 |
@classmethod
|
96 |
def to_gradio_inputs(cls,
|
97 |
defaults: Optional[Dict] = None,
|
98 |
-
available_devices: Optional[List] = None
|
99 |
-
device: Optional[str] = None) -> List[gr.components.base.FormComponent]:
|
100 |
return [
|
101 |
gr.Checkbox(
|
102 |
label=_("Enable Diarization"),
|
@@ -111,7 +111,7 @@ class DiarizationParams(BaseParams):
|
|
111 |
gr.Dropdown(
|
112 |
label=_("Device"),
|
113 |
choices=["cpu", "cuda"] if available_devices is None else available_devices,
|
114 |
-
value="
|
115 |
info=_("Device to run diarization model")
|
116 |
)
|
117 |
]
|
@@ -124,6 +124,7 @@ class BGMSeparationParams(BaseParams):
|
|
124 |
default="UVR-MDX-NET-Inst_HQ_4",
|
125 |
description="UVR model size"
|
126 |
)
|
|
|
127 |
segment_size: int = Field(
|
128 |
default=256,
|
129 |
gt=0,
|
@@ -142,7 +143,6 @@ class BGMSeparationParams(BaseParams):
|
|
142 |
def to_gradio_input(cls,
|
143 |
defaults: Optional[Dict] = None,
|
144 |
available_devices: Optional[List] = None,
|
145 |
-
device: Optional[str] = None,
|
146 |
available_models: Optional[List] = None) -> List[gr.components.base.FormComponent]:
|
147 |
return [
|
148 |
gr.Checkbox(
|
@@ -154,7 +154,7 @@ class BGMSeparationParams(BaseParams):
|
|
154 |
gr.Dropdown(
|
155 |
label=_("Device"),
|
156 |
choices=["cpu", "cuda"] if available_devices is None else available_devices,
|
157 |
-
value="
|
158 |
info=_("Device to run UVR model")
|
159 |
),
|
160 |
gr.Dropdown(
|
|
|
87 |
class DiarizationParams(BaseParams):
|
88 |
"""Speaker diarization parameters"""
|
89 |
is_diarize: bool = Field(default=False, description="Enable speaker diarization")
|
90 |
+
device: str = Field(default="cuda", description="Device to run Diarization model.")
|
91 |
hf_token: str = Field(
|
92 |
default="",
|
93 |
description="Hugging Face token for downloading diarization models"
|
|
|
96 |
@classmethod
|
97 |
def to_gradio_inputs(cls,
|
98 |
defaults: Optional[Dict] = None,
|
99 |
+
available_devices: Optional[List] = None) -> List[gr.components.base.FormComponent]:
|
|
|
100 |
return [
|
101 |
gr.Checkbox(
|
102 |
label=_("Enable Diarization"),
|
|
|
111 |
gr.Dropdown(
|
112 |
label=_("Device"),
|
113 |
choices=["cpu", "cuda"] if available_devices is None else available_devices,
|
114 |
+
value=defaults.get("device", cls.device),
|
115 |
info=_("Device to run diarization model")
|
116 |
)
|
117 |
]
|
|
|
124 |
default="UVR-MDX-NET-Inst_HQ_4",
|
125 |
description="UVR model size"
|
126 |
)
|
127 |
+
device: str = Field(default="cuda", description="Device to run UVR model.")
|
128 |
segment_size: int = Field(
|
129 |
default=256,
|
130 |
gt=0,
|
|
|
143 |
def to_gradio_input(cls,
|
144 |
defaults: Optional[Dict] = None,
|
145 |
available_devices: Optional[List] = None,
|
|
|
146 |
available_models: Optional[List] = None) -> List[gr.components.base.FormComponent]:
|
147 |
return [
|
148 |
gr.Checkbox(
|
|
|
154 |
gr.Dropdown(
|
155 |
label=_("Device"),
|
156 |
choices=["cpu", "cuda"] if available_devices is None else available_devices,
|
157 |
+
value=defaults.get("device", cls.device),
|
158 |
info=_("Device to run UVR model")
|
159 |
),
|
160 |
gr.Dropdown(
|