-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
Minimal example (on dspy v2.4.0):
import dspy
examples = [dspy.Example(foo=f, bar=b).with_inputs("foo") for f, b in zip("abcd", "1234")]
print(examples) # [Example({'foo': 'a', 'bar': '1'}) (input_keys={'foo'}), Example({'foo': 'b', 'bar': '2'}) (input_keys={'foo'}), Example({'foo': 'c', 'bar': '3'}) (input_keys={'foo'}), Example({'foo': 'd', 'bar': '4'}) (input_keys={'foo'})]
from dspy.datasets.dataset import Dataset
class MyDataset(Dataset):
def __init__(self, examples):
super().__init__(train_size=1, dev_size=1, test_size=1)
self._train = [examples[0]]
self._dev = [examples[1]]
self._test = [examples[2]]
dataset = MyDataset(examples)
print(dataset.train) # [Example({'foo': 'a', 'bar': '1'}) (input_keys=None)]
print(dataset.dev) # [Example({'foo': 'b, 'bar': '2'}) (input_keys=None)]
print(dataset.test) # [Example({'foo': 'c', 'bar': '3'}) (input_keys=None)]
Expected to have the input_keys persist through the Dataset object. This line seems to be the problem.
Metadata
Metadata
Assignees
Labels
No labels