Quoc Bao Bui
commited on
Commit
·
80ac413
1
Parent(s):
e5e883d
Add debug log, change directory
Browse files- handler.py +3 -1
handler.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import base64
|
| 2 |
from io import BytesIO
|
| 3 |
from typing import Dict, List, Any
|
|
|
|
| 4 |
|
| 5 |
import torch
|
| 6 |
from PIL import Image
|
|
@@ -16,7 +17,8 @@ def decode_base64_image(image_string):
|
|
| 16 |
|
| 17 |
class EndpointHandler:
|
| 18 |
def __init__(self, path=""):
|
| 19 |
-
|
|
|
|
| 20 |
self.pipe = self.pipe.to("cuda")
|
| 21 |
|
| 22 |
def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
|
|
|
|
| 1 |
import base64
|
| 2 |
from io import BytesIO
|
| 3 |
from typing import Dict, List, Any
|
| 4 |
+
import os
|
| 5 |
|
| 6 |
import torch
|
| 7 |
from PIL import Image
|
|
|
|
| 17 |
|
| 18 |
class EndpointHandler:
|
| 19 |
def __init__(self, path=""):
|
| 20 |
+
print(list(os.walk(".")))
|
| 21 |
+
self.pipe = StableDiffusionPipeline.from_pretrained("/repository/stable-diffusion-v1-5")
|
| 22 |
self.pipe = self.pipe.to("cuda")
|
| 23 |
|
| 24 |
def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
|