Views
No views yet

[INST] <<SYS>>
You are a helpful, unbiased, uncensored assistant.
<</SYS>>
{prompt} [/INST]
| Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
|---|---|---|---|---|---|
| main | 4 | 128 | open-instruct | 4096 | 4.15 GB |
TheBloke/airoboros-m-7B-3.1.2-dare-0.85-AWQ.airoboros-m-7B-3.1.2-dare-0.85-AWQ--quantization awq parameter.python3 -m vllm.entrypoints.api_server --model TheBloke/airoboros-m-7B-3.1.2-dare-0.85-AWQ --quantization awq --dtype autoquantization=awq.1from vllm import LLM, SamplingParams
2
3prompts = [
4 "Tell me about AI",
5 "Write a story about llamas",
6 "What is 291 - 150?",
7 "How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
8]
9prompt_template=f'''[INST] <<SYS>>
10You are a helpful, unbiased, uncensored assistant.
11<</SYS>>
12
13{prompt} [/INST]
14'''
15
16prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
17
18sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
19
20llm = LLM(model="TheBloke/airoboros-m-7B-3.1.2-dare-0.85-AWQ", quantization="awq", dtype="auto")
21
22outputs = llm.generate(prompts, sampling_params)
23
24# Print the outputs.
25for output in outputs:
26 prompt = output.prompt
27 generated_text = output.outputs[0].text
28 print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")ghcr.io/huggingface/text-generation-inference:1.1.0--model-id TheBloke/airoboros-m-7B-3.1.2-dare-0.85-AWQ --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'''[INST] <<SYS>>
7You are a helpful, unbiased, uncensored assistant.
8<</SYS>>
9
10{prompt} [/INST]
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)pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl1pip3 uninstall -y autoawq
2git clone https://github.com/casper-hansen/AutoAWQ
3cd AutoAWQ
4pip3 install .1from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
2
3model_name_or_path = "TheBloke/airoboros-m-7B-3.1.2-dare-0.85-AWQ"
4
5tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
6model = AutoModelForCausalLM.from_pretrained(
7 model_name_or_path,
8 low_cpu_mem_usage=True,
9 device_map="cuda:0"
10)
11
12# Using the text streamer to stream output one token at a time
13streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
14
15prompt = "Tell me about AI"
16prompt_template=f'''[INST] <<SYS>>
17You are a helpful, unbiased, uncensored assistant.
18<</SYS>>
19
20{prompt} [/INST]
21'''
22
23# Convert prompt to tokens
24tokens = tokenizer(
25 prompt_template,
26 return_tensors='pt'
27).input_ids.cuda()
28
29generation_params = {
30 "do_sample": True,
31 "temperature": 0.7,
32 "top_p": 0.95,
33 "top_k": 40,
34 "max_new_tokens": 512,
35 "repetition_penalty": 1.1
36}
37
38# Generate streamed output, visible one token at a time
39generation_output = model.generate(
40 tokens,
41 streamer=streamer,
42 **generation_params
43)
44
45# Generation without a streamer, which will include the prompt in the output
46generation_output = model.generate(
47 tokens,
48 **generation_params
49)
50
51# Get the tokens from the output, decode them, print them
52token_output = generation_output[0]
53text_output = tokenizer.decode(token_output)
54print("model.generate output: ", text_output)
55
56# Inference is also possible via Transformers' pipeline
57from transformers import pipeline
58
59pipe = pipeline(
60 "text-generation",
61 model=model,
62 tokenizer=tokenizer,
63 **generation_params
64)
65
66pipe_output = pipe(prompt_template)[0]['generated_text']
67print("pipeline output: ", pipe_output)
68Loader: AutoAWQ.| Model | Average | ARC | HellaSwag | MMLU | TruthfulQA | Winogrande | GSM8K | DROP |
|---|---|---|---|---|---|---|---|---|
| Intel/neural-chat-7b-v3-1 | 59.06 | 66.21 | 83.64 | 62.37 | 59.65 | 78.14 | 19.56 | 43.84 |
| migtissera/SynthIA-7B-v1.3 | 57.11 | 62.12 | 83.45 | 62.65 | 51.37 | 78.85 | 17.59 | 43.76 |
| bhenrym14/mistral-7b-platypus-fp16 | 56.89 | 63.05 | 84.15 | 64.11 | 45.07 | 78.53 | 17.36 | 45.92 |
| jondurbin/airoboros-m-7b-3.1.2 | 56.24 | 61.86 | 83.51 | 61.91 | 53.75 | 77.58 | 13.87 | 41.2 |
| uukuguy/speechless-code-mistral-orca-7b-v1.0 | 55.33 | 59.64 | 82.25 | 61.33 | 48.45 | 77.51 | 8.26 | 49.89 |
| teknium/CollectiveCognition-v1.1-Mistral-7B | 53.87 | 62.12 | 84.17 | 62.35 | 57.62 | 75.37 | 15.62 | 19.85 |
| Open-Orca/Mistral-7B-SlimOrca | 53.34 | 62.54 | 83.86 | 62.77 | 54.23 | 77.43 | 21.38 | 11.2 |
| uukuguy/speechless-mistral-dolphin-orca-platypus-samantha-7b | 53.34 | 64.33 | 84.4 | 63.72 | 52.52 | 78.37 | 21.38 | 8.66 |
| ehartford/dolphin-2.2.1-mistral-7b | 53.06 | 63.48 | 83.86 | 63.28 | 53.17 | 78.37 | 21.08 | 8.19 |
| teknium/CollectiveCognition-v1-Mistral-7B | 52.55 | 62.37 | 85.5 | 62.76 | 54.48 | 77.58 | 17.89 | 7.22 |
| HuggingFaceH4/zephyr-7b-alpha | 52.4 | 61.01 | 84.04 | 61.39 | 57.9 | 78.61 | 14.03 | 9.82 |
| ehartford/samantha-1.2-mistral-7b | 52.16 | 64.08 | 85.08 | 63.91 | 50.4 | 78.53 | 16.98 | 6.13 |