Views
No views yet

trust_remote_code=True.TheBloke/GPT4All-13B-Snoozy-SuperHOT-8K-GPTQ.GPT4All-13B-Snoozy-SuperHOT-8K-GPTQpip3 install einops auto-gptqconfig.json has been hardcoded to a sequence length of 8192.config.json to set max_position_embeddings to the value you want.1from transformers import AutoTokenizer, pipeline, logging
2from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
3import argparse
4
5model_name_or_path = "TheBloke/GPT4All-13B-Snoozy-SuperHOT-8K-GPTQ"
6model_basename = "gpt4all-snoozy-13b-superhot-8k-GPTQ-4bit-128g.no-act.order"
7
8use_triton = False
9
10tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
11
12model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
13 model_basename=model_basename,
14 use_safetensors=True,
15 trust_remote_code=True,
16 device_map='auto',
17 use_triton=use_triton,
18 quantize_config=None)
19
20model.seqlen = 8192
21
22# Note: check the prompt template is correct for this model.
23prompt = "Tell me about AI"
24prompt_template=f'''USER: {prompt}
25ASSISTANT:'''
26
27print("\n\n*** Generate:")
28
29input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
30output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
31print(tokenizer.decode(output[0]))
32
33# Inference can also be done using transformers' pipeline
34
35# Prevent printing spurious transformers error when using pipeline with AutoGPTQ
36logging.set_verbosity(logging.CRITICAL)
37
38print("*** Pipeline:")
39pipe = pipeline(
40 "text-generation",
41 model=model,
42 tokenizer=tokenizer,
43 max_new_tokens=512,
44 temperature=0.7,
45 top_p=0.95,
46 repetition_penalty=1.15
47)
48
49print(pipe(prompt_template)[0]['generated_text'])llama_rope_scaled_monkey_patch.py, written by @kaiokendev.trust_remote_code=True. I have not tested this, and it should be superseded by using trust_remote_code=True, but I include it for completeness and for interest.gpt4all-snoozy-13b-superhot-8k-GPTQ-4bit-128g.no-act.order.safetensors
trust_remote_code=True is set.nomic-ai/gpt4all-j-prompt-generations using revision=v1.3-groovy| Model | BoolQ | PIQA | HellaSwag | WinoGrande | ARC-e | ARC-c | OBQA | Avg. |
|:--------------------------|:--------:|:--------:|:---------:|:----------:|:--------:|:--------:|:--------:|:--------:|
| GPT4All-J 6B v1.0 | 73.4 | 74.8 | 63.4 | 64.7 | 54.9 | 36.0 | 40.2 | 58.2 |
| GPT4All-J v1.1-breezy | 74.0 | 75.1 | 63.2 | 63.6 | 55.4 | 34.9 | 38.4 | 57.8 |
| GPT4All-J v1.2-jazzy | 74.8 | 74.9 | 63.6 | 63.8 | 56.6 | 35.3 | 41.0 | 58.6 |
| GPT4All-J v1.3-groovy | 73.6 | 74.3 | 63.8 | 63.5 | 57.7 | 35.0 | 38.8 | 58.1 |
| GPT4All-J Lora 6B | 68.6 | 75.8 | 66.2 | 63.5 | 56.4 | 35.7 | 40.2 | 58.1 |
| GPT4All LLaMa Lora 7B | 73.1 | 77.6 | 72.1 | 67.8 | 51.1 | 40.4 | 40.2 | 60.3 |
| GPT4All 13B snoozy | **83.3** | 79.2 | 75.0 | **71.3** | 60.9 | 44.2 | 43.4 | **65.3** |
| Dolly 6B | 68.8 | 77.3 | 67.6 | 63.9 | 62.9 | 38.7 | 41.2 | 60.1 |
| Dolly 12B | 56.7 | 75.4 | 71.0 | 62.2 | 64.6 | 38.5 | 40.4 | 58.4 |
| Alpaca 7B | 73.9 | 77.2 | 73.9 | 66.1 | 59.8 | 43.3 | 43.4 | 62.4 |
| Alpaca Lora 7B | 74.3 | **79.3** | 74.0 | 68.8 | 56.6 | 43.9 | 42.6 | 62.8 |
| GPT-J 6.7B | 65.4 | 76.2 | 66.2 | 64.1 | 62.2 | 36.6 | 38.2 | 58.4 |
| LLama 7B | 73.1 | 77.4 | 73.0 | 66.9 | 52.5 | 41.4 | 42.4 | 61.0 |
| LLama 13B | 68.5 | 79.1 | 76.2 | 70.1 | 60.0 | **44.6** | 42.2 | 63.0 |
| Pythia 6.7B | 63.5 | 76.3 | 64.0 | 61.1 | 61.3 | 35.2 | 37.2 | 57.0 |
| Pythia 12B | 67.7 | 76.6 | 67.3 | 63.8 | 63.9 | 34.8 | 38 | 58.9 |
| Fastchat T5 | 81.5 | 64.6 | 46.3 | 61.8 | 49.3 | 33.3 | 39.4 | 53.7 |
| Fastchat Vicuña 7B | 76.6 | 77.2 | 70.7 | 67.3 | 53.5 | 41.2 | 40.8 | 61.0 |
| Fastchat Vicuña 13B | 81.5 | 76.8 | 73.3 | 66.7 | 57.4 | 42.7 | 43.6 | 63.1 |
| StableVicuña RLHF | 82.3 | 78.6 | 74.1 | 70.9 | 61.0 | 43.5 | **44.4** | 65.0 |
| StableLM Tuned | 62.5 | 71.2 | 53.6 | 54.8 | 52.4 | 31.1 | 33.4 | 51.3 |
| StableLM Base | 60.1 | 67.4 | 41.2 | 50.1 | 44.9 | 27.0 | 32.0 | 42.2 |
| Koala 13B | 76.5 | 77.9 | 72.6 | 68.8 | 54.3 | 41.0 | 42.8 | 62.0 |
| Open Assistant Pythia 12B | 67.9 | 78.0 | 68.1 | 65.0 | 64.2 | 40.4 | 43.2 | 61.0 |
| Mosaic mpt-7B | 74.8 | **79.3** | **76.3** | 68.6 | **70.0** | 42.2 | 42.6 | 64.8 |
| text-davinci-003 | 88.1 | 83.8 | 83.4 | 75.8 | 83.9 | 63.9 | 51.0 | 75.7 |