Skip to content

Commit 6750f6b

Browse files
committed
Update quick_benchmark_test.py
1 parent 9191687 commit 6750f6b

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

examples/mlx_metal_kernel_opt/quick_benchmark_test.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import os
66
import sys
77

8-
sys.path.append("/Users/asankhaya/Documents/GitHub/openevolve/examples/mlx_metal_kernel_opt")
8+
# Add current directory to path for local imports
9+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
910

1011
from qwen3_benchmark_suite import Qwen3BenchmarkSuite, BenchmarkConfig
1112

@@ -41,17 +42,7 @@ def run_quick_test():
4142
),
4243
]
4344

44-
# Change to mlx-lm directory
45-
original_dir = os.getcwd()
46-
mlx_lm_dir = "/Users/asankhaya/Documents/GitHub/mlx-lm"
47-
48-
if os.path.exists(mlx_lm_dir):
49-
os.chdir(mlx_lm_dir)
50-
print(f"Changed to mlx-lm directory: {mlx_lm_dir}")
51-
else:
52-
print(f"Error: mlx-lm directory not found at {mlx_lm_dir}")
53-
return
54-
45+
# Use mlx-lm as installed package (no need to change directories)
5546
try:
5647
benchmark_suite = Qwen3BenchmarkSuite()
5748

@@ -105,8 +96,9 @@ def run_quick_test():
10596

10697
return results
10798

108-
finally:
109-
os.chdir(original_dir)
99+
except Exception as e:
100+
print(f"Error running benchmarks: {e}")
101+
return None
110102

111103

112104
if __name__ == "__main__":

0 commit comments

Comments
 (0)