MoritzMMuller commited on
Commit
bb0877f
·
verified ·
1 Parent(s): 3e88e56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -14
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
- "image-classification",
59
- model=model,
60
- image_processor=processor,
61
- device=0
 
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