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 4
4
import sys
5
5
import time
6
6
import inquirer
7
+ import psutil
8
+ import wget
7
9
from interpreter import interpreter
8
10
9
-
10
11
def get_ram ():
11
- import psutil
12
-
13
12
total_ram = psutil .virtual_memory ().total / (
14
13
1024 * 1024 * 1024
15
14
) # Convert bytes to GB
16
15
return total_ram
17
16
18
17
def 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
-
24
18
# Get RAM and disk information
25
19
total_ram = get_ram ()
26
20
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):
145
145
146
146
def apply_profile (interpreter , profile , profile_path ):
147
147
if "start_script" in profile :
148
- exec (profile ["start_script" ])
148
+ scope = {"interpreter" : interpreter }
149
+ exec (profile ["start_script" ], scope , scope )
149
150
150
151
if (
151
152
"version" not in profile or profile ["version" ] != OI_VERSION
You can’t perform that action at this time.
0 commit comments