using cached_download
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from matplotlib import cm
|
3 |
import matplotlib.pyplot as plt
|
4 |
from mpl_toolkits.axes_grid1 import make_axes_locatable
|
@@ -226,7 +227,9 @@ def predict_and_analyze(model_name, num_channels, dim, input_channel, image):
|
|
226 |
# config = EfficientNetConfig.from_pretrained(model_loading_name)
|
227 |
|
228 |
# model = EfficientNetPreTrained.from_pretrained(model_loading_name)
|
229 |
-
model = AutoModel.from_pretrained(model_loading_name, trust_remote_code=True)
|
|
|
|
|
230 |
|
231 |
# model = EfficientNetPreTrained(config)
|
232 |
# config.register_for_auto_class()
|
|
|
1 |
import gradio as gr
|
2 |
+
from huggingface_hub import hf_hub_url, cached_download
|
3 |
from matplotlib import cm
|
4 |
import matplotlib.pyplot as plt
|
5 |
from mpl_toolkits.axes_grid1 import make_axes_locatable
|
|
|
227 |
# config = EfficientNetConfig.from_pretrained(model_loading_name)
|
228 |
|
229 |
# model = EfficientNetPreTrained.from_pretrained(model_loading_name)
|
230 |
+
# model = AutoModel.from_pretrained(model_loading_name, trust_remote_code=True)
|
231 |
+
|
232 |
+
model = cached_download(hf_hub_url(model_loading_name, filename="pytorch_model.bin"))
|
233 |
|
234 |
# model = EfficientNetPreTrained(config)
|
235 |
# config.register_for_auto_class()
|