Skip to content

Commit

Permalink
fix the breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
mertyg committed Jul 14, 2024
1 parent 44108cb commit d1b83b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions textgrad/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ def __init__(
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)."
if value == "" and image_path == "":
raise ValueError("Please provide a value or an image path for the variable")
# 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")
if value != "" and image_path != "":
raise ValueError("Please provide either a value or an image path for the variable, not both.")

Expand Down

0 comments on commit d1b83b4

Please sign in to comment.