jinjieyuan
commited on
Commit
•
4df8481
1
Parent(s):
d586b76
Update model name
Browse files
README.md
CHANGED
@@ -12,7 +12,7 @@ The heuristic adapter discovered from the [super-adapter](https://huggingface.co
|
|
12 |
### Information
|
13 |
|
14 |
- **Model name:** shears-llama-7b-50-cs-heuristic-adapter
|
15 |
-
- **Base model:** [IntelLabs/
|
16 |
- **Sparsity:** 50%
|
17 |
- **Domain:** Commonsense
|
18 |
- **Subnetwork version:** Heuristic
|
@@ -61,14 +61,14 @@ def generate_prompt(instruction):
|
|
61 |
### Response:
|
62 |
"""
|
63 |
|
64 |
-
base_model = AutoModelForCausalLM.from_pretrained("IntelLabs/
|
65 |
model = PeftModel.from_pretrained(base_model, "IntelLabs/shears-llama-7b-50-cs-heuristic-adapter")
|
66 |
model.eval()
|
67 |
|
68 |
non_zero_params = sum([(param.data != 0).sum().item() for _, param in model.named_parameters()])
|
69 |
print(f"Number of all non-zero parameters: {non_zero_params}")
|
70 |
|
71 |
-
tokenizer = AutoTokenizer.from_pretrained("IntelLabs/
|
72 |
|
73 |
instruction = "Please choose the correct answer to the question: A cactus stem is used to store\n\nAnswer1: fruit "
|
74 |
"Answer2: liquid Answer3: food Answer4: spines\n\nAnswer format: answer1/answer2/answer3/answer4"
|
|
|
12 |
### Information
|
13 |
|
14 |
- **Model name:** shears-llama-7b-50-cs-heuristic-adapter
|
15 |
+
- **Base model:** [IntelLabs/shears-llama-7b-50-base](https://huggingface.co/IntelLabs/shears-llama-7b-50-base)
|
16 |
- **Sparsity:** 50%
|
17 |
- **Domain:** Commonsense
|
18 |
- **Subnetwork version:** Heuristic
|
|
|
61 |
### Response:
|
62 |
"""
|
63 |
|
64 |
+
base_model = AutoModelForCausalLM.from_pretrained("IntelLabs/shears-llama-7b-50-base")
|
65 |
model = PeftModel.from_pretrained(base_model, "IntelLabs/shears-llama-7b-50-cs-heuristic-adapter")
|
66 |
model.eval()
|
67 |
|
68 |
non_zero_params = sum([(param.data != 0).sum().item() for _, param in model.named_parameters()])
|
69 |
print(f"Number of all non-zero parameters: {non_zero_params}")
|
70 |
|
71 |
+
tokenizer = AutoTokenizer.from_pretrained("IntelLabs/shears-llama-7b-50-base")
|
72 |
|
73 |
instruction = "Please choose the correct answer to the question: A cactus stem is used to store\n\nAnswer1: fruit "
|
74 |
"Answer2: liquid Answer3: food Answer4: spines\n\nAnswer format: answer1/answer2/answer3/answer4"
|