cxumol commited on
Commit
e2121e2
1 Parent(s): 69242c6

tune for hugging face space

Browse files
CoverPilot_demo_h264_30fps_noaudio.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:05653a793cad59fef109e88de6372d47bc85ac8cdf933f4e78733eaaed163afe
3
+ size 6390824
app/_hf.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ from huggingface_hub import HfApi
4
+
5
+ HF_TOKEN = os.environ.get("HF_TOKEN", None)
6
+ REPO_ID = os.environ.get("REPO_ID", None)
7
+
8
+ HF = None
9
+ if HF_TOKEN:
10
+ HF = HfApi(token=HF_TOKEN)
app/app.py CHANGED
@@ -24,13 +24,21 @@ import json
24
  ## debug
25
  from icecream import ic
26
 
 
 
 
27
  logger = mylogger(__name__, "%(asctime)s:%(levelname)s:%(message)s")
28
  info = logger.info
29
 
30
 
31
  def init():
32
- os.system("shot-scraper install -b firefox")
33
- download_pandoc()
 
 
 
 
 
34
 
35
 
36
  ## Config Functions
 
24
  ## debug
25
  from icecream import ic
26
 
27
+ ## platform specific
28
+ from _hf import HF, REPO_ID
29
+
30
  logger = mylogger(__name__, "%(asctime)s:%(levelname)s:%(message)s")
31
  info = logger.info
32
 
33
 
34
  def init():
35
+ try:
36
+ os.system("shot-scraper install -b firefox")
37
+ download_pandoc()
38
+ except Exception as e:
39
+ ic(e)
40
+ if HF:
41
+ HF.restart_space(REPO_ID)
42
 
43
 
44
  ## Config Functions
requirements.txt CHANGED
@@ -10,5 +10,7 @@ tiktoken
10
  # lib
11
  requests
12
  icecream
 
 
13
  # dev tools
14
  ruff
 
10
  # lib
11
  requests
12
  icecream
13
+ # platform specific
14
+ huggingface_hub
15
  # dev tools
16
  ruff