MyApricity commited on
Commit
12f61eb
·
verified ·
1 Parent(s): bc8ab2f

Update src/main.py

Browse files
Files changed (1) hide show
  1. src/main.py +3 -3
src/main.py CHANGED
@@ -7,7 +7,7 @@ from pathlib import Path
7
  from PIL.JpegImagePlugin import JpegImageFile
8
  from pipelines.models import TextToImageRequest
9
 
10
- from pipeline import PipelineManager, TorchOptimizer
11
 
12
  SOCKET = abspath(Path(__file__).parent.parent / "inferences.sock")
13
 
@@ -15,7 +15,7 @@ SOCKET = abspath(Path(__file__).parent.parent / "inferences.sock")
15
  def main():
16
  print(f"Loading pipeline")
17
 
18
- pipeline_manager = PipelineManager()
19
 
20
  print(f"Pipeline loaded! , creating socket at '{SOCKET}'")
21
 
@@ -37,7 +37,7 @@ def main():
37
 
38
  return
39
 
40
- result = pipeline_manager.run_inference(request)
41
 
42
  data = BytesIO()
43
  image.save(data, format=JpegImageFile.format)
 
7
  from PIL.JpegImagePlugin import JpegImageFile
8
  from pipelines.models import TextToImageRequest
9
 
10
+ from pipeline import load_pipeline, infer
11
 
12
  SOCKET = abspath(Path(__file__).parent.parent / "inferences.sock")
13
 
 
15
  def main():
16
  print(f"Loading pipeline")
17
 
18
+ pipeline = load_pipeline()
19
 
20
  print(f"Pipeline loaded! , creating socket at '{SOCKET}'")
21
 
 
37
 
38
  return
39
 
40
+ result = infer(pipeline, request)
41
 
42
  data = BytesIO()
43
  image.save(data, format=JpegImageFile.format)