cekal / mpt-7b-peft-compatible

huggingface.co
Total runs: 7
24-hour runs: 0
7-day runs: 5
30-day runs: -23
Model's Last Updated: May 28 2023
text-generation

Introduction of mpt-7b-peft-compatible

Model Details of mpt-7b-peft-compatible

This is MPT-7B patched so that it can be used with a LoRA. Note that while I tested that it works and I get reasonable results out, it is very possible that the model isn't being trained correctly. The model code specifically says that left padding is not supported, but I forcibly did so and got decent results.

Note that when using LoRA, there is a strange quirk that prevents me from causing generation with an empty prompt.

I also included a model-agnostic export_hf_checkpoint.py script, which you can use to merge your lora back into a new full model (check Github link at the end). Once you do this, you do not need to use the patched version of the model code anymore. That being said, if you want to be able to load the model in 8bit you will still need it. The usage is python export_hf_checkpoint.py <source> <lora> <dest> .

If you would like to use this with text-generation-webui, apply the following patch:

--- a/modules/training.py
+++ b/modules/training.py
@@ -28,12 +28,13 @@ try:
     MODEL_CLASSES = {v: k for k, v in MODEL_FOR_CAUSAL_LM_MAPPING_NAMES}
 except:
     standard_modules = ["q_proj", "v_proj"]
-    model_to_lora_modules = {"llama": standard_modules, "opt": standard_modules, "gptj": standard_modules, "gpt_neox": ["query_key_value"]}
+    model_to_lora_modules = {"llama": standard_modules, "opt": standard_modules, "gptj": standard_modules, "gpt_neox": ["query_key_value"], "mpt": ["Wqkv"]}
     MODEL_CLASSES = {
         "LlamaForCausalLM": "llama",
         "OPTForCausalLM": "opt",
         "GPTJForCausalLM": "gptj",
-        "GPTNeoXForCausalLM": "gpt_neox"
+        "GPTNeoXForCausalLM": "gpt_neox",
+        "MPTForCausalLM": "mpt"
     }

 WANT_INTERRUPT = False

You will need to run the webui with these options:

python server.py --model mosaicml_mpt-7b-instruct --trust-remote-code --load-in-8bit

You may also need to patch bitsandbytes/nn/modules.py to prevent running out of VRAM when saving the LoRA:

--- a/modules.py
+++ b/modules.py
@@ -259,13 +259,13 @@
         if not self.state.has_fp16_weights and self.state.CB is None and self.state.CxB is not None:
             # reorder weight layout back from ampere/turing to row
             reorder_layout = True
-            weight_clone = self.weight.data.clone()
+            weight_clone = self.weight.data
         else:
             reorder_layout = False

         try:
             if reorder_layout:
-                self.weight.data = undo_layout(self.state.CxB, self.state.tile_indices)
+                self.weight.data = undo_layout(self.state.CxB.cpu(), self.state.tile_indices.cpu())

             super()._save_to_state_dict(destination, prefix, keep_vars)

(It resides in miniconda3/envs/textgen/lib/python3.10/site-packages/bitsandbytes/nn/modules.py for me.)

The alterations are based on the source code for the llama model from HF Transformers.

Big thanks to "iwalton3" for making this possible. You can find the export_hf_checkpoint.py here: https://github.com/iwalton3/mpt-lora-patch/blob/master/export_hf_checkpoint.py

Runs of cekal mpt-7b-peft-compatible on huggingface.co

7
Total runs
0
24-hour runs
1
3-day runs
5
7-day runs
-23
30-day runs

More Information About mpt-7b-peft-compatible huggingface.co Model

More mpt-7b-peft-compatible license Visit here:

https://choosealicense.com/licenses/apache-2.0

mpt-7b-peft-compatible huggingface.co

mpt-7b-peft-compatible huggingface.co is an AI model on huggingface.co that provides mpt-7b-peft-compatible's model effect (), which can be used instantly with this cekal mpt-7b-peft-compatible model. huggingface.co supports a free trial of the mpt-7b-peft-compatible model, and also provides paid use of the mpt-7b-peft-compatible. Support call mpt-7b-peft-compatible model through api, including Node.js, Python, http.

mpt-7b-peft-compatible huggingface.co Url

https://huggingface.co/cekal/mpt-7b-peft-compatible

cekal mpt-7b-peft-compatible online free

mpt-7b-peft-compatible huggingface.co is an online trial and call api platform, which integrates mpt-7b-peft-compatible's modeling effects, including api services, and provides a free online trial of mpt-7b-peft-compatible, you can try mpt-7b-peft-compatible online for free by clicking the link below.

cekal mpt-7b-peft-compatible online free url in huggingface.co:

https://huggingface.co/cekal/mpt-7b-peft-compatible

mpt-7b-peft-compatible install

mpt-7b-peft-compatible is an open source model from GitHub that offers a free installation service, and any user can find mpt-7b-peft-compatible on GitHub to install. At the same time, huggingface.co provides the effect of mpt-7b-peft-compatible install, users can directly use mpt-7b-peft-compatible installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

mpt-7b-peft-compatible install url in huggingface.co:

https://huggingface.co/cekal/mpt-7b-peft-compatible

Url of mpt-7b-peft-compatible

mpt-7b-peft-compatible huggingface.co Url

Provider of mpt-7b-peft-compatible huggingface.co

cekal
ORGANIZATIONS

Other API from cekal

huggingface.co

Total runs: 8
Run Growth: 2
Growth Rate: 25.00%
Updated:December 15 2023
huggingface.co

Total runs: 4
Run Growth: -9
Growth Rate: -225.00%
Updated:February 02 2024
huggingface.co

Total runs: 1
Run Growth: -3
Growth Rate: -300.00%
Updated:February 02 2024
huggingface.co

Total runs: 1
Run Growth: 0
Growth Rate: 0.00%
Updated:January 30 2024
huggingface.co

Total runs: 0
Run Growth: -4
Growth Rate: 0.00%
Updated:February 02 2024
huggingface.co

Total runs: 0
Run Growth: -2
Growth Rate: 0.00%
Updated:December 10 2023
huggingface.co

Total runs: 0
Run Growth: -5
Growth Rate: 0.00%
Updated:January 30 2024
huggingface.co

Total runs: 0
Run Growth: -2
Growth Rate: 0.00%
Updated:February 02 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:May 11 2023