added automodelimage
Browse files
app.py
CHANGED
@@ -253,22 +253,23 @@ def predict_and_analyze(model_name, num_channels, dim, input_channel, image):
|
|
253 |
# model = EfficientNetPreTrained.from_pretrained(model_loading_name)
|
254 |
# model = AutoModel.from_pretrained(model_loading_name, trust_remote_code=True)
|
255 |
|
256 |
-
model =
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
|
|
272 |
|
273 |
# model = EfficientNetPreTrained(config)
|
274 |
# config.register_for_auto_class()
|
|
|
253 |
# model = EfficientNetPreTrained.from_pretrained(model_loading_name)
|
254 |
# model = AutoModel.from_pretrained(model_loading_name, trust_remote_code=True)
|
255 |
|
256 |
+
model = AutoModelForImageClassification.from_pretrained(model_loading_name)
|
257 |
+
|
258 |
+
# model = EfficientNet(dropout=hparams.dropout,
|
259 |
+
# num_channels=hparams.num_channels,
|
260 |
+
# num_classes=hparams.num_classes,
|
261 |
+
# size=hparams.size,
|
262 |
+
# stochastic_depth_prob=hparams.stochastic_depth_prob,
|
263 |
+
# width_mult=hparams.width_mult,
|
264 |
+
# depth_mult=hparams.depth_mult,)
|
265 |
+
# model_url = cached_download(hf_hub_url(model_loading_name, filename="pytorch_model.bin"))
|
266 |
+
# print(model_url)
|
267 |
+
|
268 |
+
# loaded = torch.load(model_url, map_location='cpu')
|
269 |
+
# print(loaded)
|
270 |
+
|
271 |
+
# model.load_state_dict(loaded)
|
272 |
+
# print(model)
|
273 |
|
274 |
# model = EfficientNetPreTrained(config)
|
275 |
# config.register_for_auto_class()
|