Skip to content

Commit

Permalink
add prompt to vlm predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
lf-zhao committed May 10, 2024
1 parent 499f639 commit 51bf569
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions predicators/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ class VLMGroundAtom(GroundAtom):

# NOTE: This subclasses GroundAtom to support VLM predicates and classifiers
predicate: VLMPredicate
prompt: Optional[str] = None

def get_query_str(self, without_type: bool = False) -> str:
"""Get a query string for this ground atom.
Expand All @@ -476,6 +477,9 @@ def get_query_str(self, without_type: bool = False) -> str:
o.name for o in self.objects) + ")"
else:
string = str(self)

if self.prompt is not None:
string += f" [Prompt: {self.prompt}]"
return string

def holds(self, state: State) -> bool:
Expand Down

0 comments on commit 51bf569

Please sign in to comment.