-
Notifications
You must be signed in to change notification settings - Fork 214
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
Offsite-tuning model generation #676
base: dev/llm
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the inline comments. Thx!
else: | ||
try: | ||
ckpt = torch.load(config.federate.save_to, map_location='cpu') | ||
self.prefix = [''] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should prefix
be passed by the config
?
@@ -54,7 +45,11 @@ def __init__(self, | |||
os._exit(0) | |||
# No need for this attr | |||
if hasattr(adap_model, 'teacher'): | |||
import gc | |||
import torch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about move line 48-49 to top:
try:
import gc
import torch
except ImportError:
gc=None
torch=None
new_model = set_layers(new_model, emulator_and_adapter) | ||
|
||
if emulator_alignment: | ||
new_model.student = layers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge the latest commits in which bugs are fixed. (layers should be detached from new_model
)
There are two main updates: