lindsay-qu
commited on
Update core/refiner/simple_refiner.py
Browse files
core/refiner/simple_refiner.py
CHANGED
@@ -42,12 +42,9 @@ class SimpleRefiner(BaseRefiner):
|
|
42 |
if not isinstance(image_paths, list):
|
43 |
image_paths = [image_paths]
|
44 |
for image_path in image_paths:
|
45 |
-
user_context.append({"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{encode_image(image_path.name)}"}})
|
46 |
-
|
47 |
-
|
48 |
-
]}]
|
49 |
-
else:
|
50 |
-
context = [{"role": "system", "content": self.sys_prompt}] + memory + user_context
|
51 |
response = self.model.respond(context)
|
52 |
|
53 |
return response
|
|
|
42 |
if not isinstance(image_paths, list):
|
43 |
image_paths = [image_paths]
|
44 |
for image_path in image_paths:
|
45 |
+
user_context[0]["content"].append({"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{encode_image(image_path.name)}"}})
|
46 |
+
context = [{"role": "system", "content": self.sys_prompt}] + memory + user_context
|
47 |
+
|
|
|
|
|
|
|
48 |
response = self.model.respond(context)
|
49 |
|
50 |
return response
|