ChenyuRabbitLove commited on
Commit
912d588
1 Parent(s): c0fd726

chore: modify reward image text width

Browse files
Files changed (1) hide show
  1. utils/completion_reward.py +3 -8
utils/completion_reward.py CHANGED
@@ -213,7 +213,6 @@ class OpenAIAgent:
213
  - 請用 500 字以內的短篇故事
214
  - 試著合併故事記錄成一段連貫、有吸引力的故事
215
  - 請使用 zh_TW
216
- 最後,I'll tip $200
217
  """
218
 
219
  user_log = f"""
@@ -264,7 +263,7 @@ class OpenAIAgent:
264
  logging.info("Generating image...")
265
  response = client.images.generate(
266
  model="dall-e-3",
267
- prompt="Create an image in a retro Ghibli style, with a focus on a universe theme. The artwork should maintain the traditional hand-drawn animation look characteristic of Ghibli. Imagine a scene set in outer space or a fantastical cosmic environment, rich with vibrant and varied color palettes to capture the mystery and majesty of the universe. The background should be detailed, showcasing stars, planets, and nebulae, blending the Ghibli style's nostalgia and emotional depth with the awe-inspiring aspects of space. The overall feel should be timeless, merging the natural wonder of the cosmos with the storytelling and emotional resonance typical of the retro Ghibli aesthetic. Soft lighting and gentle shading should be used to enhance the dreamlike, otherworldly quality of the scene.",
268
  size="1024x1024",
269
  quality="standard",
270
  n=1,
@@ -287,7 +286,6 @@ class AWSAgent:
287
  - 請用 500 字以內的短篇故事
288
  - 試著合併故事記錄成一段連貫、有吸引力的故事
289
  - 請使用 zh_TW
290
- 最後,I'll tip $200
291
  """
292
 
293
  user_log = f"""
@@ -325,8 +323,6 @@ class GoogleAgent:
325
  SCOPES = ["https://www.googleapis.com/auth/cloud-platform"]
326
 
327
  creds = Credentials.from_service_account_info(service_account_info_dict, scopes=SCOPES)
328
- logging.warning(f"Google service account info: {service_account_info_dict}")
329
- logging.warning(f"{type(service_account_info_dict)}")
330
  aiplatform.init(
331
  project='junyiacademy',
332
  service_account=service_account_info_dict,
@@ -342,7 +338,6 @@ class GoogleAgent:
342
  - 請用 500 字以內的短篇故事
343
  - 試著合併故事記錄成一段連貫、有吸引力的故事
344
  - 請使用 zh_TW
345
- 最後,I'll tip $200
346
  """
347
 
348
  user_log = f"""
@@ -493,7 +488,7 @@ class ImageProcessor:
493
 
494
  # Draw the text
495
  title_font = ImageFont.truetype("NotoSansTC-Bold.ttf", 36)
496
- body_font = ImageFont.truetype("NotoSansTC-Light.ttf", 14)
497
 
498
  # Title text
499
  title = f"光束守護者 - {player_name} 的冒險故事"
@@ -504,7 +499,7 @@ class ImageProcessor:
504
  body_x, body_y = left + 20, title_y + 60 # Adjust position as needed
505
 
506
  for line in paragraph.split("\n"):
507
- wrapped_lines = textwrap.wrap(line, width=70)
508
  for wrapped_line in wrapped_lines:
509
  draw.text((body_x, body_y), wrapped_line, font=body_font, fill="black")
510
  body_y += 30
 
213
  - 請用 500 字以內的短篇故事
214
  - 試著合併故事記錄成一段連貫、有吸引力的故事
215
  - 請使用 zh_TW
 
216
  """
217
 
218
  user_log = f"""
 
263
  logging.info("Generating image...")
264
  response = client.images.generate(
265
  model="dall-e-3",
266
+ prompt="Create an image in a retro Ghibli style, with a focus on a universe theme. The artwork should maintain the traditional hand-drawn animation look characteristic of Ghibli and with vibrant color. Imagine a scene set in outer space or a fantastical cosmic environment, rich with vibrant and varied color palettes to capture the mystery and majesty of the universe. The background should be detailed, showcasing stars, planets, and nebulae, blending the Ghibli style's nostalgia and emotional depth with the awe-inspiring aspects of space. The overall feel should be timeless, merging the natural wonder of the cosmos with the storytelling and emotional resonance typical of the retro Ghibli aesthetic. Soft lighting and gentle shading should be used to enhance the dreamlike, otherworldly quality of the scene.",
267
  size="1024x1024",
268
  quality="standard",
269
  n=1,
 
286
  - 請用 500 字以內的短篇故事
287
  - 試著合併故事記錄成一段連貫、有吸引力的故事
288
  - 請使用 zh_TW
 
289
  """
290
 
291
  user_log = f"""
 
323
  SCOPES = ["https://www.googleapis.com/auth/cloud-platform"]
324
 
325
  creds = Credentials.from_service_account_info(service_account_info_dict, scopes=SCOPES)
 
 
326
  aiplatform.init(
327
  project='junyiacademy',
328
  service_account=service_account_info_dict,
 
338
  - 請用 500 字以內的短篇故事
339
  - 試著合併故事記錄成一段連貫、有吸引力的故事
340
  - 請使用 zh_TW
 
341
  """
342
 
343
  user_log = f"""
 
488
 
489
  # Draw the text
490
  title_font = ImageFont.truetype("NotoSansTC-Bold.ttf", 36)
491
+ body_font = ImageFont.truetype("NotoSansTC-Light.ttf", 12)
492
 
493
  # Title text
494
  title = f"光束守護者 - {player_name} 的冒險故事"
 
499
  body_x, body_y = left + 20, title_y + 60 # Adjust position as needed
500
 
501
  for line in paragraph.split("\n"):
502
+ wrapped_lines = textwrap.wrap(line, width=65)
503
  for wrapped_line in wrapped_lines:
504
  draw.text((body_x, body_y), wrapped_line, font=body_font, fill="black")
505
  body_y += 30