Update old existing feature extractor references (#24552)
* Update old existing feature extractor references * Typo * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Address comments from review - update 'feature extractor' Co-authored by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -25,7 +25,7 @@ if is_torch_available():
|
||||
from transformers import AutoModelForImageClassification
|
||||
|
||||
if is_vision_available():
|
||||
from transformers import AutoFeatureExtractor
|
||||
from transformers import AutoImageProcessor
|
||||
|
||||
|
||||
@require_torch
|
||||
@@ -33,7 +33,7 @@ if is_vision_available():
|
||||
class DiTIntegrationTest(unittest.TestCase):
|
||||
@slow
|
||||
def test_for_image_classification(self):
|
||||
feature_extractor = AutoFeatureExtractor.from_pretrained("microsoft/dit-base-finetuned-rvlcdip")
|
||||
image_processor = AutoImageProcessor.from_pretrained("microsoft/dit-base-finetuned-rvlcdip")
|
||||
model = AutoModelForImageClassification.from_pretrained("microsoft/dit-base-finetuned-rvlcdip")
|
||||
model.to(torch_device)
|
||||
|
||||
@@ -43,7 +43,7 @@ class DiTIntegrationTest(unittest.TestCase):
|
||||
|
||||
image = dataset["train"][0]["image"].convert("RGB")
|
||||
|
||||
inputs = feature_extractor(image, return_tensors="pt").to(torch_device)
|
||||
inputs = image_processor(image, return_tensors="pt").to(torch_device)
|
||||
|
||||
# forward pass
|
||||
with torch.no_grad():
|
||||
|
||||
Reference in New Issue
Block a user