Alexandros Popov
commited on
Commit
·
0535ef5
1
Parent(s):
547947e
efficient communication between critic and ops.
Browse files
agents.py
CHANGED
|
@@ -40,7 +40,6 @@ picture_operator = CodeAgent(
|
|
| 40 |
flt.adjust_saturation_color,
|
| 41 |
flt.adjust_luminance_color,
|
| 42 |
flt.add_vignette,
|
| 43 |
-
flt.denoise_image,
|
| 44 |
flt.add_grain,
|
| 45 |
flt.save_image,
|
| 46 |
flt.load_image,
|
|
|
|
| 40 |
flt.adjust_saturation_color,
|
| 41 |
flt.adjust_luminance_color,
|
| 42 |
flt.add_vignette,
|
|
|
|
| 43 |
flt.add_grain,
|
| 44 |
flt.save_image,
|
| 45 |
flt.load_image,
|
judges.py
CHANGED
|
@@ -126,7 +126,7 @@ def concatenate_images_side_by_side(image_path1: str, image_path2: str) -> str:
|
|
| 126 |
|
| 127 |
|
| 128 |
@tool
|
| 129 |
-
def critic(new_image_path: str, original_image_path: str, user_prompt: str,
|
| 130 |
"""
|
| 131 |
Evaluates the new image against the old image and provides feedback.
|
| 132 |
|
|
@@ -134,7 +134,7 @@ def critic(new_image_path: str, original_image_path: str, user_prompt: str, late
|
|
| 134 |
new_image_path (str): The file path to the new image.
|
| 135 |
original_image_path (str): The file path to the new image.
|
| 136 |
user_prompt (str): Additional instructions or context provided by the user.
|
| 137 |
-
|
| 138 |
|
| 139 |
Returns:
|
| 140 |
str: Feedback on the changes made to the image.
|
|
@@ -153,7 +153,7 @@ def critic(new_image_path: str, original_image_path: str, user_prompt: str, late
|
|
| 153 |
"Your task is to evaluate the changes made to image 2.\n"
|
| 154 |
"You will be provided with a prompt that describes the user's request to improve the image.\n"
|
| 155 |
"Does the image 2 respect the desire of the user ?\n"
|
| 156 |
-
"You can refine the
|
| 157 |
"You must not invent new methods or tools, only use the ones provided.\n"
|
| 158 |
)
|
| 159 |
|
|
@@ -162,7 +162,7 @@ def critic(new_image_path: str, original_image_path: str, user_prompt: str, late
|
|
| 162 |
path_to_concat,
|
| 163 |
model="google/gemma-3-27b-it",
|
| 164 |
system_prompt=system_prompt,
|
| 165 |
-
user_prompt=f"the user wishes for : {user_prompt}.\n The
|
| 166 |
)
|
| 167 |
|
| 168 |
return response["choices"][0]["message"]["content"]
|
|
|
|
| 126 |
|
| 127 |
|
| 128 |
@tool
|
| 129 |
+
def critic(new_image_path: str, original_image_path: str, user_prompt: str, list_of_enhancements: str) -> str:
|
| 130 |
"""
|
| 131 |
Evaluates the new image against the old image and provides feedback.
|
| 132 |
|
|
|
|
| 134 |
new_image_path (str): The file path to the new image.
|
| 135 |
original_image_path (str): The file path to the new image.
|
| 136 |
user_prompt (str): Additional instructions or context provided by the user.
|
| 137 |
+
list_of_enhancements (str): the list of enhancements applied to the image.
|
| 138 |
|
| 139 |
Returns:
|
| 140 |
str: Feedback on the changes made to the image.
|
|
|
|
| 153 |
"Your task is to evaluate the changes made to image 2.\n"
|
| 154 |
"You will be provided with a prompt that describes the user's request to improve the image.\n"
|
| 155 |
"Does the image 2 respect the desire of the user ?\n"
|
| 156 |
+
"You can refine the list of the modifications to apply to the image.\n"
|
| 157 |
"You must not invent new methods or tools, only use the ones provided.\n"
|
| 158 |
)
|
| 159 |
|
|
|
|
| 162 |
path_to_concat,
|
| 163 |
model="google/gemma-3-27b-it",
|
| 164 |
system_prompt=system_prompt,
|
| 165 |
+
user_prompt=f"the user wishes for : {user_prompt}.\n The enhancement applied are {list_of_enhancements}",
|
| 166 |
)
|
| 167 |
|
| 168 |
return response["choices"][0]["message"]["content"]
|