Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'dict' object has no attribute '_store' #557

Open
yasho191 opened this issue Mar 5, 2024 · 3 comments
Open

AttributeError: 'dict' object has no attribute '_store' #557

yasho191 opened this issue Mar 5, 2024 · 3 comments

Comments

@yasho191
Copy link

yasho191 commented Mar 5, 2024

I was trying to replicate the flow of the multihop_finetune tutorial notebook for my use case where I want to finetune the T5 model on a custom dataset. While running the finetuning T-5 model code I am getting the following Error: AttributeError: 'dict' object has no attribute '_store'.

Sample Code:

config = dict(target='t5-large', epochs=2, bf16=True, bsize=6, accumsteps=2, lr=5e-5)

tp = BootstrapFinetune(metric=None)
t5_program = tp.compile(CustomRAG(), 
                        teacher=ensemble, 
                        trainset=trainset, **config)

# Deactivate chain of thought prompting. Let's use T5 to directly predict outputs. (Faster and similar quality.)
for p in t5_program.predictors(): p.activated = False

The log that I am getting before my program crashes is something like this:
Failed to run or to evaluate example Example({'question': 'Sample Question', 'answer': 'Sample Answer)'}) (input_keys={'question'}) with <function BootstrapFinetune.__init__.<locals>.<lambda> at 0x7ad3520a4f70> due to 'dict' object has no attribute '_store'.

Can anyone help me out with this?

@edwarddgao
Copy link

I'm also having similar issue. Let me know if you find a fix.

@staturecrane
Copy link

I am getting this same error when trying to reload a saved module

@cbrousseauAumni
Copy link

cbrousseauAumni commented Jun 19, 2024

I'm still getting this error with the most recent version of dspy. I'm only using Examples.

Code:

`config = {"target":"flan-t5-base", "epochs":2, "bf16":False, "bsize":6, "accumsteps":2, "lr":5e-5}

tp = BootstrapFinetune(metric=None)
t5_program = tp.compile(Text2Val(), teacher=ensemble, trainset=trainset, **config)

for p in t5_program.predictors(): p.activated = False
t5_program.save("./first_pass_ollama_t5.json")`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants