[Fix] JoyVL serving: align with reference engine (bounded long-term memory, timestamps, max_pixels) + recipe updates (#4623)
Signed-off-by: lishunyang12 <125541396+lishunyang12@users.noreply.github.com>
This commit is contained in:
1 parent
0958e62ecc
commit
d35cdd2dab
9 files changed
+116
-28
No files matched your search
@@ -26,6 +26,7 @@ class InteractionConfig:
|
||||
|
||||
persona: str = "default"
|
||||
frame_seconds: float = 1.0
|
||||
max_pixels: int = 262144
|
||||
sampling: SamplingConfig = field(default_factory=SamplingConfig)
|
||||
|
||||
force_silence_before_query: bool = True
|
||||
@@ -42,6 +43,7 @@ class InteractionConfig:
|
||||
mid_term_key_frames: int = 0
|
||||
|
||||
long_term_every_n_chunks: int = 5
|
||||
long_term_memory_window: int = 15
|
||||
mid_term_max_tokens: int = 4000
|
||||
long_term_max_tokens: int = 4000
|
||||
keep_qa_history: bool = True
|
||||
|
||||
@@ -49,6 +49,7 @@ class SessionManager:
|
||||
key_frames_per_chunk=config.mid_term_key_frames,
|
||||
mid_term_max_tokens=config.mid_term_max_tokens,
|
||||
long_term_max_tokens=config.long_term_max_tokens,
|
||||
max_pixels=config.max_pixels,
|
||||
)
|
||||
self._delegation = self._build_delegation(config) if config.enable_delegation else None
|
||||
self._sessions: dict[str, InteractionSession] = {}
|
||||
|
||||
@@ -50,6 +50,7 @@ class InteractionSession:
|
||||
delegation=delegation,
|
||||
chunk_frames=config.chunk_frames,
|
||||
long_term_every_n_chunks=config.long_term_every_n_chunks,
|
||||
long_term_window=config.long_term_memory_window,
|
||||
keep_qa_history=config.keep_qa_history,
|
||||
frame_seconds=config.frame_seconds,
|
||||
enable_delegation=config.enable_delegation,
|
||||
@@ -74,7 +75,7 @@ class InteractionSession:
|
||||
brain = policy.brain
|
||||
|
||||
base = t if t is not None else brain.frame_index * self.config.frame_seconds
|
||||
time_ranges = [f"{base + i * self.config.frame_seconds:.1f}s" for i in range(len(frames))]
|
||||
time_ranges = [f"{base + i * self.config.frame_seconds:.1f} seconds" for i in range(len(frames))]
|
||||
|
||||
delegation_info = await policy.fold_delegations()
|
||||
|
||||
@@ -175,5 +176,5 @@ class InteractionSession:
|
||||
content.append({"type": "text", "text": f"{USER_QUERY_HEADER}\n{query.strip()}"})
|
||||
for tr, url in zip(time_ranges, frames):
|
||||
content.append({"type": "text", "text": f"<{tr}>"})
|
||||
content.append({"type": "image_url", "image_url": {"url": url}})
|
||||
content.append({"type": "image_url", "image_url": {"url": url}, "max_pixels": self.config.max_pixels})
|
||||
return {"role": "user", "content": content}
|
||||
Reference in new issue
Block a user