mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2026-07-11 09:41:10 +08:00
Fix bugs
This commit is contained in:
parent
141f1fbb54
commit
a942241c56
@ -140,7 +140,7 @@ class Subfix:
|
||||
|
||||
def next_page(self, index: int):
|
||||
batch_size = self.batch_size
|
||||
max_index = self.max_index - batch_size + 1
|
||||
max_index = max(self.max_index - batch_size + 1, 0)
|
||||
index = min(index + batch_size, max_index)
|
||||
return gr.Slider(value=index), *self.change_index(index)
|
||||
|
||||
@ -165,12 +165,13 @@ class Subfix:
|
||||
languages = input[len(input) // 2 :]
|
||||
if texts is None or languages is None:
|
||||
raise ValueError()
|
||||
for idx in range(index, min(index + batch_size, self.max_index)):
|
||||
print(index, min(index + batch_size, self.max_index))
|
||||
for idx in range(index, min(index + batch_size, self.max_index + 1)):
|
||||
self.transcriptions_list[idx][3] = texts[idx - index].strip().strip("\n")
|
||||
self.transcriptions_list[idx][2] = languages[idx - index]
|
||||
result = self.save_list()
|
||||
if isinstance(result, SubfixErr):
|
||||
gr.Warning(str(result.error), title="Subfix Error")
|
||||
gr.Warning(str(result.error))
|
||||
print(result.tracebacks)
|
||||
|
||||
def merge_audio(self, index, *selected):
|
||||
@ -505,21 +506,30 @@ def main(list_path: str = "", i18n_lang="Auto", port=9871, share=False):
|
||||
with gr.Blocks(analytics_enabled=False) as app:
|
||||
subfix = Subfix(I18nAuto(i18n_lang))
|
||||
subfix.render(list_path=list_path)
|
||||
timer = gr.Timer(0.1)
|
||||
if subfix.max_index >= 0:
|
||||
timer = gr.Timer(0.1)
|
||||
|
||||
timer.tick(
|
||||
fn=lambda: (
|
||||
gr.Slider(maximum=subfix.max_index),
|
||||
gr.Slider(value=10),
|
||||
gr.Timer(active=False),
|
||||
),
|
||||
inputs=[],
|
||||
outputs=[
|
||||
subfix.index_slider,
|
||||
subfix.batch_size_slider,
|
||||
timer,
|
||||
],
|
||||
)
|
||||
timer.tick(
|
||||
fn=lambda: (
|
||||
gr.Slider(value=0, maximum=subfix.max_index, step=1),
|
||||
gr.Slider(value=10),
|
||||
gr.Timer(active=False),
|
||||
),
|
||||
inputs=[],
|
||||
outputs=[
|
||||
subfix.index_slider,
|
||||
subfix.batch_size_slider,
|
||||
timer,
|
||||
],
|
||||
)
|
||||
else:
|
||||
timer = gr.Timer(2)
|
||||
|
||||
timer.tick(
|
||||
fn=lambda x: (_ for _ in ()).throw(gr.Error("Invalid List")) if x is None else None,
|
||||
inputs=[],
|
||||
outputs=[],
|
||||
)
|
||||
app.queue().launch(
|
||||
server_name="0.0.0.0",
|
||||
inbrowser=True,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user