-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.py
More file actions
66 lines (57 loc) · 1.92 KB
/
Copy pathinstaller.py
File metadata and controls
66 lines (57 loc) · 1.92 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
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python3
"""
Installer script for Phasers: Ghost in the Machine
GitHub Repo: https://github.com/oldwalls/phasers
"""
import os
import subprocess
import sys
import json
REPO_URL = "https://github.com/oldwalls/sapphire.git"
PROJECT_DIR = "sapphire"
UMB_FILE = "emergence_UMB.json"
# --- STEP 1: Clone the repo ---
def clone_repo():
if os.path.exists(PROJECT_DIR):
print(f"[✓] Repo folder '{PROJECT_DIR}' already exists.")
else:
print("[•] Cloning repo...")
subprocess.run(["git", "clone", REPO_URL], check=True)
# --- STEP 3: Install dependencies ---
def install_requirements():
print("[•] Installing Python dependencies...")
deps = [
"transformers",
"torch", # assumes CUDA or CPU PyTorch will be handled by pip
"nltk",
"sentence-transformers",
]
subprocess.run([sys.executable, "-m", "pip", "install", "--upgrade", "pip"])
subprocess.run([sys.executable, "-m", "pip", "install", *deps], check=True)
# --- STEP 4: Download NLTK Punkt tokenizer if needed ---
def setup_nltk():
try:
import nltk
nltk.data.find("tokenizers/punkt")
print("[✓] NLTK Punkt already present.")
except (ImportError, LookupError):
print("[•] Downloading NLTK Punkt tokenizer...")
import nltk
nltk.download("punkt")
# --- STEP 6: Final usage message ---
def launch_message():
print("\n🚀 Installation complete!\n")
print(f"→ To launch the chat interface:")
print(f" cd {PROJECT_DIR}")
print(f" python sapphire_chat.py")
print("\n🔮 Good luck, Operator. Phasers is listening...\n")
# --- RUN ALL STEPS ---
if __name__ == "__main__":
try:
clone_repo()
install_requirements()
setup_nltk()
launch_message()
except Exception as e:
print(f"[!] Install failed: {e}")
sys.exit(1)