These files were quantised using hardware kindly provided by Massed Compute.
About AWQ
AWQ is an efficient, accurate and blazing-fast low-bit weight quantization method, currently supporting 4-bit quantization. Compared to GPTQ, it offers faster Transformers-based inference with equivalent or better quality compared to the most commonly used GPTQ settings.
Please ensure you are using vLLM version 0.2 or later.
When using vLLM as a server, pass the --quantization awq parameter.
For example:
python3 -m vllm.entrypoints.api_server --model TheBloke/firefly-llama2-7B-chat-AWQ --quantization awq --dtype auto
When using vLLM from Python code, again set quantization=awq.
For example:
python
1from vllm import LLM, SamplingParams
23prompts =[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'''1112prompts =[prompt_template.format(prompt=prompt)for prompt in prompts]1314sampling_params = SamplingParams(temperature=0.8, top_p=0.95)1516llm = LLM(model="TheBloke/firefly-llama2-7B-chat-AWQ", quantization="awq", dtype="auto")1718outputs = llm.generate(prompts, sampling_params)1920# Print the outputs.21for output in outputs:22 prompt = output.prompt
23 generated_text = output.outputs[0].text
24print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
Multi-user inference server: Hugging Face Text Generation Inference (TGI)
Use TGI version 1.1.0 or later. The official Docker container is: ghcr.io/huggingface/text-generation-inference:1.1.0
Transformers example code (requires Transformers 4.35.0 and later)
python
1from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
23model_name_or_path ="TheBloke/firefly-llama2-7B-chat-AWQ"45tokenizer = 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)1112# Using the text streamer to stream output one token at a time13streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)1415prompt ="Tell me about AI"16prompt_template=f'''{prompt}17'''1819# Convert prompt to tokens20tokens = tokenizer(21 prompt_template,22 return_tensors='pt'23).input_ids.cuda()2425generation_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.132}3334# Generate streamed output, visible one token at a time35generation_output = model.generate(36 tokens,37 streamer=streamer,38**generation_params
39)4041# Generation without a streamer, which will include the prompt in the output42generation_output = model.generate(43 tokens,44**generation_params
45)4647# Get the tokens from the output, decode them, print them48token_output = generation_output[0]49text_output = tokenizer.decode(token_output)50print("model.generate output: ", text_output)5152# Inference is also possible via Transformers' pipeline53from transformers import pipeline
5455pipe = pipeline(56"text-generation",57 model=model,58 tokenizer=tokenizer,59**generation_params
60)6162pipe_output = pipe(prompt_template)[0]['generated_text']63print("pipeline output: ", pipe_output)64
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 special mentions: Brandon Frisco, LangChain4j, Spiking Neurons AB, transmissions 11, Joseph William Delisle, Nitin Borwankar, Willem Michiel, Michael Dempsey, vamX, Jeffrey Morgan, zynix, jjj, Omer Bin Jawed, Sean Connelly, jinyuan sun, Jeromy Smith, Shadi, Pawan Osman, Chadd, Elijah Stavena, Illia Dulskyi, Sebastain Graf, Stephen Murray, terasurfer, Edmond Seymore, Celu Ramasamy, Mandus, Alex, biorpg, Ajan Kanaga, Clay Pascal, Raven Klaugh, 阿明, K, ya boyyy, usrbinkat, Alicia Loh, John Villwock, ReadyPlayerEmma, Chris Smitley, Cap'n Zoog, fincy, GodLy, S_X, sidney chen, Cory Kujawski, OG, Mano Prime, AzureBlack, Pieter, Kalila, Spencer Kim, Tom X Nguyen, Stanislav Ovsiannikov, Michael Levine, Andrey, Trailburnt, Vadim, Enrico Ros, Talal Aujan, Brandon Phillips, Jack West, Eugene Pentland, Michael Davis, Will Dee, webtim, Jonathan Leane, Alps Aficionado, Rooh Singh, Tiffany J. Kim, theTransient, Luke @flexchar, Elle, Caitlyn Gatomon, Ari Malik, subjectnull, Johann-Peter Hartmann, Trenton Dambrowitz, Imad Khwaja, Asp the Wyvern, Emad Mostaque, Rainer Wilmers, Alexandros Triantafyllidis, Nicholas, Pedro Madruga, SuperWojo, Harry Royden McLaughlin, James Bentley, Olakabola, David Ziegler, Ai Maven, Jeff Scroggin, Nikolai Manek, Deo Leter, Matthew Berman, Fen Risland, Ken Nordquist, Manuel Alberto Morcote, Luke Pendergrass, TL, Fred von Graf, Randy H, Dan Guido, NimbleBox.ai, Vitor Caleffi, Gabriel Tamborski, knownsqashed, Lone Striker, Erik Bjäreholt, John Detwiler, Leonard Tan, Iucharbius
Thank you to all my generous patrons and donaters!
And thank you again to a16z for their generous grant.
Original model card: YeungNLP's Firefly Llama2 7B Chat
1Instruction:
2```
3夕阳西下时分,天空渐渐染上了一层橘红色。远处的山峦被映照得金光闪烁,仿佛是一幅绚烂多彩的水彩画。在山脚下的村庄里,炊烟袅袅升起,伴随着人们的欢声笑语和犬吠鸟鸣,构成一幅和谐而美好的画面。
45此时此刻,太阳已经落到了地平线以下,但它的余晖仍然洒满了大地。微风拂过树梢,带来阵阵清凉的风感;阳光透过云朵照射下来,形成一道道美丽的彩虹。在这片宁静祥和的氛围中,人们开始享受这美妙的时刻,欣赏着这片美丽的天空和大地的奇妙组合。
67当夜幕降临的时候,整个世界都变得安静了起来。月亮高高地挂在天空中,月光如水般温柔地倾泻而下,给大地带来了无限的光明与温暖。这时,你可以听到虫儿们发出的细碎的声音,感受到大自然的神奇魅力。在这个时候,你会感到自己与大自然融为一体,感受生命的真谛。
8```
910把上面的中文翻译成英文。
1112Output:
13As the sun sets in the west, the sky gradually turns a shade of orange. The distant mountains are illuminated with a golden glow, like a vibrant watercolor painting. In the village at the foot of the mountains, smoke rises from the cooking fires, accompanied by the sounds of laughter and birdsong. This creates a harmonious and beautiful scene.
1415At this moment, the sun has already set below the horizon, but its rays still illuminate the earth. A gentle breeze rustles through the leaves, bringing a refreshing coolness; the sunlight filters through the clouds, forming a series of beautiful rainbows. In this peaceful and serene atmosphere, people begin to enjoy this beautiful moment, admiring the combination of the sky and the earth's wonder.
1617As night falls, the world becomes quiet. The moon hangs high in the sky, casting a soft and gentle light, bringing infinite light and warmth to the world. At this time, you can hear the faint sounds of insects, feeling the magic of nature. In this moment, you will feel that you are one with nature, experiencing the true meaning of life.
181920Instruction:
21```
22寻寻觅觅,冷冷清清,凄凄惨惨戚戚。
23乍暖还寒时候,最难将息。
24三杯两盏淡酒,怎敌他、晚来风急!
25雁过也,正伤心,却是旧时相识。
26满地黄花堆积,憔悴损,如今有谁堪摘?
27守着窗儿,独自怎生得黑!
28梧桐更兼细雨,到黄昏、点点滴滴。
29这次第,怎一个愁字了得!
30```
3132把上面的诗词翻译成英文
3334Output:
35Wandering, cold, and lonely,
36It's hard to find a place to rest.
37Three cups of wine, two lamps,
38How can I resist the wind that's blowing?
3940The swallows are flying by,
41And it's a sad reminder of old friends.
42Yellow flowers are scattered everywhere,
43Withered and damaged, who can pick them up?
4445I'm standing by the window,
46Watching the rain fall, one drop at a time.
47This time, it's a heavy burden,
48Full of sorrow and regret.