Skip to content

Commit

Permalink
refactor(tools/cogview3): syntax style
Browse files Browse the repository at this point in the history
  • Loading branch information
ox01024 committed Sep 13, 2024
1 parent 3952d13 commit 70c1378
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/core/tools/provider/builtin/cogview/tools/cogview3.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _invoke(
"horizontal_1344": "1344x768",
"horizontal_1152": "1152x864",
"widescreen_1440": "1440x720",
"tallscreen_720": "720x1440"
"tallscreen_720": "720x1440",
}
# prompt
prompt = tool_parameters.get("prompt", "")
Expand All @@ -36,7 +36,7 @@ def _invoke(
size_key = tool_parameters.get("size", "square")
# cogview-3-plus get size
if size_key != "cogview_3":
size = size_mapping[size_key]
size = size_mapping[size_key]
# get n
n = tool_parameters.get("n", 1)
# get quality
Expand All @@ -50,7 +50,7 @@ def _invoke(
# set extra body
seed_id = tool_parameters.get("seed_id", self._generate_random_id(8))
extra_body = {"seed": seed_id}
# cogview-3-plus
# cogview-3-plus
if size_key != "cogview_3":
response = client.images.generations(
prompt=prompt,
Expand All @@ -60,7 +60,7 @@ def _invoke(
extra_body=extra_body,
style=style,
quality=quality,
response_format="b64_json"
response_format="b64_json",
)
# cogview-3
else:
Expand All @@ -71,7 +71,7 @@ def _invoke(
extra_body=extra_body,
style=style,
quality=quality,
response_format="b64_json"
response_format="b64_json",
)
print(response.data)
result = []
Expand Down

0 comments on commit 70c1378

Please sign in to comment.