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

making converter additionally support deepseek-coder dense hf model #167

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

leo-liuzy
Copy link

Changes made:

  • adding support for converting back/forth for deepseek-coder dense model on top of existing PR.
  • restructure RoPEScalingConfig to support linear scaling; previously, the object only contains counterparts of huggingface's llama3 rope scaling, whereas deepseek-coder uses linear scaling.

@dirkgr

# HF_MODEL = "meta-llama/Llama-3.2-1B"
# HF_MODEL = "meta-llama/Llama-3.2-8B"
HF_MODEL = f"{os.environ['SHARE_RES_DIR']}/models/deepseek/deepseek-coder-1.3b-base"
# HF_MODEL = "/home/zliu/shared_resources/models/llama3/hf/Llama-3.2-1B"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't put your private paths into the code base.

Comment on lines +33 to +35
# TOKENIZER_CONFIG = TokenizerConfig.from_hf(HF_MODEL)
TOKENIZER_CONFIG = TokenizerConfig.from_hf("deepseek-ai/deepseek-coder-1.3b-base")
# TOKENIZER_CONFIG = TokenizerConfig.from_hf("meta-llama/Llama-3.2-1B")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. This is one-off stuff that breaks everybody else's workflow. Imagine someone wants to use this tool that has zero context about this part of the work, and they just want to convert some checkpoint.

MODEL_CONFIG: TransformerConfig
if HF_MODEL == "meta-llama/Llama-3.2-1B":
if "Llama-3.2-1B" in HF_MODEL:
Copy link
Member

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?

Copy link
Author

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?

Copy link
Member

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
@dirkgr
Copy link
Member

dirkgr commented Feb 19, 2025

@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?

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

Successfully merging this pull request may close these issues.

3 participants