Skip to content

Commit f1560bd

Browse files
committed
[feat-windows] Add support for running on Windows OS
1 parent fd7fa8e commit f1560bd

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

llama-tornado

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import os
99
import subprocess
1010
import sys
1111
import time
12+
import platform
1213
from pathlib import Path
1314
from typing import List, Optional, Dict, Any
1415
from enum import Enum
@@ -44,6 +45,11 @@ class LlamaRunner:
4445
print(f"Error: {name} path does not exist: {path}")
4546
sys.exit(1)
4647

48+
@staticmethod
49+
def module_path_colon_sep(paths: List[str]) -> str:
50+
"""Return OS-specific separator for Java module paths."""
51+
return ";".join(paths) if platform.system() == "Windows" else ":".join(paths)
52+
4753
def _build_base_command(self, args: argparse.Namespace) -> List[str]:
4854
"""Build the base Java command with JVM options."""
4955
cmd = [
@@ -56,7 +62,7 @@ class LlamaRunner:
5662
"--enable-preview",
5763
f"-Djava.library.path={self.tornado_sdk}/lib",
5864
"-Djdk.module.showModuleResolution=false",
59-
"--module-path", f".:{self.tornado_sdk}/share/java/tornado",
65+
"--module-path", self.module_path_colon_sep([".", f"{self.tornado_sdk}/share/java/tornado"]),
6066
]
6167

6268
# TornadoVM configuration

set_paths.cmd

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@echo off
2+
REM ============================================
3+
REM Environment setup script for LLaMA3 + TornadoVM (Windows)
4+
REM ============================================
5+
6+
REM Resolve the absolute path to this script's directory
7+
set "LLAMA_ROOT=%~dp0"
8+
set "LLAMA_ROOT=%LLAMA_ROOT:~0,-1%"
9+
10+
REM Set TornadoVM root and SDK paths
11+
set "TORNADO_ROOT=%LLAMA_ROOT%\external\tornadovm"
12+
set "TORNADO_SDK=%TORNADO_ROOT%\bin\sdk"
13+
14+
REM Add TornadoVM SDK and LLaMA3 bin to PATH
15+
set "PATH=%TORNADO_SDK%;%LLAMA_ROOT%\bin;%PATH%"
16+
17+
REM Optional: Set JAVA_HOME if needed
18+
REM set "JAVA_HOME=C:\Path\To\GraalVM"
19+
REM set "PATH=%JAVA_HOME%\bin;%PATH%"
20+
21+
echo [INFO] Environment configured for LLaMA3 with TornadoVM at: %TORNADO_ROOT%
22+
23+
REM ===== Notes =====
24+
REM After running this script:
25+
REM 1. TornadoVM will be available for GPU computation
26+
REM 2. LLaMA3 command-line tools will be in your PATH
27+
REM 3. You can run LLaMA3 with GPU acceleration using TornadoVM
28+
REM
29+
REM To use this script: call set_paths.cmd

0 commit comments

Comments
 (0)