Views
No views yet

pip3 install git+https://github.com/huggingface/transformers.git{prompt}
| Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
|---|---|---|---|---|---|
| main | 4 | 128 | VMware Open Instruct | 8192 | 24.65 GB |
TheBloke/UNAversal-8x7B-v1beta-AWQ.UNAversal-8x7B-v1beta-AWQ--quantization awq parameter.python3 -m vllm.entrypoints.api_server --model TheBloke/UNAversal-8x7B-v1beta-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'''{prompt}
10'''
11
12prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
13
14sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
15
16llm = LLM(model="TheBloke/UNAversal-8x7B-v1beta-AWQ", quantization="awq", dtype="auto")
17
18outputs = llm.generate(prompts, sampling_params)
19
20# Print the outputs.
21for output in outputs:
22 prompt = output.prompt
23 generated_text = output.outputs[0].text
24 print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")ghcr.io/huggingface/text-generation-inference:1.1.0--model-id TheBloke/UNAversal-8x7B-v1beta-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'''{prompt}
7'''
8
9client = InferenceClient(endpoint_url)
10response = client.text_generation(prompt,
11 max_new_tokens=128,
12 do_sample=True,
13 temperature=0.7,
14 top_p=0.95,
15 top_k=40,
16 repetition_penalty=1.1)
17
18print(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/UNAversal-8x7B-v1beta-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'''{prompt}
17'''
18
19# Convert prompt to tokens
20tokens = tokenizer(
21 prompt_template,
22 return_tensors='pt'
23).input_ids.cuda()
24
25generation_params = {
26 "do_sample": True,
27 "temperature": 0.7,
28 "top_p": 0.95,
29 "top_k": 40,
30 "max_new_tokens": 512,
31 "repetition_penalty": 1.1
32}
33
34# Generate streamed output, visible one token at a time
35generation_output = model.generate(
36 tokens,
37 streamer=streamer,
38 **generation_params
39)
40
41# Generation without a streamer, which will include the prompt in the output
42generation_output = model.generate(
43 tokens,
44 **generation_params
45)
46
47# Get the tokens from the output, decode them, print them
48token_output = generation_output[0]
49text_output = tokenizer.decode(token_output)
50print("model.generate output: ", text_output)
51
52# Inference is also possible via Transformers' pipeline
53from transformers import pipeline
54
55pipe = pipeline(
56 "text-generation",
57 model=model,
58 tokenizer=tokenizer,
59 **generation_params
60)
61
62pipe_output = pipe(prompt_template)[0]['generated_text']
63print("pipeline output: ", pipe_output)
64Loader: AutoAWQ.|Tasks|Version| Filter |n-shot| Metric |Value | |Stderr|
|-----|-------|----------|-----:|-----------|-----:|---|-----:|
|gsm8k|Yaml |get-answer| 5|exact_match|0.6603|± | 0.013|| Tasks |Version|Filter|n-shot| Metric |Value | |Stderr|
|-------------|-------|------|-----:|--------|-----:|---|-----:|
|arc_challenge|Yaml |none | 25|acc |0.6621|± |0.0138|
| | |none | 25|acc_norm|0.6962|± |0.0134|| Tasks |Version|Filter|n-shot|Metric|Value | |Stderr|
|--------------|-------|------|-----:|------|-----:|---|-----:|
|truthfulqa_mc2|Yaml |none | 0|acc |0.7122|± |0.0141|| Tasks |Version|Filter|n-shot| Metric |Value | |Stderr|
|--------------|-------|------|-----:|----------|-----:|---|-----:|
|arc_challenge |Yaml |none | 0|acc |0.6101|± |0.0143|
| | |none | 0|acc_norm |0.6425|± |0.0140|
|arc_easy |Yaml |none | 0|acc |0.8615|± |0.0071|
| | |none | 0|acc_norm |0.8375|± |0.0076|
|boolq |Yaml |none | 0|acc |0.8624|± |0.0060|
|lambada_openai|Yaml |none | 0|perplexity|2.8318|± |0.0507|
| | |none | 0|acc |0.7650|± |0.0059|
|mathqa |Yaml |none | 0|acc |0.4472|± |0.0091|
| | |none | 0|acc_norm |0.4436|± |0.0091|
|piqa |Yaml |none | 0|acc |0.8292|± |0.0088|
| | |none | 0|acc_norm |0.8422|± |0.0085|
|pubmedqa |Yaml |none | 0|acc |0.7920|± |0.0182|
|sciq |Yaml |none | 0|acc |0.9630|± |0.0060|
| | |none | 0|acc_norm |0.9370|± |0.0077|vllm (pretrained=fblgit/UNAversal-8x7B-v1beta,tensor_parallel_size=2,data_parallel_size=4,gpu_memory_utilization=0.8,dtype=float16), gen_kwargs: (None), limit: None, num_fewshot: 0, batch_size: auto
| Tasks |Version| Filter |n-shot| Metric |Value | |Stderr|
|----------------------------------------------------------|-------|----------|-----:|-----------|-----:|---|-----:|
|bbh |N/A |get-answer| 0|exact_match|0.6752|± |0.1772|
| - bbh_cot_fewshot_boolean_expressions |Yaml |get-answer| 0|exact_match|0.8840|± |0.0203|
| - bbh_cot_fewshot_causal_judgement |Yaml |get-answer| 0|exact_match|0.6417|± |0.0352|
| - bbh_cot_fewshot_date_understanding |Yaml |get-answer| 0|exact_match|0.7600|± |0.0271|
| - bbh_cot_fewshot_disambiguation_qa |Yaml |get-answer| 0|exact_match|0.7160|± |0.0286|
| - bbh_cot_fewshot_dyck_languages |Yaml |get-answer| 0|exact_match|0.1800|± |0.0243|
| - bbh_cot_fewshot_formal_fallacies |Yaml |get-answer| 0|exact_match|0.6520|± |0.0302|
| - bbh_cot_fewshot_geometric_shapes |Yaml |get-answer| 0|exact_match|0.3880|± |0.0309|
| - bbh_cot_fewshot_hyperbaton |Yaml |get-answer| 0|exact_match|0.9600|± |0.0124|
| - bbh_cot_fewshot_logical_deduction_five_objects |Yaml |get-answer| 0|exact_match|0.5360|± |0.0316|
| - bbh_cot_fewshot_logical_deduction_seven_objects |Yaml |get-answer| 0|exact_match|0.5040|± |0.0317|
| - bbh_cot_fewshot_logical_deduction_three_objects |Yaml |get-answer| 0|exact_match|0.8600|± |0.0220|
| - bbh_cot_fewshot_movie_recommendation |Yaml |get-answer| 0|exact_match|0.7840|± |0.0261|
| - bbh_cot_fewshot_multistep_arithmetic_two |Yaml |get-answer| 0|exact_match|0.6600|± |0.0300|
| - bbh_cot_fewshot_navigate |Yaml |get-answer| 0|exact_match|0.8160|± |0.0246|
| - bbh_cot_fewshot_object_counting |Yaml |get-answer| 0|exact_match|0.8360|± |0.0235|
| - bbh_cot_fewshot_penguins_in_a_table |Yaml |get-answer| 0|exact_match|0.7329|± |0.0367|
| - bbh_cot_fewshot_reasoning_about_colored_objects |Yaml |get-answer| 0|exact_match|0.8120|± |0.0248|
| - bbh_cot_fewshot_ruin_names |Yaml |get-answer| 0|exact_match|0.4440|± |0.0315|
| - bbh_cot_fewshot_salient_translation_error_detection |Yaml |get-answer| 0|exact_match|0.5200|± |0.0317|
| - bbh_cot_fewshot_snarks |Yaml |get-answer| 0|exact_match|0.7135|± |0.0340|
| - bbh_cot_fewshot_sports_understanding |Yaml |get-answer| 0|exact_match|0.9400|± |0.0151|
| - bbh_cot_fewshot_temporal_sequences |Yaml |get-answer| 0|exact_match|0.7560|± |0.0272|
| - bbh_cot_fewshot_tracking_shuffled_objects_five_objects |Yaml |get-answer| 0|exact_match|0.5680|± |0.0314|
| - bbh_cot_fewshot_tracking_shuffled_objects_seven_objects|Yaml |get-answer| 0|exact_match|0.6280|± |0.0306|
| - bbh_cot_fewshot_tracking_shuffled_objects_three_objects|Yaml |get-answer| 0|exact_match|0.6280|± |0.0306|
| - bbh_cot_fewshot_web_of_lies |Yaml |get-answer| 0|exact_match|0.9560|± |0.0130|
| - bbh_cot_fewshot_word_sorting |Yaml |get-answer| 0|exact_match|0.3800|± |0.0308|
|Groups|Version| Filter |n-shot| Metric |Value | |Stderr|
|------|-------|----------|-----:|-----------|-----:|---|-----:|
|bbh |N/A |get-answer| 0|exact_match|0.6752|± |0.1772|