Update handler.py
Browse files- handler.py +4 -4
handler.py
CHANGED
|
@@ -19,11 +19,11 @@ class EndpointHandler():
|
|
| 19 |
|
| 20 |
def __call__(self, data:Any) -> List[List[Dict[str, float]]]:
|
| 21 |
print(data)
|
| 22 |
-
|
| 23 |
-
print(inputs)
|
| 24 |
-
|
| 25 |
with autocast(device.type):
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
|
| 28 |
buffered = BytesIO()
|
| 29 |
image.save(buffered, format="JPEG")
|
|
|
|
| 19 |
|
| 20 |
def __call__(self, data:Any) -> List[List[Dict[str, float]]]:
|
| 21 |
print(data)
|
| 22 |
+
print(device)
|
|
|
|
|
|
|
| 23 |
with autocast(device.type):
|
| 24 |
+
print("feeding prompt into model");
|
| 25 |
+
image = self.pipe(prompt=data, guidance_scale=7.5).images[0]
|
| 26 |
+
print("model response" generated);
|
| 27 |
|
| 28 |
buffered = BytesIO()
|
| 29 |
image.save(buffered, format="JPEG")
|