Zhibinhong
commited on
Commit
•
f17ad12
1
Parent(s):
8941627
Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
@@ -20,5 +20,5 @@ class EndpointHandler():
|
|
20 |
img = self.pipe(text).images[0]
|
21 |
img.save("./1.png")
|
22 |
with open('./1.png','rb') as img_file:
|
23 |
-
encoded_string = base64.b64encode(img_file.read())
|
24 |
return {'image':encoded_string}
|
|
|
20 |
img = self.pipe(text).images[0]
|
21 |
img.save("./1.png")
|
22 |
with open('./1.png','rb') as img_file:
|
23 |
+
encoded_string = base64.b64encode(img_file.read()).decode('utf-8')
|
24 |
return {'image':encoded_string}
|