@@ -98,7 +98,7 @@ print(processor.decode(output[0], skip_special_tokens=True))
|
|||||||
|
|
||||||
### Quantization using Bitsandbytes
|
### Quantization using Bitsandbytes
|
||||||
|
|
||||||
The model can be loaded in 8 or 4 bits, greatly reducing the memory requirements while maintaining the performance of the original model. First make sure to install bitsandbytes, `pip install bitsandbytes`` and make sure to have access to a CUDA compatible GPU device. Simply change the snippet above with:
|
The model can be loaded in 8 or 4 bits, greatly reducing the memory requirements while maintaining the performance of the original model. First make sure to install bitsandbytes, `pip install bitsandbytes` and make sure to have access to a CUDA compatible GPU device. Simply change the snippet above with:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from transformers import LlavaNextForConditionalGeneration, BitsAndBytesConfig
|
from transformers import LlavaNextForConditionalGeneration, BitsAndBytesConfig
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import torch
|
|||||||
from datasets import load_dataset
|
from datasets import load_dataset
|
||||||
from transformers import SegGptImageProcessor, SegGptForImageSegmentation
|
from transformers import SegGptImageProcessor, SegGptForImageSegmentation
|
||||||
|
|
||||||
model_id = "BAAI/seggpt-vit-large"
|
checkpoint = "BAAI/seggpt-vit-large"
|
||||||
image_processor = SegGptImageProcessor.from_pretrained(checkpoint)
|
image_processor = SegGptImageProcessor.from_pretrained(checkpoint)
|
||||||
model = SegGptForImageSegmentation.from_pretrained(checkpoint)
|
model = SegGptForImageSegmentation.from_pretrained(checkpoint)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user