Skip to content

Commit

Permalink
woof
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Sayers <[email protected]>
  • Loading branch information
kylesayrs committed Feb 3, 2025
1 parent a3a9f17 commit 447b5ad
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions examples/multimodal_vision/phi3_vision_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from transformers import AutoModelForCausalLM, AutoProcessor

from llmcompressor.modifiers.quantization import GPTQModifier
from llmcompressor.modifiers.smoothquant import SmoothQuantModifier
from llmcompressor.transformers import oneshot

# Load model.
Expand All @@ -16,7 +15,6 @@
_attn_implementation="eager",
)
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
processor.chat_template = processor.tokenizer.chat_template

# Oneshot arguments
DATASET_ID = "lmms-lab/flickr30k"
Expand Down Expand Up @@ -68,7 +66,6 @@ def data_collator(batch):

# Recipe
recipe = [
SmoothQuantModifier(smoothing_strength=0.8),
GPTQModifier(
targets="Linear",
scheme="W4A16",
Expand Down
1 change: 0 additions & 1 deletion src/llmcompressor/pipelines/sequential/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def trace_subgraphs(
concrete_args = populate_concrete_args(model, sample_input)

# trace
breakpoint()
with (
calibration_forward_context(model),
HooksMixin.disable_hooks(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def format_calibration_data(
else SequentialSampler(tokenized_calibration),
"collate_fn": collate_fn,
"pin_memory": True,
"drop_last": False,
}

calib_dataloader = DataLoader(tokenized_calibration, **dataloader_params)
Expand Down
1 change: 1 addition & 0 deletions src/llmcompressor/transformers/finetune/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def populate_datasets(self, processor: Processor, add_labels: bool = True):
:param processor: processor or tokenizer to use for dataset tokenization
:param add_labels: if True, add labels column to dataset splits
"""
self.processor = processor # TODO: pass processor into init instead of this fn
if self._data_args.dataset is None:
logger.info(
"Running oneshot without calibration data. This is expected for "
Expand Down

0 comments on commit 447b5ad

Please sign in to comment.