nielsr HF staff commited on
Commit
65a5785
1 Parent(s): f45a6fa

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -4
README.md CHANGED
@@ -39,17 +39,17 @@ fine-tuned versions on a task that interests you.
39
  Here is how to use this model:
40
 
41
  ```python
42
- >>> from transformers import AutoFeatureExtractor, ResNetForImageClassification
43
  >>> import torch
44
  >>> from datasets import load_dataset
45
 
46
  >>> dataset = load_dataset("huggingface/cats-image")
47
  >>> image = dataset["test"]["image"][0]
48
 
49
- >>> feature_extractor = AutoFeatureExtractor.from_pretrained("microsoft/resnet-18")
50
- >>> model = ResNetForImageClassification.from_pretrained("microsoft/resnet-18")
51
 
52
- >>> inputs = feature_extractor(image, return_tensors="pt")
53
 
54
  >>> with torch.no_grad():
55
  ... logits = model(**inputs).logits
 
39
  Here is how to use this model:
40
 
41
  ```python
42
+ >>> from transformers import AutoImageProcessor, AutoModelForImageClassification
43
  >>> import torch
44
  >>> from datasets import load_dataset
45
 
46
  >>> dataset = load_dataset("huggingface/cats-image")
47
  >>> image = dataset["test"]["image"][0]
48
 
49
+ >>> image_processor = AutoImageProcessor.from_pretrained("microsoft/resnet-18")
50
+ >>> model = AutoModelForImageClassification.from_pretrained("microsoft/resnet-18")
51
 
52
+ >>> inputs = image_processor(image, return_tensors="pt")
53
 
54
  >>> with torch.no_grad():
55
  ... logits = model(**inputs).logits