sschellhammer commited on
Commit
84e37ae
·
1 Parent(s): 8467882
Files changed (2) hide show
  1. save_files.py +22 -0
  2. start.sh +2 -0
save_files.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from huggingface_hub import CommitScheduler
3
+
4
+ hf_token = os.environ["HF_TOKEN"]
5
+
6
+ # Dataset repo to push to
7
+ REPO_ID = "sschellhammer/potato_annotation_data"
8
+
9
+ # Folder to monitor
10
+ LOCAL_FOLDER = "/app/output"
11
+
12
+ # Commit interval (seconds)
13
+ INTERVAL = 2 # every 2 minutes
14
+
15
+ # Create CommitScheduler
16
+ scheduler = CommitScheduler(
17
+ repo_id=REPO_ID,
18
+ token=HF_TOKEN,
19
+ folder_path=LOCAL_FOLDER,
20
+ repo_type="dataset",
21
+ every=INTERVAL
22
+ )
start.sh CHANGED
@@ -10,5 +10,7 @@ python setup_files.py
10
  echo "Listing files:"
11
  ls -l
12
 
 
 
13
  echo "Starting Potato server..."
14
  exec potato start config.yaml -p 7860
 
10
  echo "Listing files:"
11
  ls -l
12
 
13
+ python save_files.py &
14
+
15
  echo "Starting Potato server..."
16
  exec potato start config.yaml -p 7860