MyApricity commited on
Commit
ad29a1a
·
verified ·
1 Parent(s): 13612f3

Update src/main.py

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