AlexNijjar commited on
Commit
fcd4555
·
unverified ·
1 Parent(s): aa65bc3

Log socket location

Browse files
Files changed (1) hide show
  1. src/main.py +4 -2
src/main.py CHANGED
@@ -1,6 +1,7 @@
1
  from io import BytesIO
2
  from multiprocessing.connection import Listener
3
  from os import chmod
 
4
  from pathlib import Path
5
 
6
  from PIL.JpegImagePlugin import JpegImageFile
@@ -8,7 +9,7 @@ from pipelines.models import TextToImageRequest
8
 
9
  from pipeline import load_pipeline, infer
10
 
11
- SOCKET = Path(__file__).parent / "inferences.sock"
12
 
13
 
14
  def main():
@@ -17,7 +18,8 @@ def main():
17
 
18
  print(f"Pipeline loaded")
19
 
20
- with Listener(str(SOCKET)) as listener:
 
21
  chmod(SOCKET, 0o777)
22
 
23
  print(f"Awaiting connections")
 
1
  from io import BytesIO
2
  from multiprocessing.connection import Listener
3
  from os import chmod
4
+ from os.path import abspath
5
  from pathlib import Path
6
 
7
  from PIL.JpegImagePlugin import JpegImageFile
 
9
 
10
  from pipeline import load_pipeline, infer
11
 
12
+ SOCKET = abspath(Path(__file__).parent / "inferences.sock")
13
 
14
 
15
  def main():
 
18
 
19
  print(f"Pipeline loaded")
20
 
21
+ print(f"Creating socket at '{SOCKET}'")
22
+ with Listener(SOCKET) as listener:
23
  chmod(SOCKET, 0o777)
24
 
25
  print(f"Awaiting connections")