Update src/main.py
Browse files- 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
|
11 |
|
12 |
SOCKET = abspath(Path(__file__).parent.parent / "inferences.sock")
|
13 |
|
14 |
|
15 |
def main():
|
16 |
print(f"Loading pipeline")
|
17 |
-
|
|
|
18 |
|
19 |
print(f"Pipeline loaded! , creating socket at '{SOCKET}'")
|
20 |
|
@@ -36,7 +37,7 @@ def main():
|
|
36 |
|
37 |
return
|
38 |
|
39 |
-
|
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)
|