harikrishna1985 commited on
Commit
95da115
·
verified ·
1 Parent(s): 6f2459c

Upload push_to_hf_space.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. push_to_hf_space.py +32 -0
push_to_hf_space.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import HfApi
2
+ import os
3
+
4
+ HF_TOKEN = os.getenv("HF_TOKEN")
5
+ SPACE_REPO_ID = "harikrishna1985/predictive-maintenance-space"
6
+
7
+ FILES_TO_UPLOAD = [
8
+ "app.py",
9
+ "requirements.txt",
10
+ "Dockerfile",
11
+ "README.md",
12
+ "push_to_hf_space.py",
13
+ "config/config.yaml",
14
+ "src/predict.py",
15
+ "src/preprocess.py",
16
+ "src/utils.py",
17
+ "src/01_data_prep.py",
18
+ "src/02_train.py",
19
+ "src/03_evaluate.py",
20
+ ]
21
+
22
+ api = HfApi(token=HF_TOKEN)
23
+
24
+ for file_path in FILES_TO_UPLOAD:
25
+ api.upload_file(
26
+ path_or_fileobj=file_path,
27
+ path_in_repo=file_path,
28
+ repo_id=SPACE_REPO_ID,
29
+ repo_type="space",
30
+ )
31
+
32
+ print("All deployment files uploaded to Hugging Face Space.")