Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
3f9b7ab9
Unverified
Commit
3f9b7ab9
authored
Jan 15, 2025
by
Kyle Sayers
Committed by
GitHub
Jan 15, 2025
Browse files
[Doc] Update examples to remove SparseAutoModelForCausalLM (#12062)
Signed-off-by:
Kyle Sayers
<
kylesayrs@gmail.com
>
parent
ad34c0df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
docs/source/features/quantization/fp8.md
docs/source/features/quantization/fp8.md
+5
-6
docs/source/features/quantization/int8.md
docs/source/features/quantization/int8.md
+3
-4
No files found.
docs/source/features/quantization/fp8.md
View file @
3f9b7ab9
...
...
@@ -54,16 +54,15 @@ The quantization process involves three main steps:
### 1. Loading the Model
Use
`SparseAutoModelForCausalLM`
, which wraps
`AutoModelForCausalLM`
, for saving and loading quantized model
s:
Load your model and tokenizer using the standard
`transformers`
AutoModel classe
s:
```
python
from
llmcompressor.transformers
import
SparseAutoModelForCausalLM
from
transformers
import
AutoTokenizer
from
transformers
import
AutoTokenizer
,
AutoModelForCausalLM
MODEL_ID
=
"meta-llama/Meta-Llama-3-8B-Instruct"
model
=
SparseAutoModelForCausalLM
.
from_pretrained
(
MODEL_ID
,
device_map
=
"auto"
,
torch_dtype
=
"auto"
)
model
=
AutoModelForCausalLM
.
from_pretrained
(
MODEL_ID
,
device_map
=
"auto"
,
torch_dtype
=
"auto"
,
)
tokenizer
=
AutoTokenizer
.
from_pretrained
(
MODEL_ID
)
```
...
...
docs/source/features/quantization/int8.md
View file @
3f9b7ab9
...
...
@@ -30,14 +30,13 @@ The quantization process involves four main steps:
### 1. Loading the Model
Use
`SparseAutoModelForCausalLM`
, which wraps
`AutoModelForCausalLM`
, for saving and loading quantized model
s:
Load your model and tokenizer using the standard
`transformers`
AutoModel classe
s:
```
python
from
llmcompressor.transformers
import
SparseAutoModelForCausalLM
from
transformers
import
AutoTokenizer
from
transformers
import
AutoTokenizer
,
AutoModelForCausalLM
MODEL_ID
=
"meta-llama/Meta-Llama-3-8B-Instruct"
model
=
Sparse
AutoModelForCausalLM
.
from_pretrained
(
model
=
AutoModelForCausalLM
.
from_pretrained
(
MODEL_ID
,
device_map
=
"auto"
,
torch_dtype
=
"auto"
,
)
tokenizer
=
AutoTokenizer
.
from_pretrained
(
MODEL_ID
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment