wi-lab commited on
Commit
52d1ca1
·
1 Parent(s): 9407e44

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -1,4 +1,19 @@
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  import gradio as gr
3
  import torch
4
  import numpy as np
 
1
 
2
+ import huggingface_hub as hf_hub
3
+
4
+ # Gradio <-> hub compatibility shim: newer huggingface_hub removed HfFolder.
5
+ if not hasattr(hf_hub, "HfFolder"):
6
+ class _HfFolderShim:
7
+ @staticmethod
8
+ def get_token():
9
+ return None
10
+
11
+ @staticmethod
12
+ def save_token(token):
13
+ return None
14
+
15
+ hf_hub.HfFolder = _HfFolderShim # type: ignore[attr-defined]
16
+
17
  import gradio as gr
18
  import torch
19
  import numpy as np