更新pythonAPI使其适配现版本

This commit is contained in:
DoyoDia
2023-07-09 21:10:40 +08:00
parent 3213c38c78
commit 355fe410cb
2 changed files with 6 additions and 2 deletions

View File

@@ -54,7 +54,7 @@ class Asst:
lib_import_func = ctypes.WinDLL
# 手动加载onnxruntime.dll以避免部分版本的python错误地从System32加载旧版本
try:
lib_import_func(str(pathlib.Path(path) / 'onnxruntime.dll'))
lib_import_func(str(pathlib.Path(path) / 'onnxruntime_maa.dll'))
except Exception as e:
print(e)
pass

View File

@@ -103,7 +103,11 @@ class Updater:
pre[0] = pre[0][1:]
if sub:
sub = sub.split('.')
sub = sub[:-1]
#舍弃版本类型后的字符,避免使用内测版本而出现字母无法转换成数字的情况 XD
for i in range(len(sub)):
if sub[i].startswith('alpha') or sub[i].startswith('beta') or sub[i].startswith('rc'):
sub = sub[:1]
break
if sub[0] == 'alpha':
sub[0] = '1'
elif sub[0] == 'beta':