From 37d2571805582f63f51e7c7245863a23b07fba79 Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Wed, 16 Sep 2026 08:38:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E7=94=B1ModelHub=20XC=E7=A4=BE=E5=8C=BA=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model: TheBloke/openchat_v2_openorca_preview-GPTQ Source: Original Platform --- .gitattributes | 35 +++++ README.md | 292 ++++++++++++++++++++++++++++++++++++++++ added_tokens.json | 3 + config.json | 33 +++++ configuration.json | 1 + model.safetensors | 3 + quantize_config.json | 9 ++ special_tokens_map.json | 26 ++++ tokenizer.model | 3 + tokenizer_config.json | 33 +++++ 10 files changed, 438 insertions(+) create mode 100644 .gitattributes create mode 100644 README.md create mode 100644 added_tokens.json create mode 100644 config.json create mode 100644 configuration.json create mode 100644 model.safetensors create mode 100644 quantize_config.json create mode 100644 special_tokens_map.json create mode 100644 tokenizer.model create mode 100644 tokenizer_config.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..a6344aa --- /dev/null +++ b/.gitattributes @@ -0,0 +1,35 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md new file mode 100644 index 0000000..08e6e42 --- /dev/null +++ b/README.md @@ -0,0 +1,292 @@ +--- +datasets: +- Open-Orca/OpenOrca +inference: false +license: other +model_type: llama +--- + + + +
+TheBlokeAI +
+
+
+

Chat & support: TheBloke's Discord server

+
+
+

Want to contribute? TheBloke's Patreon page

+
+
+

TheBloke's LLM work is generously supported by a grant from andreessen horowitz (a16z)

