Update src/main.py
Browse files- 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
|
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 |
-
|
19 |
|
20 |
print(f"Pipeline loaded! , creating socket at '{SOCKET}'")
|
21 |
|
@@ -37,7 +37,7 @@ def main():
|
|
37 |
|
38 |
return
|
39 |
|
40 |
-
result =
|
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)
|