Spaces:
Running
Running
add logger
Browse files
main.py
CHANGED
@@ -3,7 +3,7 @@ from fastapi import FastAPI,Body
|
|
3 |
|
4 |
import uvicorn
|
5 |
import json
|
6 |
-
|
7 |
from PIL import Image
|
8 |
import time
|
9 |
from constants import DESCRIPTION, LOGO
|
@@ -56,7 +56,9 @@ async def predict(prompt=Body(...),imgbase64data=Body(...),userId=Body(None)):
|
|
56 |
print("s生成完成:", end2 - end1)
|
57 |
# 将图片对象转换为bytes
|
58 |
output_image_base64 = base64.b64encode(output_image.tobytes()).decode()
|
59 |
-
print("完成的图片:", output_image_base64)
|
|
|
|
|
60 |
return output_image_base64
|
61 |
|
62 |
|
|
|
3 |
|
4 |
import uvicorn
|
5 |
import json
|
6 |
+
import logging
|
7 |
from PIL import Image
|
8 |
import time
|
9 |
from constants import DESCRIPTION, LOGO
|
|
|
56 |
print("s生成完成:", end2 - end1)
|
57 |
# 将图片对象转换为bytes
|
58 |
output_image_base64 = base64.b64encode(output_image.tobytes()).decode()
|
59 |
+
print("完成的图片:", output_image_base64)
|
60 |
+
logger = logging.getLogger('')
|
61 |
+
logger.info(output_image_base64)
|
62 |
return output_image_base64
|
63 |
|
64 |
|