mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-02-02 16:23:58 +03:00
improve:onnx export
This commit is contained in:
parent
20e7a472be
commit
11756788aa
2
client/demo/dist/index.js
vendored
2
client/demo/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -249,7 +249,7 @@ export const CharacterArea = (_props: CharacterAreaProps) => {
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}, [selected, serverSetting.getOnnx, serverSetting.updateModelDefault]);
|
||||
}, [selected, serverSetting.getOnnx, serverSetting.updateModelDefault, guiState.isConverting]);
|
||||
|
||||
const characterArea = useMemo(() => {
|
||||
return (
|
||||
|
@ -211,7 +211,6 @@ class Pipeline(object):
|
||||
pitch_buffer = None
|
||||
|
||||
del pitch, pitchf, feats, sid
|
||||
torch.cuda.empty_cache()
|
||||
audio1 = self.resamplerOut(audio1.float())
|
||||
# print("[Timer::5: ]", t.secs)
|
||||
return audio1, pitch_buffer, feats_buffer
|
||||
|
@ -225,7 +225,15 @@ class RVC(VoiceChangerModel):
|
||||
print("[Voice Changer] export2onnx, No pyTorch filepath.")
|
||||
return {"status": "ng", "path": ""}
|
||||
|
||||
if self.pipeline is not None:
|
||||
del self.pipeline
|
||||
self.pipeline = None
|
||||
|
||||
torch.cuda.empty_cache()
|
||||
self.initialize()
|
||||
|
||||
output_file_simple = export2onnx(self.settings.gpu, modelSlot)
|
||||
|
||||
return {
|
||||
"status": "ok",
|
||||
"path": f"/tmp/{output_file_simple}",
|
||||
|
@ -12,7 +12,7 @@ class VoRASInferencer(Inferencer):
|
||||
super().setProps(EnumInferenceTypes.pyTorchVoRASbeta, file, False, gpu)
|
||||
|
||||
dev = DeviceManager.get_instance().getDevice(gpu)
|
||||
self.isHalf = False # DeviceManager.get_instance().halfPrecisionAvailable(gpu)
|
||||
self.isHalf = False # DeviceManager.get_instance().halfPrecisionAvailable(gpu)
|
||||
|
||||
cpt = torch.load(file, map_location="cpu")
|
||||
model = Synthesizer(**cpt["params"])
|
||||
|
@ -138,7 +138,6 @@ class SynthesizerTrnMsNSFsid(nn.Module):
|
||||
return o, x_mask, (z, z_p, m_p, logs_p)
|
||||
|
||||
|
||||
|
||||
class SynthesizerTrnMsNSFsidNono(nn.Module):
|
||||
def __init__(self, spec_channels, segment_size, inter_channels, hidden_channels, filter_channels, n_heads, n_layers, kernel_size, p_dropout, resblock, resblock_kernel_sizes, resblock_dilation_sizes, upsample_rates, upsample_initial_channel, upsample_kernel_sizes, spk_embed_dim, gin_channels, emb_channels, sr=None, **kwargs):
|
||||
super().__init__()
|
||||
|
@ -243,7 +243,7 @@ class Pipeline(object):
|
||||
pitchf_buffer = None
|
||||
|
||||
del p_len, pitch, pitchf, feats
|
||||
torch.cuda.empty_cache()
|
||||
# torch.cuda.empty_cache()
|
||||
|
||||
# inferで出力されるサンプリングレートはモデルのサンプリングレートになる。
|
||||
# pipelineに(入力されるときはhubertように16k)
|
||||
@ -253,5 +253,11 @@ class Pipeline(object):
|
||||
audio1 = audio1[offset:end]
|
||||
|
||||
del sid
|
||||
torch.cuda.empty_cache()
|
||||
# torch.cuda.empty_cache()
|
||||
return audio1, pitchf_buffer, feats_buffer
|
||||
|
||||
def __del__(self):
|
||||
del self.embedder
|
||||
del self.inferencer
|
||||
del self.pitchExtractor
|
||||
print('Pipeline has been deleted')
|
||||
|
Loading…
Reference in New Issue
Block a user