Change to load nitron on windows and linux from bash/shell script

This commit is contained in:
Service Account 2023-10-25 14:32:48 +07:00
parent ca0c5f571f
commit 1575406d9f
3 changed files with 18 additions and 2 deletions

View File

@ -34,14 +34,14 @@ const initModel = (fileName) => {
if (process.platform === "win32") {
// Todo: Need to check for CUDA support to switch between CUDA and non-CUDA binaries
binaryName = "nitro_windows_amd64_cuda.exe";
binaryName = "nitro_start_windows.bat";
} else if (process.platform === "darwin") {
// Mac OS platform
binaryName = process.arch === "arm64" ? "nitro_mac_arm64" : "nitro_mac_intel";
} else {
// Linux
// Todo: Need to check for CUDA support to switch between CUDA and non-CUDA binaries
binaryName = "nitro_linux_amd64_cuda"; // For other platforms
binaryName = "nitro_start_linux.sh"; // For other platforms
}
const binaryPath = path.join(binaryFolder, binaryName);

View File

@ -0,0 +1,6 @@
#!/bin/bash
#!/bin/bash
# Attempt to run the nitro_linux_amd64_cuda file and if it fails, run nitro_linux_amd64
./nitro_linux_amd64_cuda || (echo "nitro_linux_amd64_cuda encountered an error, attempting to run nitro_linux_amd64..." && ./nitro_linux_amd64)

View File

@ -0,0 +1,10 @@
@echo off
rem Attempt to run nitro_windows_amd64_cuda.exe
nitro_windows_amd64_cuda.exe
rem Check the exit code of the previous command
if %errorlevel% neq 0 (
echo nitro_windows_amd64_cuda.exe encountered an error, attempting to run nitro_windows_amd64.exe...
nitro_windows_amd64.exe
)