Spaces:
Running
Running
ChenyuRabbitLove
commited on
Commit
โข
c49c4b7
1
Parent(s):
a0277c7
bugfix: fix minor bugs
Browse files
utils/completion_reward.py
CHANGED
@@ -239,7 +239,7 @@ class OpenAIAgent:
|
|
239 |
while retry_attempts < 5:
|
240 |
try:
|
241 |
response = client.chat.completions.create(
|
242 |
-
model="gpt-
|
243 |
messages=messages,
|
244 |
temperature=self.temperature,
|
245 |
max_tokens=self.max_tokens,
|
@@ -476,7 +476,7 @@ class ImageProcessor:
|
|
476 |
|
477 |
# Draw the box
|
478 |
left, right = 50, img.width - 50
|
479 |
-
box_height =
|
480 |
top = (img.height - box_height) // 2
|
481 |
bottom = (img.height + box_height) // 2
|
482 |
border_radius = 20
|
@@ -496,7 +496,7 @@ class ImageProcessor:
|
|
496 |
|
497 |
# Draw the text
|
498 |
title_font = ImageFont.truetype("NotoSansTC-Bold.ttf", 34)
|
499 |
-
body_font = ImageFont.truetype("NotoSansTC-Light.ttf",
|
500 |
|
501 |
# Title text
|
502 |
title = f"ๅ
ๆๅฎ่ญท่
- {player_name} ็ๅ้ชๆ
ไบ"
|
@@ -507,7 +507,7 @@ class ImageProcessor:
|
|
507 |
body_x, body_y = left + 20, title_y + 60 # Adjust position as needed
|
508 |
|
509 |
for line in paragraph.split("\n"):
|
510 |
-
wrapped_lines = textwrap.wrap(line, width=
|
511 |
for wrapped_line in wrapped_lines:
|
512 |
draw.text((body_x, body_y), wrapped_line, font=body_font, fill="black")
|
513 |
body_y += 30
|
|
|
239 |
while retry_attempts < 5:
|
240 |
try:
|
241 |
response = client.chat.completions.create(
|
242 |
+
model="gpt-4-1106-preview",
|
243 |
messages=messages,
|
244 |
temperature=self.temperature,
|
245 |
max_tokens=self.max_tokens,
|
|
|
476 |
|
477 |
# Draw the box
|
478 |
left, right = 50, img.width - 50
|
479 |
+
box_height = 500
|
480 |
top = (img.height - box_height) // 2
|
481 |
bottom = (img.height + box_height) // 2
|
482 |
border_radius = 20
|
|
|
496 |
|
497 |
# Draw the text
|
498 |
title_font = ImageFont.truetype("NotoSansTC-Bold.ttf", 34)
|
499 |
+
body_font = ImageFont.truetype("NotoSansTC-Light.ttf", 14)
|
500 |
|
501 |
# Title text
|
502 |
title = f"ๅ
ๆๅฎ่ญท่
- {player_name} ็ๅ้ชๆ
ไบ"
|
|
|
507 |
body_x, body_y = left + 20, title_y + 60 # Adjust position as needed
|
508 |
|
509 |
for line in paragraph.split("\n"):
|
510 |
+
wrapped_lines = textwrap.wrap(line, width=70)
|
511 |
for wrapped_line in wrapped_lines:
|
512 |
draw.text((body_x, body_y), wrapped_line, font=body_font, fill="black")
|
513 |
body_y += 30
|