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

bug in clip skip merge? #28

Open
s1dlx opened this issue Mar 5, 2023 · 0 comments
Open

bug in clip skip merge? #28

s1dlx opened this issue Mar 5, 2023 · 0 comments

Comments

@s1dlx
Copy link

s1dlx commented Mar 5, 2023

hello!

at this point of the merging procedure

dprint(f"-- start Stage 2/2 --", verbose)
for key in tqdm(theta_1.keys(), desc="Stage 2/2"):
if "model" in key and key not in theta_0:
if KEY_POSITION_IDS in key:
if skip_position_ids == 1:
print(f" modelB: skip 'position_ids' : {theta_0[KEY_POSITION_IDS].dtype}")
dprint(f"{theta_0[KEY_POSITION_IDS]}", verbose)
continue
elif skip_position_ids == 2:
theta_0[key] = torch.tensor([list(range(77))], dtype=torch.int64)
print(f" modelB: reset 'position_ids': {theta_0[KEY_POSITION_IDS].dtype}")
dprint(f"{theta_0[KEY_POSITION_IDS]}", verbose)
continue
else:
print(f" modelB: 'position_ids' key found. do nothing : {skip_position_ids}")
dprint(f" key : {key}", verbose)
theta_0.update({key:theta_1[key]})
if save_as_half:
theta_0[key] = theta_0[key].half()

shouldn't be theta1 instead of theta0? For example,

    for key in tqdm(theta_1.keys(), desc="Stage 2/2"):
        if "model" in key and key not in theta_1:

            if KEY_POSITION_IDS in key:
                if skip_position_ids == 1:
                    print(f"  modelB: skip 'position_ids' : {theta_1[KEY_POSITION_IDS].dtype}")
                    dprint(f"{theta_1[KEY_POSITION_IDS]}", verbose)
                    continue
                elif skip_position_ids == 2:
                    theta_1[key] = torch.tensor([list(range(77))], dtype=torch.int64)
                    print(f"  modelB: reset 'position_ids': {theta_1[KEY_POSITION_IDS].dtype}")
                    dprint(f"{theta_1[KEY_POSITION_IDS]}", verbose)
                    continue
                else:
                    print(f"  modelB: 'position_ids' key found. do nothing : {skip_position_ids}")
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