-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
80 lines (64 loc) · 1.79 KB
/
Copy pathsetup.py
File metadata and controls
80 lines (64 loc) · 1.79 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import os
import platform
TRINETRA_ART = r'''
_____
_.-' `'-._
,' '.
/ \
| ___________ |
| | | |
| | ( ) | |
| |___________| 👁️ |
\ /
'. ,'
'-.._______.-'
Trinetra watches everything
'''
def generate_unix_script():
script = f'''#!/bin/bash
# Create and activate the Conda environment
conda create --name trinetra python=3.8 -y
source activate trinetra
# Install requirements
pip install -r requirements.txt
# Install CLIP
pip install git+https://github.com/openai/CLIP.git
echo "Trinetra environment setup complete!"
# Display Trinetra ASCII art
cat << EOT
{TRINETRA_ART}
EOT
'''
with open('setup_trinetra.sh', 'w') as f:
f.write(script)
os.chmod('setup_trinetra.sh', 0o755)
print("Generated setup_trinetra.sh")
print("Run './setup_trinetra.sh' to set up the environment")
def generate_windows_script():
script = f'''@echo off
REM Create and activate the Conda environment
call conda create --name trinetra python=3.8 -y
call conda activate trinetra
REM Install requirements
pip install -r requirements.txt
REM Install CLIP
pip install git+https://github.com/openai/CLIP.git
echo Trinetra environment setup complete!
REM Display Trinetra ASCII art
echo.
echo {TRINETRA_ART.replace('"', '^"')}
echo.
pause
'''
with open('setup_trinetra.bat', 'w') as f:
f.write(script)
print("Generated setup_trinetra.bat")
print("Run 'setup_trinetra.bat' to set up the environment")
if __name__ == "__main__":
system = platform.system()
if system == "Windows":
generate_windows_script()
elif system in ["Linux", "Darwin"]:
generate_unix_script()
else:
print(f"Unsupported operating system: {system}")