Vo Minh Vu commited on
Commit
9e6d8d7
Β·
1 Parent(s): 878047f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -1,3 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
1
  import spaces
2
 
3
  import os
@@ -25,10 +36,7 @@ from src.utils.infer_util import remove_background, resize_foreground, images_to
25
  import tempfile
26
  from functools import partial
27
 
28
- import huggingface_hub
29
-
30
- # alias the old name onto the new hf_hub_download
31
- huggingface_hub.cached_download = huggingface_hub.hf_hub_download
32
 
33
  import gradio as gr
34
 
 
1
+ # β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
2
+ # Monkey‐patch for diffusers<=0.19.3 which still does
3
+ # from huggingface_hub import cached_download
4
+ #
5
+ # New HF-Hub versions (>=0.14.0) removed cached_download, so we alias it.
6
+ # This must appear before any imports of diffusers / transformers.
7
+ # β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
8
+ import huggingface_hub
9
+ huggingface_hub.cached_download = huggingface_hub.hf_hub_download
10
+
11
+
12
  import spaces
13
 
14
  import os
 
36
  import tempfile
37
  from functools import partial
38
 
39
+ from huggingface_hub import hf_hub_download
 
 
 
40
 
41
  import gradio as gr
42