File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ Run LLM models using either OpenCL or PTX backends.
5
5
"""
6
6
7
7
import argparse
8
+ import glob
8
9
import os
9
10
import subprocess
10
11
import sys
@@ -171,14 +172,32 @@ class LlamaRunner:
171
172
module_config .extend (
172
173
[
173
174
"-cp" ,
174
- f" { self .llama_root } /target/gpu-llama3-2.1.0-SNAPSHOT.jar" ,
175
+ self ._find_llama_jar () ,
175
176
"org.beehive.gpullama3.LlamaApp" ,
176
177
]
177
178
)
178
179
cmd .extend (module_config )
179
180
180
181
return cmd
181
182
183
+ def _find_llama_jar (self ) -> str :
184
+ """Find the LLaMA JAR file automatically using glob pattern."""
185
+ target_dir = f"{ self .llama_root } /target"
186
+ jar_pattern = f"{ target_dir } /gpu-llama3-*-SNAPSHOT.jar"
187
+ jar_files = glob .glob (jar_pattern )
188
+
189
+ if not jar_files :
190
+ # Fallback: try any gpu-llama3 jar
191
+ jar_pattern = f"{ target_dir } /gpu-llama3-*.jar"
192
+ jar_files = glob .glob (jar_pattern )
193
+
194
+ if not jar_files :
195
+ raise FileNotFoundError (f"No gpu-llama3 JAR file found in { target_dir } " )
196
+
197
+ # Sort to get the latest version if multiple exist
198
+ jar_files .sort (reverse = True )
199
+ return jar_files [0 ]
200
+
182
201
def _add_llama_args (self , cmd : List [str ], args : argparse .Namespace ) -> List [str ]:
183
202
"""Add LLaMA-specific arguments to the command."""
184
203
llama_args = [
You can’t perform that action at this time.
0 commit comments