diff --git a/textgrad/tasks/base.py b/textgrad/tasks/base.py index 059473e..b71082d 100644 --- a/textgrad/tasks/base.py +++ b/textgrad/tasks/base.py @@ -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): diff --git a/textgrad/variable.py b/textgrad/variable.py index eeb997e..01b9020 100644 --- a/textgrad/variable.py +++ b/textgrad/variable.py @@ -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")