Upload folder using huggingface_hub (#9)
Browse files- 09e21ad3eca3f2138211434522b9070e876f95ac33f92239d2a64f52ce0114a4 (ff562c0031ea197e5eab059113791d9af008a20d)
- README.md +3 -3
- smash_config.json +1 -1
README.md
CHANGED
@@ -59,13 +59,13 @@ You can run the smashed model with these steps:
|
|
59 |
2. Load & run the model.
|
60 |
```python
|
61 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
62 |
-
|
63 |
-
|
64 |
|
65 |
try:
|
66 |
model = HQQModelForCausalLM.from_quantized("PrunaAI/facebook-opt-125m-HQQ-1bit-smashed", device_map='auto')
|
67 |
except:
|
68 |
-
|
69 |
tokenizer = AutoTokenizer.from_pretrained("facebook/opt-125m")
|
70 |
|
71 |
input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
|
|
|
59 |
2. Load & run the model.
|
60 |
```python
|
61 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
62 |
+
from hqq.engine.hf import HQQModelForCausalLM
|
63 |
+
from hqq.models.hf.base import AutoHQQHFModel
|
64 |
|
65 |
try:
|
66 |
model = HQQModelForCausalLM.from_quantized("PrunaAI/facebook-opt-125m-HQQ-1bit-smashed", device_map='auto')
|
67 |
except:
|
68 |
+
model = AutoHQQHFModel.from_quantized("PrunaAI/facebook-opt-125m-HQQ-1bit-smashed")
|
69 |
tokenizer = AutoTokenizer.from_pretrained("facebook/opt-125m")
|
70 |
|
71 |
input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
|
smash_config.json
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
"controlnet": "None",
|
15 |
"unet_dim": 4,
|
16 |
"device": "cuda",
|
17 |
-
"cache_dir": "/ceph/hdd/staff/charpent/.cache/
|
18 |
"batch_size": 1,
|
19 |
"tokenizer": "GPT2TokenizerFast(name_or_path='facebook/opt-125m', vocab_size=50265, model_max_length=1000000000000000019884624838656, is_fast=True, padding_side='right', truncation_side='right', special_tokens={'bos_token': '</s>', 'eos_token': '</s>', 'unk_token': '</s>', 'pad_token': '<pad>'}, clean_up_tokenization_spaces=True), added_tokens_decoder={\n\t1: AddedToken(\"<pad>\", rstrip=False, lstrip=False, single_word=False, normalized=True, special=True),\n\t2: AddedToken(\"</s>\", rstrip=False, lstrip=False, single_word=False, normalized=True, special=True),\n}",
|
20 |
"task": "text_text_generation",
|
|
|
14 |
"controlnet": "None",
|
15 |
"unet_dim": 4,
|
16 |
"device": "cuda",
|
17 |
+
"cache_dir": "/ceph/hdd/staff/charpent/.cache/modelst_zaujwg",
|
18 |
"batch_size": 1,
|
19 |
"tokenizer": "GPT2TokenizerFast(name_or_path='facebook/opt-125m', vocab_size=50265, model_max_length=1000000000000000019884624838656, is_fast=True, padding_side='right', truncation_side='right', special_tokens={'bos_token': '</s>', 'eos_token': '</s>', 'unk_token': '</s>', 'pad_token': '<pad>'}, clean_up_tokenization_spaces=True), added_tokens_decoder={\n\t1: AddedToken(\"<pad>\", rstrip=False, lstrip=False, single_word=False, normalized=True, special=True),\n\t2: AddedToken(\"</s>\", rstrip=False, lstrip=False, single_word=False, normalized=True, special=True),\n}",
|
20 |
"task": "text_text_generation",
|