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

function attach() could not work #76

Open
koishichann opened this issue Jan 5, 2024 · 0 comments
Open

function attach() could not work #76

koishichann opened this issue Jan 5, 2024 · 0 comments

Comments

@koishichann
Copy link

Following 'Multitask Modeling using OpenDelta' part in the document reports error 'NotImplementedError' on line:

delta_model.attach()

As tracked in the source code in function attach(), I guess the problem is at here:

if _delta_info['method'] == "replace":
setattr(submodule, _delta_info["child_name"], _delta_info['delta_module'])
elif _delta_info['method'] == "insert_sequential":
self.insert_sequential_module(module=submodule,_delta_info=_delta_info)
elif _delta_info['method'] == "insert_parallel":
self.insert_parallel_module(module=submodule, _delta_info=_delta_info)
else:
raise NotImplementedError

I didn't find "insert_sequential" or "insert_parallel" in other codes but found "parallel" and "sequential". I think the codes may be like:

if _delta_info['method'] == "replace":
setattr(submodule, _delta_info["child_name"], _delta_info['delta_module'])
elif _delta_info['method'] == "sequential":
self.insert_sequential_module(module=submodule,_delta_info=_delta_info)
elif _delta_info['method'] == "parallel":
self.insert_parallel_module(module=submodule, _delta_info=_delta_info)
else:
raise NotImplementedError

I changed like this and it worked on lora without problem until now.
I dont know if this edition is right so please check this. Thanks for your contribution on OpenDelta.

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

1 participant