Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| phi-2-pruned50.Q2_K.gguf | Q2_K | 1.03GB |
| phi-2-pruned50.Q3_K_S.gguf | Q3_K_S | 1.16GB |
| phi-2-pruned50.Q3_K.gguf | Q3_K | 1.33GB |
| phi-2-pruned50.Q3_K_M.gguf | Q3_K_M | 1.33GB |
| phi-2-pruned50.Q3_K_L.gguf | Q3_K_L | 1.47GB |
| phi-2-pruned50.IQ4_XS.gguf | IQ4_XS | 1.43GB |
| phi-2-pruned50.Q4_0.gguf | Q4_0 | 1.49GB |
| phi-2-pruned50.IQ4_NL.gguf | IQ4_NL | 1.5GB |
| phi-2-pruned50.Q4_K_S.gguf | Q4_K_S | 1.51GB |
| phi-2-pruned50.Q4_K.gguf | Q4_K | 1.62GB |
| phi-2-pruned50.Q4_K_M.gguf | Q4_K_M | 1.62GB |
| phi-2-pruned50.Q4_1.gguf | Q4_1 | 1.65GB |
| phi-2-pruned50.Q5_0.gguf | Q5_0 | 1.8GB |
| phi-2-pruned50.Q5_K_S.gguf | Q5_K_S | 1.8GB |
| phi-2-pruned50.Q5_K.gguf | Q5_K | 1.87GB |
| phi-2-pruned50.Q5_K_M.gguf | Q5_K_M | 1.87GB |
| phi-2-pruned50.Q5_1.gguf | Q5_1 | 1.95GB |
| phi-2-pruned50.Q6_K.gguf | Q6_K | 2.13GB |
| phi-2-pruned50.Q8_0.gguf | Q8_0 | 2.75GB |
pip install nm-vllm[sparse]1from vllm import LLM, SamplingParams
2
3# Create a sparse LLM
4llm = LLM("nm-testing/phi-2-pruned50", sparsity="sparse_w16a16")
5
6prompt = "Once upon a time, there was a little car named Beep."
7# Create a sampling params object.
8sampling_params = SamplingParams(temperature=0.0, max_tokens=200)
9
10# Generate texts from the prompts. The output is a list of RequestOutput objects
11# that contain the prompt, generated text, and other information.
12outputs = llm.generate(prompt, sampling_params)
13# Print the outputs.
14for output in outputs:
15 prompt = output.prompt
16 generated_text = output.outputs[0].text
17 print(f"\nGenerated text: {prompt}{generated_text}\n")
18
19"""
20Generated text: Once upon a time, there was a little car named Beep. Beep was a small car, but he was very fast and loved to go on adventures. Beep had a friend named Bop who was a big car. Bop was very slow and loved to stay at home. Beep and Bop were very different, but they were still friends.
21
22One day, Beep and Bop decided to go on an adventure together. Beep was excited to explore new places and Bop was excited to see Beep explore. They started their adventure by driving on a bumpy road. Beep was having a great time, but Bop was having a hard time. Bop was so big that he couldn't fit in the small spaces between the bumps. Beep was having a great time, but Bop was having a hard time.
23
24As they continued their adventure, they came across a big hill. Beep was excited to climb the hill, but Bop was scared. Bop was so big that he couldn't
25""""Instruct: <prompt>\nOutput:"recipe.yaml in this repo and follow the instructions below.1git clone https://github.com/neuralmagic/sparseml
2pip install -e "sparseml[transformers]"1import sparseml.transformers
2
3original_model_name = microsoft/phi-2"
4calibration_dataset = "open_platypus"
5output_directory = "output/"
6
7recipe = """
8test_stage:
9 obcq_modifiers:
10 SparseGPTModifier:
11 sparsity: 0.5
12 sequential_update: true
13 targets: ['re:model.layers.\d*$']
14"""
15
16# Apply SparseGPT to the model
17sparseml.transformers.oneshot(
18 model=original_model_name,
19 dataset=calibration_dataset,
20 recipe=recipe,
21 output_dir=output_directory,
22)