File size: 878 Bytes
08d6be3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from huggingface_hub import HfApi
import os

api = HfApi()
repo_id = "d-e-e-k-11/credit-card-fraud-detection"
local_folder = "c:/card"

print(f"Uploading files from {local_folder} to {repo_id}...")

# Files to ignore
ignore_patterns = [
    ".git*",
    "eda.py",
    "train_model.py",
    "task.md",
    "implementation_plan.md",
    "create_hf_space.py",
    "upload_to_hf.py",
    "class_distribution.png",
    "distributions.png",
    "scaler.joblib", # Old scaler file
    "__pycache__",
    ".gemini*"
]

try:
    api.upload_folder(
        repo_id=repo_id,
        folder_path=local_folder,
        repo_type="space",
        ignore_patterns=ignore_patterns
    )
    print("Upload complete!")
    print(f"Your space is live at: https://huggingface.co/spaces/{repo_id}")
except Exception as e:
    print(f"Error uploading files: {e}")