Skip to content

Commit dbdcf05

Browse files
committed
Fixed a bug in text plus image content generation
1 parent b09bc2f commit dbdcf05

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

amadeusgpt/agentic/video_llm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ def speak(self, video_data):
136136
multi_image_content = self.prepare_multi_image_content(images)
137137
self.update_history("system", self.system_prompt)
138138
self.update_history(
139-
"user", "This video is about a mouse in its home cage.", multi_image_content=multi_image_content, in_place = True)
140-
139+
"user", "This video is about a mouse in its home cage. The circular object in the center is a treadmill. The colorful dots are keypoints from DeepLabCut. You can ignore those dots.", multi_image_content=multi_image_content, in_place = True)
140+
141141
response = self.connect_gpt(self.context_window)
142142
text = response.choices[0].message.content.strip()
143143
print(text)

amadeusgpt/analysis_objects/llm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ def update_history(self, role, content, multi_image_content = None, in_place=Fal
154154
if multi_image_content is None:
155155
new_message = {"role": role, "content": content}
156156
else:
157+
text_content = {"type": "text", "text": content}
158+
multi_image_content = [text_content] + multi_image_content
157159
new_message = {"role": role, "content": multi_image_content
158160
}
159161

0 commit comments

Comments
 (0)