some small bug fixed

This commit is contained in:
wataru 2023-02-21 17:54:02 +09:00
parent 34749d9d6a
commit 98db8862b5
8 changed files with 2652 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -238,6 +238,7 @@ export const useModelSettingArea = (): ServerSettingState => {
const onOnnxExecutionProviderChanged = async (val: OnnxExecutionProvider) => {
appState.serverSetting.updateServerSettings({ ...appState.serverSetting.serverSetting, onnxExecutionProvider: val })
}
console.log("setting", appState.serverSetting.serverSetting)
return (
<div className="body-row split-3-7 left-padding-1">
<div className="body-item-title left-padding-2">OnnxExecutionProvider</div>

View File

@ -1,12 +1,12 @@
{
"name": "@dannadori/voice-changer-client-js",
"version": "1.0.76",
"version": "1.0.77",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@dannadori/voice-changer-client-js",
"version": "1.0.76",
"version": "1.0.77",
"license": "ISC",
"dependencies": {
"@types/readable-stream": "^2.3.15",

View File

@ -1,6 +1,6 @@
{
"name": "@dannadori/voice-changer-client-js",
"version": "1.0.76",
"version": "1.0.77",
"description": "",
"main": "dist/index.js",
"directories": {

View File

@ -91,6 +91,11 @@ export const useServerSetting = (props: UseServerSettingProps): ServerSettingSta
const new_v = setting[k]
if (cur_v != new_v) {
const res = await props.voiceChangerClient.updateServerSettings(k, "" + new_v)
if (res.onnxExecutionProviders.length > 0) {
res.onnxExecutionProvider = res.onnxExecutionProviders[0]
} else {
res.onnxExecutionProvider = "CPUExecutionProvider"
}
setServerSetting(res)
const storeData = { ...res }

View File

@ -59,7 +59,7 @@ export const fileSelectorAsDataURL = async (regex: string) => {
export const validateUrl = (url: string) => {
if (url.endsWith("/")) {
if (url?.endsWith("/")) {
return url.substring(0, url.length - 1)
}
return url

View File

@ -205,7 +205,7 @@ class VoiceChanger():
def get_info(self):
data = asdict(self.settings)
data["onnxExecutionProvider"] = self.onnx_session.get_providers() if self.onnx_session != None else []
data["onnxExecutionProviders"] = self.onnx_session.get_providers() if self.onnx_session != None else []
files = ["configFile", "pyTorchModelFile", "onnxModelFile"]
for f in files:
if data[f] != None and os.path.exists(data[f]):