Skip to content

Commit 982bcb9

Browse files
committed
添加日志
1 parent 27d1905 commit 982bcb9

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

gpt_server/serving/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import ray
55
from dotenv import load_dotenv
66
from loguru import logger
7+
import json
78

89
load_dotenv()
910
os.environ["OPENBLAS_NUM_THREADS"] = (
@@ -41,6 +42,7 @@
4142
# print(config)
4243
def main():
4344
# ----------------------------启动 Controller 和 Openai API 服务----------------------------------------
45+
logger.info(f"config:\n{json.dumps(config,ensure_ascii=False,indent=2)}")
4446
start_api_server(config=config)
4547
# ----------------------------启动 Model Worker 服务----------------------------------------------------
4648
start_model_worker(config=config)

tests/test_image_gen.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
## response_format = "url" 默认为 url
77
prompt = "身着粉色汉服、精致刺绣的中国年轻女子。无可挑剔的妆容,额头上的红色花卉图案。精致的高髻,金凤头饰,红花,珠子。持有圆形折扇,上面有女士、树木、鸟。霓虹灯闪电灯(⚡️),明亮的黄色光芒,位于伸出的左手掌上方。室外夜景柔和,剪影的西安大雁塔,远处的七彩灯光模糊。"
88
model = "z_image"
9-
img = client.images.generate(
10-
model=model, prompt=prompt, response_format="url", size="1664x928"
11-
)
12-
print(img.data[0])
13-
# response_format = "b64_json"
9+
# 1. 使用 url 格式输出(使用的话,请解开注释)
10+
# img = client.images.generate(
11+
# model=model, prompt=prompt, response_format="url", size="1664x928"
12+
# )
13+
# print(img.data[0])
14+
# 2. 使用 b64_json 格式输出
15+
response_format = "b64_json"
1416
img = client.images.generate(model=model, prompt=prompt, response_format="b64_json")
1517
image_bytes = base64.b64decode(img.data[0].b64_json)
1618
with open("output.png", "wb") as f:

0 commit comments

Comments
 (0)