Update app.py
Browse files
app.py
CHANGED
@@ -14,10 +14,8 @@ async def root():
|
|
14 |
|
15 |
# Load model and processor
|
16 |
model_name = "ivandrian11/fruit-classifier"
|
17 |
-
|
18 |
-
|
19 |
-
processor = AutoImageProcessor.from_pretrained("fruit-model")
|
20 |
-
model = AutoModelForImageClassification.from_pretrained("fruit-model")
|
21 |
model.eval() # set to evaluation mode
|
22 |
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
23 |
model.to(DEVICE)
|
|
|
14 |
|
15 |
# Load model and processor
|
16 |
model_name = "ivandrian11/fruit-classifier"
|
17 |
+
processor = AutoImageProcessor.from_pretrained(model_name)
|
18 |
+
model = AutoModelForImageClassification.from_pretrained(model_name)
|
|
|
|
|
19 |
model.eval() # set to evaluation mode
|
20 |
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
21 |
model.to(DEVICE)
|