Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -44,21 +44,12 @@ geolocator = Nominatim(user_agent="skin-dashboard", timeout = 10)
|
|
44 |
# --- Load Model & Feature Extractor ---
|
45 |
@st.cache_resource
|
46 |
def load_image_model(token: str):
|
47 |
-
processor = AutoImageProcessor.from_pretrained(
|
48 |
-
MODEL_NAME,
|
49 |
-
use_auth_token=token,
|
50 |
-
trust_remote_code=True
|
51 |
-
)
|
52 |
-
model = AutoModelForImageClassification.from_pretrained(
|
53 |
-
MODEL_NAME,
|
54 |
-
use_auth_token=token,
|
55 |
-
trust_remote_code=True
|
56 |
-
)
|
57 |
return pipeline(
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
62 |
)
|
63 |
|
64 |
@st.cache_resource
|
|
|
44 |
# --- Load Model & Feature Extractor ---
|
45 |
@st.cache_resource
|
46 |
def load_image_model(token: str):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
return pipeline(
|
48 |
+
"image-classification",
|
49 |
+
MODEL_NAME,
|
50 |
+
use_auth_token=token,
|
51 |
+
trust_remote_code=True, # ← allow custom code in the model repo
|
52 |
+
device=0 # or -1 for CPU
|
53 |
)
|
54 |
|
55 |
@st.cache_resource
|