Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -43,16 +43,21 @@ geolocator = Nominatim(user_agent="skin-dashboard", timeout = 10)
|
|
43 |
|
44 |
@st.cache_resource
|
45 |
def load_image_model(token: str):
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
|
58 |
@st.cache_resource
|
|
|
43 |
|
44 |
@st.cache_resource
|
45 |
def load_image_model(token: str):
|
46 |
+
return pipeline(
|
47 |
+
"image-classification",
|
48 |
+
feature_extractor=AutoFeatureExtractor.from_pretrained(
|
49 |
+
MODEL_NAME,
|
50 |
+
subfolder="Skin_Cancer-Image_Classification",
|
51 |
+
use_auth_token=token
|
52 |
+
),
|
53 |
+
model=AutoModelForImageClassification.from_pretrained(
|
54 |
+
MODEL_NAME,
|
55 |
+
subfolder="Skin_Cancer-Image_Classification",
|
56 |
+
use_auth_token=token
|
57 |
+
),
|
58 |
+
device=0 # or -1 for CPU
|
59 |
+
)
|
60 |
+
|
61 |
|
62 |
|
63 |
@st.cache_resource
|