-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_project.py
More file actions
53 lines (47 loc) · 1.87 KB
/
Copy pathsetup_project.py
File metadata and controls
53 lines (47 loc) · 1.87 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
49
50
51
52
53
import subprocess
import sys
import os
def setup():
"""
One-command setup for the Movie Reasoning Agent.
1. Installs dependencies from requirements.txt
"""
print("\n" + "="*60)
print(" MOVIE REASONING AGENT: ONE-COMMAND SETUP ".center(60, "="))
print("="*60)
# 1. Create Virtual Environment
print(f"\n[1/2] Creating virtual environment (venv)...")
try:
if not os.path.exists("venv"):
subprocess.check_call([sys.executable, "-m", "venv", "venv"])
print(">>> SUCCESS: venv created.")
else:
print(">>> venv already exists. Skipping creation.")
except Exception as e:
print(f"!!! Error creating venv: {e}")
return
# Determine venv python path
if os.name == "nt": # Windows
venv_python = os.path.join("venv", "Scripts", "python.exe")
else: # Unix/MacOS
venv_python = os.path.join("venv", "bin", "python")
# 2. Install Dependencies
print(f"\n[2/2] Installing dependencies into venv...")
try:
subprocess.check_call([venv_python, "-m", "pip", "install", "-r", "requirements.txt"])
print(">>> SUCCESS: Dependencies installed.")
except Exception as e:
print(f"!!! Error installing dependencies: {e}")
print(">>> Proceeding...")
print("\n" + "="*60)
print(" SETUP COMPLETE ".center(60, "="))
print("="*60)
print("\n\nYou can now run the agent (ensure venv is activated):")
print(" Windows: .\\venv\\Scripts\\activate")
print(" MacOS/Linux: source venv/bin/activate")
print(" python agent/agent_loop.py")
print("\nPlease create a '.env' file and add necessary API keys, you can still run the evaluation set using the cached data.")
print("\nOr run the evaluation suite: [with cache enabled for results]")
print(" python task_D_20eval_test.py")
if __name__ == "__main__":
setup()