Views
No views yet

<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
desc_act. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|---|---|---|---|---|---|---|---|---|---|
| main | 4 | 128 | Yes | 0.1 | wikitext | 4096 | 4.16 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
| gptq-4bit-32g-actorder_True | 4 | 32 | Yes | 0.1 | wikitext | 4096 | 4.57 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
| gptq-8bit--1g-actorder_True | 8 | None | Yes | 0.1 | wikitext | 4096 | 7.52 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
| gptq-8bit-128g-actorder_True | 8 | 128 | Yes | 0.1 | wikitext | 4096 | 7.68 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
| gptq-8bit-32g-actorder_True | 8 | 32 | Yes | 0.1 | wikitext | 4096 | 8.17 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
| gptq-4bit-64g-actorder_True | 4 | 64 | Yes | 0.1 | wikitext | 4096 | 4.30 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
main branch, enter TheBloke/jackalope-7B-GPTQ in the "Download model" box.:branchname to the end of the download name, eg TheBloke/jackalope-7B-GPTQ:gptq-4bit-32g-actorder_Truehuggingface-hub Python library:pip3 install huggingface-hubmain branch to a folder called jackalope-7B-GPTQ:1mkdir jackalope-7B-GPTQ
2huggingface-cli download TheBloke/jackalope-7B-GPTQ --local-dir jackalope-7B-GPTQ --local-dir-use-symlinks False--revision parameter:1mkdir jackalope-7B-GPTQ
2huggingface-cli download TheBloke/jackalope-7B-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir jackalope-7B-GPTQ --local-dir-use-symlinks False--local-dir-use-symlinks False parameter, the files will instead be stored in the central Huggingface cache directory (default location on Linux is: ~/.cache/huggingface), and symlinks will be added to the specified --local-dir, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.HF_HOME environment variable, and/or the --cache-dir parameter to huggingface-cli.huggingface-cli, please see: HF -> Hub Python Library -> Download files -> Download from the CLI.hf_transfer:pip3 install hf_transferHF_HUB_ENABLE_HF_TRANSFER to 1:1mkdir jackalope-7B-GPTQ
2HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/jackalope-7B-GPTQ --local-dir jackalope-7B-GPTQ --local-dir-use-symlinks Falseset HF_HUB_ENABLE_HF_TRANSFER=1 before the download command.git (not recommended)git, use a command like this:git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/jackalope-7B-GPTQhuggingface-hub, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the .git folder as a blob.)TheBloke/jackalope-7B-GPTQ.TheBloke/jackalope-7B-GPTQ:gptq-4bit-32g-actorder_Truejackalope-7B-GPTQquantize_config.json.ghcr.io/huggingface/text-generation-inference:1.1.0--model-id TheBloke/jackalope-7B-GPTQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096pip3 install huggingface-hub1from huggingface_hub import InferenceClient
2
3endpoint_url = "https://your-endpoint-url-here"
4
5prompt = "Tell me about AI"
6prompt_template=f'''<|im_start|>system
7{system_message}<|im_end|>
8<|im_start|>user
9{prompt}<|im_end|>
10<|im_start|>assistant
11'''
12
13client = InferenceClient(endpoint_url)
14response = client.text_generation(prompt,
15 max_new_tokens=128,
16 do_sample=True,
17 temperature=0.7,
18 top_p=0.95,
19 top_k=40,
20 repetition_penalty=1.1)
21
22print(f"Model output: {response}")1pip3 install transformers optimum
2pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.71pip3 uninstall -y auto-gptq
2git clone https://github.com/PanQiWei/AutoGPTQ
3cd AutoGPTQ
4git checkout v0.4.2
5pip3 install .1from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
2
3model_name_or_path = "TheBloke/jackalope-7B-GPTQ"
4# To use a different branch, change revision
5# For example: revision="gptq-4bit-32g-actorder_True"
6model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
7 device_map="auto",
8 trust_remote_code=False,
9 revision="main")
10
11tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
12
13prompt = "Tell me about AI"
14prompt_template=f'''<|im_start|>system
15{system_message}<|im_end|>
16<|im_start|>user
17{prompt}<|im_end|>
18<|im_start|>assistant
19'''
20
21print("\n\n*** Generate:")
22
23input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
24output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
25print(tokenizer.decode(output[0]))
26
27# Inference can also be done using transformers' pipeline
28
29print("*** Pipeline:")
30pipe = pipeline(
31 "text-generation",
32 model=model,
33 tokenizer=tokenizer,
34 max_new_tokens=512,
35 do_sample=True,
36 temperature=0.7,
37 top_p=0.95,
38 top_k=40,
39 repetition_penalty=1.1
40)
41
42print(pipe(prompt_template)[0]['generated_text'])

<|im_start|> and <|im_end|> tokens added to support this.MPT-Chat" instruction template should work, as it also uses ChatML.apply_chat_template() method:1chat = [
2 {"role": "system", "content": "You are JackalopeAI, a large language model trained by OpenAccess AI Collective. Write out your reasoning step-by-step to be sure you get the right answers!"}
3 {"role": "user", "content": "How are you?"},
4 {"role": "assistant", "content": "I am doing well!"},
5 {"role": "user", "content": "Please tell me about the mythical creatures called jackalopes."},
6]
7tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)<|im_start|>system
You are JackalopeAI. Write out your reasoning step-by-step to be sure you get the right answers!
<|im_end|>
<|im_start|>user
How are you?<|im_end|>
<|im_start|>assistant
I am doing well!<|im_end|>
<|im_start|>user
Please tell me about the mythical creatures called jackalopes.<|im_end|>
<|im_start|>assistanttokenize=True and return_tensors="pt" instead, then you will get a tokenized
and formatted conversation ready to pass to model.generate().
| Metric | Value |
|---|---|
| MMLU (5-shot) | 63.63 |
| ARC (25-shot) | 63.31 |
| HellaSwag (10-shot) | 83.29 |
| TruthfulQA (0-shot) | 49.99 |
| Avg. | 65.06 |
1@software{lian2023jackalope,
2 title = {Jackalope 7B: Mistral-7B Model Multi-Turn Chat tuned on Filtered OpenOrcaV1 GPT-4 Dataset},
3 author = {Wing Lian and Bleys Goodson and Guan Wang and Eugene Pentland and Austin Cook and Chanvichet Vong and "Teknium"},
4 year = {2023},
5 publisher = {HuggingFace},
6 journal = {HuggingFace repository},
7 howpublished = {\url{openaccess-ai-collective/jackalope-7b},
8}
9@misc{mukherjee2023orca,
10 title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
11 author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
12 year={2023},
13 eprint={2306.02707},
14 archivePrefix={arXiv},
15 primaryClass={cs.CL}
16}
17@misc{longpre2023flan,
18 title={The Flan Collection: Designing Data and Methods for Effective Instruction Tuning},
19 author={Shayne Longpre and Le Hou and Tu Vu and Albert Webson and Hyung Won Chung and Yi Tay and Denny Zhou and Quoc V. Le and Barret Zoph and Jason Wei and Adam Roberts},
20 year={2023},
21 eprint={2301.13688},
22 archivePrefix={arXiv},
23 primaryClass={cs.AI}
24}