Skip to content

Commit

Permalink
hotfix: prompt-optimization breaking changes after multimodal merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mertyg committed Jul 15, 2024
1 parent a4d4824 commit 5cd7cc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 1 addition & 4 deletions textgrad/tasks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ def __getitem__(self):
@abstractmethod
def __len__(self):
pass

@abstractmethod
def get_default_task_instruction(self):
pass


class DataLoader:
def __init__(self, data, batch_size=32, shuffle=True):
Expand Down
4 changes: 3 additions & 1 deletion textgrad/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def __init__(
raise Exception("If the variable does not require grad, none of its predecessors should require grad."
f"In this case, following predecessors require grad: {_predecessor_requires_grad}")

assert type(value) in [str, bytes], "Value must be a string or image (bytes)."
assert type(value) in [str, bytes, int], "Value must be a string, int, or image (bytes). Got: {}".format(type(value))
if isinstance(value, int):
value = str(value)
# We'll currently let "empty variables" slide, but we'll need to handle this better in the future.
# if value == "" and image_path == "":
# raise ValueError("Please provide a value or an image path for the variable")
Expand Down

0 comments on commit 5cd7cc0

Please sign in to comment.