-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.py
More file actions
executable file
·48 lines (33 loc) · 1.12 KB
/
Copy pathrun.py
File metadata and controls
executable file
·48 lines (33 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
"""
Entry point for running this project without installing the package (optional).
python run.py # full benchmark — same as: llm-local-perf
python run.py --simple # microbenchmarks only
python run.py cursor [args] # same as: cursor-ollama
Requires dependencies from pyproject.toml (e.g. psutil); use a venv and pip install -e .
if imports fail.
"""
from __future__ import annotations
import sys
from pathlib import Path
def _ensure_src_path() -> None:
root = Path(__file__).resolve().parent
src = root / "src"
if src.is_dir():
s = str(src)
if s not in sys.path:
sys.path.insert(0, s)
def main() -> None:
_ensure_src_path()
argv = sys.argv[:]
if len(argv) > 1 and argv[1] == "cursor":
sys.argv = [argv[0]] + argv[2:]
from llm_local_perf.cursor_ollama import main as run_other
run_other()
return
if len(argv) > 1 and argv[1] == "perf":
sys.argv = [argv[0]] + argv[2:]
from llm_local_perf.__main__ import main as run_perf
run_perf()
if __name__ == "__main__":
main()