Remote Tunnel for ARM64 Linux (#1353)

* Update koboldcpp.py

* Fix style. Changed to double quotes to match.
This commit is contained in:
FlippFuzz 2025-02-08 01:16:30 +08:00 committed by GitHub
parent cf4d0085f6
commit 5a0ed19c96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4666,6 +4666,9 @@ def setuptunnel(global_memory, has_sd):
elif sys.platform=="darwin":
print("Starting Cloudflare Tunnel for MacOS, please wait...", flush=True)
tunnelproc = subprocess.Popen(f"./cloudflared tunnel --url {httpsaffix}://localhost:{args.port}", text=True, encoding='utf-8', shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
elif sys.platform == "linux" and platform.uname()[4] == "aarch64":
print("Starting Cloudflare Tunnel for ARM64 Linux, please wait...", flush=True)
tunnelproc = subprocess.Popen(f"./cloudflared-linux-arm64 tunnel --url {httpsaffix}://localhost:{args.port}", text=True, encoding='utf-8', shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
else:
print("Starting Cloudflare Tunnel for Linux, please wait...", flush=True)
tunnelproc = subprocess.Popen(f"./cloudflared-linux-amd64 tunnel --url {httpsaffix}://localhost:{args.port}", text=True, encoding='utf-8', shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
@ -4713,6 +4716,13 @@ def setuptunnel(global_memory, has_sd):
subprocess.run("curl -fL https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-darwin-amd64.tgz -o cloudflared-darwin-amd64.tgz", shell=True, capture_output=True, text=True, check=True, encoding='utf-8')
subprocess.run("tar -xzf cloudflared-darwin-amd64.tgz", shell=True)
subprocess.run("chmod +x 'cloudflared'", shell=True)
elif sys.platform == "linux" and platform.uname()[4] == "aarch64":
if os.path.exists("cloudflared-linux-arm64") and os.path.getsize("cloudflared-linux-arm64") > 1000000:
print("Cloudflared file exists, reusing it...")
else:
print("Downloading Cloudflare Tunnel for ARM64 Linux...")
subprocess.run("curl -fL https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64 -o cloudflared-linux-arm64", shell=True, capture_output=True, text=True, check=True, encoding='utf-8')
subprocess.run("chmod +x 'cloudflared-linux-arm64'", shell=True)
else:
if os.path.exists("cloudflared-linux-amd64") and os.path.getsize("cloudflared-linux-amd64") > 1000000:
print("Cloudflared file exists, reusing it...")