File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
- pytorch-CycleGAN-and-pix2pix
1
+ _notebook_workspace
2
2
checkpoints
3
3
screenlog.0
Original file line number Diff line number Diff line change 4
4
from ray import serve
5
5
import signal
6
6
import sys
7
- import pathlib
7
+ from pathlib import Path
8
8
9
- ML_SERVER_DIR = pathlib .Path (__file__ ).parent .absolute ()
10
9
10
+ ML_SERVER_DIR = Path (__file__ ).parent .absolute ()
11
+ NOTEBOOK_WORKING_DIR = ML_SERVER_DIR / "_notebook_workspace"
11
12
logger = logging .getLogger (__name__ )
12
13
logger .setLevel (logging .INFO )
13
14
@@ -37,6 +38,7 @@ def transfer_style(flask_request):
37
38
notebook_path_or_url ,
38
39
all_param_dict ["RESULTED_NOTEBOOK_PATH_OR_URL" ],
39
40
nb_param_dict ,
41
+ cwd = NOTEBOOK_WORKING_DIR ,
40
42
)
41
43
_ = ray .get (obj_ref )
42
44
@@ -55,6 +57,8 @@ def signal_handler(sig, frame):
55
57
ray .shutdown ()
56
58
_ = ray .init (num_cpus = 8 , num_gpus = 1 )
57
59
60
+ Path .mkdir (NOTEBOOK_WORKING_DIR , exist_ok = True )
61
+
58
62
HTTP_OPTIONS = {"host" : "0.0.0.0" , "port" : 8000 }
59
63
60
64
client = serve .start (http_host = HTTP_OPTIONS ["host" ], http_port = HTTP_OPTIONS ["port" ])
You can’t perform that action at this time.
0 commit comments