-
Notifications
You must be signed in to change notification settings - Fork 111
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
[P0] Saving and reloading a ReftModel throws an error #51
Comments
Assigning P0 - i am fixing this. |
it should be fixed. will close this once the branch is merged. |
@frankaging I'm still running into this. I just ran
EDIT: turns out the changes in cf3f734 are reverted?? I'm seeing this error with pyvene/models/configuration_intervenable_model.py:55 |
@chris-aeviator are you using the HuggingFace trainer? If so, please set |
I‘m trying to load an already trained model.
… Am 30.04.2024 um 18:56 schrieb Zen ***@***.***>:
@chris-aeviator are you using the HuggingFace trainer? If so, please set report_to="none". It is likely due to the tensorboard integration. #70
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
@chris-aeviator thanks! could you share your saved |
@frankaging thanks and yes
|
@chris-aeviator thanks for your reply! unfortunately, it seems like this json is error formatted due to one of our previous bug. One way to fix this is to manually change to the correct format. You can follow this: https://huggingface.co/pyvene/reft_goody2/blob/main/config.json This is for the field |
I think it will be something like this: "representations": [
[
15,
"block_output",
"pos",
1,
8,
null,
null,
null,
null,
null,
null,
null,
null
]
], |
@frankaging thanks - changing the config to this format makes the model loadable again. However, it seems that upon training a new model, I will get a config file containing again the representationConfig entry in my config.json. Could you point out to me when (in which pr) the bugfixes for saving the model have been merged? I'm running this in a distributed computing environment and don't want to waste your time with back and forth debugging. |
@chris-aeviator i think if you install from the top of the tree (main), this should go away. |
@frankaging thanks & confirmed, installing via git+https://github.com/stanfordnlp/pyreft@main now works. If you ever discuss to move to a more expressive config format (given it's a json file) to persist RepresentationConfig, there's a +1 from my side - so far all good & thanks again. |
@chris-aeviator ty! yep, the config.json is somewhat broken right now, will fix it once we have more time (after conf ddl). |
I was saving and reloading a ReftModel. While loading, the model throws this error at pyvene/models/configuration_intervenable_model.py:51:
Issue seems to be that the RepresentationConfig loaded saved "RepresentationConfig(layer=4, component='block_output', unit='pos', max_number_of_units=1, low_rank_dimension=8, intervention_type=None, intervention=None, subspace_partition=None, group_key=None, intervention_link_key=None, moe_key=None, source_representation=None, hidden_source_representation=None)" as a class of type
str
instead of typeRepresentationConfig
.This issue is different from #45.
The text was updated successfully, but these errors were encountered: