-
Notifications
You must be signed in to change notification settings - Fork 18
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
making converter additionally support deepseek-coder dense hf model #167
base: main
Are you sure you want to change the base?
Conversation
add deepseek1b support
add two directions converter (hf->olmo, olmo->hf)
clean imports
replace hf to olmo conveter
MODEL_CONFIG: TransformerConfig | ||
if HF_MODEL == "meta-llama/Llama-3.2-1B": | ||
if "Llama-3.2-1B" in HF_MODEL: |
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.
Do we also need this for bigger Llama models?
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.
I change it so that it works with local cache dir. We are encountering some additional weird bug related to conversion; and requires some help from you. We will submit a separate issue regarding that. Do you prefer we incorporate solution to that issue into this PR or should I separate that from this current PR?
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.
Many small PRs is always better, if possible.
# Conflicts: # src/examples/huggingface/convert_checkpoint_to_hf.py
@lingchensanwen , I merged current main into this. There were a fair number of conflicts, and I'm not sure I did it right. Can you check? |
@dirkgr, I think I've fixed this. Could you take a look at the new one? |
SAVE_PATH = f"{os.environ['SHARE_RES_DIR']}/models/deepseek/olmo/deepseek-coder-1.3b-base" | ||
SAVE_OVERWRITE = True |
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.
This is hardcoded to deepseek, and the SAVE_OVERWRITE
was probably a leftover statement? It should default to the safe setting, so people don't overwrite their stuff by accident.
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.
sure will fix.
) | ||
|
||
elif "deepseek-coder-1.3b-base" in HF_MODEL: |
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.
Does this have to happen for all DeepSeek models?
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.
yes, we defined class for this version deepseek following the olmo core setup. For other version, users would need to define their own class as well like this. Also, I can modify this to elif HF_MODEL.startswith("deepseek-coder-1.3b-base"):
to follow the same format as repo did.
) | ||
else: | ||
# Extract RoPE scaling config | ||
# from pdb import set_trace; set_trace() |
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.
leftover debug code?
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.
will remove in next commit.
|
||
with open(config_path, "r") as f: | ||
olmo_config_dict = json.load(f)["model"] | ||
# import pdb; pdb.set_trace() |
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.
leftover?
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.
will remove in next commit.
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.
resolved all above in new commit @dirkgr
Changes made:
@dirkgr