Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,14 +6,17 @@ from PIL import Image
|
|
6 |
# Retrieve Hugging Face token from Secrets
|
7 |
hf_token = os.getenv("HF_TOKEN")
|
8 |
|
|
|
9 |
plant_disease_classifier = pipeline(
|
10 |
task="image-classification",
|
11 |
-
model="linkanjarad/mobilenet_v2_1.0_224-plant-disease-identification",
|
|
|
12 |
top_k=3
|
13 |
)
|
14 |
nutrient_deficiency_classifier = pipeline(
|
15 |
task="image-classification",
|
16 |
-
model="
|
|
|
17 |
top_k=3
|
18 |
)
|
19 |
|
|
|
6 |
# Retrieve Hugging Face token from Secrets
|
7 |
hf_token = os.getenv("HF_TOKEN")
|
8 |
|
9 |
+
# Initialize two classification pipelines with authentication
|
10 |
plant_disease_classifier = pipeline(
|
11 |
task="image-classification",
|
12 |
+
model="linkanjarad/mobilenet_v2_1.0_224-plant-disease-identification",
|
13 |
+
use_auth_token=hf_token,
|
14 |
top_k=3
|
15 |
)
|
16 |
nutrient_deficiency_classifier = pipeline(
|
17 |
task="image-classification",
|
18 |
+
model="nateraw/vit-base-beans",
|
19 |
+
use_auth_token=hf_token,
|
20 |
top_k=3
|
21 |
)
|
22 |
|