mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
Remote Tunnel for ARM64 Linux (#1353)
* Update koboldcpp.py * Fix style. Changed to double quotes to match.
This commit is contained in:
parent
cf4d0085f6
commit
5a0ed19c96
1 changed files with 10 additions and 0 deletions
10
koboldcpp.py
10
koboldcpp.py
|
@ -4666,6 +4666,9 @@ def setuptunnel(global_memory, has_sd):
|
||||||
elif sys.platform=="darwin":
|
elif sys.platform=="darwin":
|
||||||
print("Starting Cloudflare Tunnel for MacOS, please wait...", flush=True)
|
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)
|
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:
|
else:
|
||||||
print("Starting Cloudflare Tunnel for Linux, please wait...", flush=True)
|
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)
|
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("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("tar -xzf cloudflared-darwin-amd64.tgz", shell=True)
|
||||||
subprocess.run("chmod +x 'cloudflared'", 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:
|
else:
|
||||||
if os.path.exists("cloudflared-linux-amd64") and os.path.getsize("cloudflared-linux-amd64") > 1000000:
|
if os.path.exists("cloudflared-linux-amd64") and os.path.getsize("cloudflared-linux-amd64") > 1000000:
|
||||||
print("Cloudflared file exists, reusing it...")
|
print("Cloudflared file exists, reusing it...")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue