Skip to content

Commit

Permalink
starcoder2 (#317)
Browse files Browse the repository at this point in the history
* add starcoder2

* upd

* upd readme

* upd readme

* upd limits
  • Loading branch information
JegernOUTT authored Feb 28, 2024
1 parent a45af1e commit eb84f4a
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ Extensions > Refact.ai Assistant > Settings > Infurl
| [starcoder/7b/base](https://huggingface.co/smallcloudai/starcoderbase-7b) | + | | + |
| [starcoder/15b/base](https://huggingface.co/TheBloke/starcoder-GPTQ) | + | | |
| [starcoder/15b/plus](https://huggingface.co/TheBloke/starcoderplus-GPTQ) | + | | |
| [starcoder2/3b/base](https://huggingface.co/bigcode/starcoder2-3b) | + | | + |
| [starcoder2/7b/base](https://huggingface.co/bigcode/starcoder2-7b) | + | | + |
| [starcoder2/15b/base](https://huggingface.co/bigcode/starcoder2-15b) | + | | + |
| [wizardcoder/15b](https://huggingface.co/TheBloke/WizardCoder-15B-1.0-GPTQ) | + | | |
| [codellama/7b](https://huggingface.co/TheBloke/CodeLlama-7B-fp16) | + | | + |
| [starchat/15b/beta](https://huggingface.co/TheBloke/starchat-beta-GPTQ) | | + | |
Expand Down
30 changes: 30 additions & 0 deletions known_models_db/refact_known_models/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,34 @@
# "T": 4096,
# "filter_caps": ["chat"],
# },
"starcoder2/3b/base": {
"backend": "transformers",
"model_path": "bigcode/starcoder2-3b",
"diff_scratchpad_class": "refact_scratchpads:ScratchpadPSM",
"chat_scratchpad_class": None,
"model_class_kwargs": {},
"required_memory_mb": 8000,
"T": 4096,
"filter_caps": ["completion", "finetune"],
},
"starcoder2/7b/base": {
"backend": "transformers",
"model_path": "bigcode/starcoder2-7b",
"diff_scratchpad_class": "refact_scratchpads:ScratchpadPSM",
"chat_scratchpad_class": None,
"model_class_kwargs": {},
"required_memory_mb": 16000,
"T": 4096,
"filter_caps": ["completion", "finetune"],
},
"starcoder2/15b/base": {
"backend": "transformers",
"model_path": "bigcode/starcoder2-15b",
"diff_scratchpad_class": "refact_scratchpads:ScratchpadPSM",
"chat_scratchpad_class": None,
"model_class_kwargs": {},
"required_memory_mb": 20000,
"T": 4096,
"filter_caps": ["completion", "finetune"],
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,24 @@
],
"force_enable_checkpointing": False
}

_starcoder2_base = {
"lora_target_modules_mapping": {
"qkv": ["self_attn.q_proj", "self_attn.k_proj", "self_attn.v_proj"],
"out": ["self_attn.o_proj"],
"backproj": ["self_attn.o_proj"],
"mlp": ["mlp.c_fc", "mlp.c_proj"],
},
"freeze_exceptions_mapping": {
"wte": ["embed_tokens"],
"lm_head": ["lm_head"],
"lora": ["lora"]
},
"tokenizer": _bigcode_tokenizer_mapping,
"train_ds_pipeline": _fim_train_ds_pipeline,
"test_ds_pipeline": _fim_test_ds_pipeline,
"train_model_modifiers": [],
"force_enable_checkpointing": False
}
_deepseek_base = {
"lora_target_modules_mapping": {
"qkv": ["self_attn.q_proj", "self_attn.k_proj", "self_attn.v_proj"],
Expand Down Expand Up @@ -103,6 +120,18 @@
"force_enable_checkpointing": True
},

"starcoder2/3b/base": _starcoder2_base,

"starcoder2/7b/base": {
**_starcoder2_base,
"force_enable_checkpointing": True
},

"starcoder2/15b/base": {
**_starcoder2_base,
"force_enable_checkpointing": True
},

"codellama/7b": {
"lora_target_modules_mapping": {
"qkv": ["self_attn.q_proj", "self_attn.k_proj", "self_attn.v_proj"],
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class PyPackage:
"webgui/static/dashboards/*", "webgui/static/assets/*"]),
"self_hosting_machinery": PyPackage(
requires=["python-multipart", "auto-gptq==0.6.0", "accelerate",
"termcolor", "torch", "transformers==4.38.1", "bitsandbytes",
"safetensors", "peft", "triton",
"termcolor", "torch", "transformers @ git+https://github.com/bigcode-project/transformers@starcoder2",
"bitsandbytes", "safetensors", "peft", "triton",
"torchinfo", "mpi4py", "deepspeed==0.12.6",
"sentence-transformers", "huggingface-hub>=0.19.3"],
optional=["ninja", "flash_attn @ git+https://github.com/smallcloudai/flash-attention@feat/alibi"],
Expand Down

0 comments on commit eb84f4a

Please sign in to comment.