File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
interpreter/terminal_interface/profiles Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 44import sys
55import time
66import inquirer
7+ import psutil
8+ import wget
79from interpreter import interpreter
810
9-
1011def get_ram ():
11- import psutil
12-
1312 total_ram = psutil .virtual_memory ().total / (
1413 1024 * 1024 * 1024
1514 ) # Convert bytes to GB
1615 return total_ram
1716
1817def download_model (models_dir , models , interpreter ):
19- # For some reason, these imports need to be inside the function
20- import inquirer
21- import psutil
22- import wget
23-
2418 # Get RAM and disk information
2519 total_ram = get_ram ()
2620 free_disk_space = psutil .disk_usage ("/" ).free / (
Original file line number Diff line number Diff line change @@ -145,7 +145,8 @@ def visit_Assign(self, node):
145145
146146def apply_profile (interpreter , profile , profile_path ):
147147 if "start_script" in profile :
148- exec (profile ["start_script" ])
148+ scope = {"interpreter" : interpreter }
149+ exec (profile ["start_script" ], scope , scope )
149150
150151 if (
151152 "version" not in profile or profile ["version" ] != OI_VERSION
You can’t perform that action at this time.
0 commit comments