+
+ + +# Open-Orca's OpenChat V2 x OpenOrca Preview 2 GPTQ + +These files are GPTQ model files for [Open-Orca's OpenChat V2 x OpenOrca Preview 2](https://huggingface.co/openchat/openchat_v2_openorca_preview). + +Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them. + +These models were quantised using hardware kindly provided by [Latitude.sh](https://www.latitude.sh/accelerate). + +## Repositories available + +* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/openchat_v2_openorca_preview-GPTQ) +* [Unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/openchat/openchat_v2_openorca_preview) + +## Prompt template: custom + +The conversation template involves concatenating tokens, and cannot be expressed in plain-text. + +Besides base model vocabulary, an end-of-turn token <|end_of_turn|> is added. + +Here is an example of single-round conversation template: + +```python +def tokenize_single_input(tokenizer, prompt): + # OpenChat V2 + human_prefix = "User:" + prefix = "Assistant GPT4:" + eot_token = "<|end_of_turn|>" + bos_token = "" + + def _tokenize(text): + return tokenizer.convert_tokens_to_ids(tokenizer._tokenize(text)) + + def _tokenize_special(special_name): + return tokenizer.convert_tokens_to_ids(special_name) + + return [_tokenize_special(bos_token)] + _tokenize(human_prefix) + _tokenize(prompt) + [_tokenize_special(eot_token)] + \ + _tokenize(prefix) +``` + +To explore conditional language models, you can also set prefix = "Assistant GPT3:" to mimic ChatGPT behavior (this may cause performance degradation). + +Hint: In BPE, tokenize(A) + tokenize(B) does not always equals to tokenize(A + B). + +Due to the custom tokenisation, GGMLs will not be provided. + +## Provided files + +Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements. + +Each separate quant is in a different branch. See below for instructions on fetching from different branches. + +| Branch | Bits | Group Size | Act Order (desc_act) | File Size | ExLlama Compatible? | Made With | Description | +| ------ | ---- | ---------- | -------------------- | --------- | ------------------- | --------- | ----------- | +| main | 4 | 128 | False | 7.45 GB | True | GPTQ-for-LLaMa | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. | +| gptq-4bit-32g-actorder_True | 4 | 32 | True | 8.00 GB | True | AutoGPTQ | 4-bit, with Act Order and group size. 32g gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. | +| gptq-4bit-64g-actorder_False | 4 | 64 | False | 7.51 GB | True | AutoGPTQ | 4-bit, without Act Order and group size. Without Act Order to improve AutoGPTQ speed, and better accuracy than 128g-False. | +| gptq-4bit-64g-actorder_True | 4 | 64 | True | 7.51 GB | True | AutoGPTQ | 4-bit, with Act Order and group size. 64g uses less VRAM than 32g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. | +| gptq-4bit-128g-actorder_True | 4 | 128 | True | 7.26 GB | True | AutoGPTQ | 4-bit, with Act Order and group size. 128g uses even less VRAM, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. | +| gptq-8bit--1g-actorder_True | 8 | None | True | 13.36 GB | False | AutoGPTQ | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. | +| gptq-8bit-128g-actorder_True | 8 | 128 | True | 13.65 GB | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. Poor AutoGPTQ CUDA speed. | +| gptq-8bit-128g-actorder_False | 8 | 128 | False | 13.65 GB | False | AutoGPTQ | 8-bit, with group size 128g for higher inference quality and without Act Order to improve AutoGPTQ speed. | + +## How to download from branches + +- In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/openchat_v2_openorca_preview-GPTQ:gptq-4bit-32g-actorder_True` +- With Git, you can clone a branch with: +``` +git clone --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/openchat_v2_openorca_preview-GPTQ` +``` +- In Python Transformers code, the branch is the `revision` parameter; see below. + +## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui). + +NOTE: Due to the custom tokenisation, it is probably not possible to usefully use this model in text-generation-webui right now. + +I will leave the below instructions in case support is possible, or is added. If/when it does work, let me know and I'll remove this message. + +**Please do not get in touch saying it doesn't work in text-generation-webui!** + +Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui). + +It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install. + +1. Click the **Model tab**. +2. Under **Download custom model or LoRA**, enter `TheBloke/openchat_v2_openorca_preview-GPTQ`. + - To download from a specific branch, enter for example `TheBloke/openchat_v2_openorca_preview-GPTQ:gptq-4bit-32g-actorder_True` + - see Provided Files above for the list of branches for each option. +3. Click **Download**. +4. The model will start downloading. Once it's finished it will say "Done" +5. In the top left, click the refresh icon next to **Model**. +6. In the **Model** dropdown, choose the model you just downloaded: `openchat_v2_openorca_preview-GPTQ` +7. The model will automatically load, and is now ready for use! +8. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right. + * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`. +9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started! + +## How to use this GPTQ model from Python code + +First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) installed: + +`GITHUB_ACTIONS=true pip install auto-gptq` + +Then try the following example code: + +```python +from transformers import AutoTokenizer, pipeline, logging +from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig + +model_name_or_path = "TheBloke/openchat_v2_openorca_preview-GPTQ" +model_basename = "openorca-openchat-v2-preview2-GPTQ-4bit-128g.no-act.order" + +use_triton = False + +tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True) + +model = AutoGPTQForCausalLM.from_quantized(model_name_or_path, + model_basename=model_basename + use_safetensors=True, + trust_remote_code=True, + device="cuda:0", + use_triton=use_triton, + quantize_config=None) + +""" +To download from a specific branch, use the revision parameter, as in this example: + +model = AutoGPTQForCausalLM.from_quantized(model_name_or_path, + revision="gptq-4bit-32g-actorder_True", + model_basename=model_basename, + use_safetensors=True, + trust_remote_code=True, + device="cuda:0", + quantize_config=None) +""" + +prompt = "Tell me about AI" + +def tokenize_single_input(tokenizer, prompt): + # OpenChat V2 + human_prefix = "User:" + prefix = "Assistant GPT4:" + eot_token = "<|end_of_turn|>" + bos_token = "" + + def _tokenize(text): + return tokenizer.convert_tokens_to_ids(tokenizer._tokenize(text)) + + def _tokenize_special(special_name): + return tokenizer.convert_tokens_to_ids(special_name) + + return [_tokenize_special(bos_token)] + _tokenize(human_prefix) + _tokenize(prompt) + [_tokenize_special(eot_token)] + \ + _tokenize(prefix) + +print("\n\n*** Generate:") + +input_ids = tokenizer_single_input(tokenizer, prompt) +output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512) +print(tokenizer.decode(output[0])) +``` + +## Compatibility + +The files provided will work with AutoGPTQ (CUDA and Triton modes), GPTQ-for-LLaMa (only CUDA has been tested), and Occ4m's GPTQ-for-LLaMa fork. + +ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility. + + + +## Discord + +For further support, and discussions on these models and AI in general, join us at: + +[TheBloke AI's Discord server](https://discord.gg/theblokeai) + +## Thanks, and how to contribute. + +Thanks to the [chirper.ai](https://chirper.ai) team! + +I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training. + +If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects. + +Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits. + +* Patreon: https://patreon.com/TheBlokeAI +* Ko-Fi: https://ko-fi.com/TheBlokeAI + +**Special thanks to**: Aemon Algiz. + +**Patreon special mentions**: Sam, theTransient, Jonathan Leane, Steven Wood, webtim, Johann-Peter Hartmann, Geoffrey Montalvo, Gabriel Tamborski, Willem Michiel, John Villwock, Derek Yates, Mesiah Bishop, Eugene Pentland, Pieter, Chadd, Stephen Murray, Daniel P. Andersen, terasurfer, Brandon Frisco, Thomas Belote, Sid, Nathan LeClaire, Magnesian, Alps Aficionado, Stanislav Ovsiannikov, Alex, Joseph William Delisle, Nikolai Manek, Michael Davis, Junyu Yang, K, J, Spencer Kim, Stefan Sabev, Olusegun Samson, transmissions 11, Michael Levine, Cory Kujawski, Rainer Wilmers, zynix, Kalila, Luke @flexchar, Ajan Kanaga, Mandus, vamX, Ai Maven, Mano Prime, Matthew Berman, subjectnull, Vitor Caleffi, Clay Pascal, biorpg, alfie_i, 阿明, Jeffrey Morgan, ya boyyy, Raymond Fosdick, knownsqashed, Olakabola, Leonard Tan, ReadyPlayerEmma, Enrico Ros, Dave, Talal Aujan, Illia Dulskyi, Sean Connelly, senxiiz, Artur Olbinski, Elle, Raven Klaugh, Fen Risland, Deep Realms, Imad Khwaja, Fred von Graf, Will Dee, usrbinkat, SuperWojo, Alexandros Triantafyllidis, Swaroop Kallakuri, Dan Guido, John Detwiler, Pedro Madruga, Iucharbius, Viktor Bowallius, Asp the Wyvern, Edmond Seymore, Trenton Dambrowitz, Space Cruiser, Spiking Neurons AB, Pyrater, LangChain4j, Tony Hughes, Kacper Wikieł, Rishabh Srivastava, David Ziegler, Luke Pendergrass, Andrey, Gabriel Puliatti, Lone Striker, Sebastain Graf, Pierre Kircher, Randy H, NimbleBox.ai, Vadim, danny, Deo Leter + + +Thank you to all my generous patrons and donaters! + +And thank you again to a16z for their generous grant. + + + +# Original model card: Open-Orca's OpenChat V2 x OpenOrca Preview 2 + + +# OpenChat V2 x OpenOrca Preview 2 + +This is a preview version of [OpenChat V2](https://github.com/imoneoi/openchat) trained for 2 epochs (total 5 epochs) on full (4.5M) [OpenOrca dataset](https://huggingface.co/datasets/Open-Orca/OpenOrca). + +
+ +

