Skip to content

Commit 3cbb8c3

Browse files
committed
wip
1 parent 9969ec5 commit 3cbb8c3

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

amadeusgpt/agentic/video_llm.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,14 @@ def speak(self, video_data):
131131
images.extend(segment)
132132
print ('total images GPT-4 sees', len(images))
133133
self.images_to_video(images, 'gpt4_sees_this.mp4', 30)
134+
135+
134136
multi_image_content = self.prepare_multi_image_content(images)
135137
self.update_history("system", self.system_prompt)
136138
self.update_history(
137139
"user", "This video is about a mouse in its home cage.", multi_image_content=multi_image_content, in_place = True)
138-
139-
response = self.connect_gpt(self.context_window, max_tokens=2000)
140+
141+
response = self.connect_gpt(self.context_window)
140142
text = response.choices[0].message.content.strip()
141143
print(text)
142144

@@ -151,5 +153,7 @@ def speak(self, video_data):
151153
video_sampler = VideoSampler(video_path, segment_duration, frames_per_segment)
152154
video_data = video_sampler.process_video()
153155

156+
video_data = {k:v for k,v in video_data.items() if k < 1}
157+
print (video_data)
154158
video_llm = VideoLLM(config=config)
155159
video_llm.speak(video_data)

amadeusgpt/analysis_objects/llm.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class LLM(AnalysisObject):
2020

2121
def __init__(self, config):
2222
self.config = config
23-
self.max_tokens = config.get("max_tokens", 6000)
23+
self.max_tokens = config.get("max_tokens", 36000)
2424
self.gpt_model = config.get("gpt_model", "gpt-4o")
2525
self.keep_last_n_messages = config.get("keep_last_n_messages", 2)
2626

@@ -366,11 +366,6 @@ def speak(self, sandbox):
366366

367367
if __name__ == "__main__":
368368
from amadeusgpt.config import Config
369-
from amadeusgpt.main import create_amadeus
370369

371-
config = Config("amadeusgpt/configs/EPM_template.yaml")
370+
config = Config("/Users/shaokaiye/AmadeusGPT-dev/amadeusgpt/configs/MausHaus_template.yaml")
372371

373-
amadeus = create_amadeus(config)
374-
sandbox = amadeus.sandbox
375-
visualLLm = VisualLLM(config)
376-
visualLLm.speak(sandbox)

amadeusgpt/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from amadeusgpt.programs.task_program_registry import TaskProgramLibrary
2424

2525
class AMADEUS:
26-
def __init__(self, config: Dict[str, Any]):
26+
def __init__(self, config: Dict[str, Any] | Config):
2727
self.config = config
2828
self.code_generator_llm = CodeGenerationLLM(config.get("llm_info", {}))
2929
self.self_debug_llm = SelfDebugLLM(config.get("llm_info", {}))
@@ -52,7 +52,7 @@ def __init__(self, config: Dict[str, Any]):
5252
self.sandbox.register_llm("diagnosis", self.diagnosis_llm)
5353

5454
# can only do this after the register process
55-
self.sandbox.configure_using_vlm()
55+
# self.sandbox.configure_using_vlm()
5656

5757
def match_integration_module(self, user_query: str):
5858
"""

amadeusgpt/programs/sandbox.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,14 @@ def get_query_block(self):
312312
def update_config(self, config):
313313
self.config = config
314314
self.update_namespace()
315+
316+
def get_analysis(self):
317+
"""
318+
Every sandbox stores a unique "behavior analysis" instance in its namespace
319+
Therefore, get analysis gets the current sandbox's analysis.
320+
"""
321+
analysis = self.exec_namespace["behavior_analysis"]
322+
return analysis
315323

316324
def copy(self):
317325
return Sandbox(self.config, self.api_registry)

0 commit comments

Comments
 (0)