👍️[Update] Model : cuda版のsoftwareをダウンロードできるようにendpointを追加

This commit is contained in:
misyaguziya
2024-11-05 00:46:45 +09:00
parent 21bd59c915
commit 8d9013ef51
3 changed files with 29 additions and 0 deletions

View File

@@ -357,6 +357,28 @@ class Model:
# run updater
Popen(program_name, cwd=current_directory)
@staticmethod
def updateCudaSoftware():
# try to update at most 5 times
for _ in range(5):
try:
program_name = "update.exe"
current_directory = config.PATH_LOCAL
res = requests_get(config.UPDATER_URL)
assets = res.json()['assets']
url = [i["browser_download_url"] for i in assets if i["name"] == program_name][0]
res = requests_get(url, stream=True)
with open(os_path.join(current_directory, program_name), 'wb') as file:
for chunk in res.iter_content(chunk_size=1024*5):
file.write(chunk)
break
except Exception:
import traceback
with open('error.log', 'a') as f:
traceback.print_exc(file=f)
# run updater
Popen([program_name, "--cuda"], cwd=current_directory)
def getListMicHost(self):
result = [host for host in device_manager.getMicDevices().keys()]
return result