+ +
+ +## AGIEval Preliminary Results + +``` +OpenChat V2 OpenOrca Preview + + name accuracy unmatched + aqua-rat.zero-shot 0.232283 0.0 + logiqa-en.zero-shot 0.370200 0.0 + lsat-ar.zero-shot 0.230435 0.0 + lsat-lr.zero-shot 0.441176 0.0 + lsat-rc.zero-shot 0.568773 0.0 +sat-en-without-passage.zero-shot 0.393204 0.0 + sat-en.zero-shot 0.747573 0.0 + sat-math.zero-shot 0.295455 0.0 + Average 0.409887 0.0 + +AGIEval Average reported in Orca paper: 0.417 +``` + +## Serving + +This model is compatible with [OpenChat V2](https://github.com/imoneoi/openchat) vLLM OpenAI API server. It can be used as a drop-in replacement for OpenChat V2 weights. + +```bash +python -m ochat.serving.openai_api_server --model_type openchat_v2 --model openchat/openchat_v2_openorca_preview --engine-use-ray --worker-use-ray +``` + +## Conversation Template + +The conversation template **involves concatenating tokens**, and cannot be expressed in plain-text. + +Besides base model vocabulary, an end-of-turn token `<|end_of_turn|>` is added. + +Here is an example of single-round conversation template: + +```python +def tokenize_single_input(tokenizer, prompt): + # OpenChat V2 + human_prefix = "User:" + prefix = "Assistant GPT4:" + eot_token = "<|end_of_turn|>" + bos_token = "" + + def _tokenize(text): + return tokenizer.convert_tokens_to_ids(tokenizer._tokenize(text)) + + def _tokenize_special(special_name): + return tokenizer.convert_tokens_to_ids(special_name) + + return [_tokenize_special(bos_token)] + _tokenize(human_prefix) + _tokenize(prompt) + [_tokenize_special(eot_token)] + \ + _tokenize(prefix) +``` + +To explore conditional language models, you can also set `prefix = "Assistant GPT3:"` to mimic ChatGPT behavior (this may cause performance degradation). + +*Hint: In BPE, `tokenize(A) + tokenize(B)` does not always equals to `tokenize(A + B)`* diff --git a/added_tokens.json b/added_tokens.json new file mode 100644 index 0000000..fe425ce --- /dev/null +++ b/added_tokens.json @@ -0,0 +1,3 @@ +{ + "<|end_of_turn|>": 32000 +} diff --git a/config.json b/config.json new file mode 100644 index 0000000..df5fce5 --- /dev/null +++ b/config.json @@ -0,0 +1,33 @@ +{ + "_name_or_path": "/data/one/LLaMA_13B_with_EOT_token", + "architectures": [ + "LlamaForCausalLM" + ], + "bos_token_id": 1, + "eos_token_id": 2, + "hidden_act": "silu", + "hidden_size": 5120, + "initializer_range": 0.02, + "intermediate_size": 13824, + "max_position_embeddings": 2048, + "model_type": "llama", + "num_attention_heads": 40, + "num_hidden_layers": 40, + "pad_token_id": 0, + "rms_norm_eps": 1e-06, + "tie_word_embeddings": false, + "torch_dtype": "bfloat16", + "transformers_version": "4.30.1", + "use_cache": true, + "vocab_size": 32001, + "quantization_config": { + "bits": 4, + "group_size": 128, + "damp_percent": 0.01, + "desc_act": false, + "sym": true, + "true_sequential": true, + "model_file_base_name": "model", + "quant_method": "gptq" + } +} \ No newline at end of file diff --git a/configuration.json b/configuration.json new file mode 100644 index 0000000..bbeeda1 --- /dev/null +++ b/configuration.json @@ -0,0 +1 @@ +{"framework": "pytorch", "task": "text-generation", "allow_remote": true} \ No newline at end of file diff --git a/model.safetensors b/model.safetensors new file mode 100644 index 0000000..69c193e --- /dev/null +++ b/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbb669d29905f7b3ae6bf8cc378708031ded37702bab3c704388fddd70dd9b44 +size 7454817784 diff --git a/quantize_config.json b/quantize_config.json new file mode 100644 index 0000000..c7e3b0d --- /dev/null +++ b/quantize_config.json @@ -0,0 +1,9 @@ +{ + "bits": 4, + "group_size": 128, + "damp_percent": 0.01, + "desc_act": false, + "sym": true, + "true_sequential": true, + "model_file_base_name": "model" +} \ No newline at end of file diff --git a/special_tokens_map.json b/special_tokens_map.json new file mode 100644 index 0000000..f62c7dc --- /dev/null +++ b/special_tokens_map.json @@ -0,0 +1,26 @@ +{ + "additional_special_tokens": [ + "<|end_of_turn|>" + ], + "bos_token": { + "content": "", + "lstrip": false, + "normalized": true, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "", + "lstrip": false, + "normalized": true, + "rstrip": false, + "single_word": false + }, + "unk_token": { + "content": "", + "lstrip": false, + "normalized": true, + "rstrip": false, + "single_word": false + } +} diff --git a/tokenizer.model b/tokenizer.model new file mode 100644 index 0000000..6c00c74 --- /dev/null +++ b/tokenizer.model @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347 +size 499723 diff --git a/tokenizer_config.json b/tokenizer_config.json new file mode 100644 index 0000000..400e3de --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,33 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "bos_token": { + "__type": "AddedToken", + "content": "", + "lstrip": false, + "normalized": true, + "rstrip": false, + "single_word": false + }, + "clean_up_tokenization_spaces": false, + "eos_token": { + "__type": "AddedToken", + "content": "", + "lstrip": false, + "normalized": true, + "rstrip": false, + "single_word": false + }, + "model_max_length": 1000000000000000019884624838656, + "pad_token": null, + "sp_model_kwargs": {}, + "tokenizer_class": "LlamaTokenizer", + "unk_token": { + "__type": "AddedToken", + "content": "", + "lstrip": false, + "normalized": true, + "rstrip": false, + "single_word": false + } +}