-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
65 lines (57 loc) · 1.6 KB
/
config.py
File metadata and controls
65 lines (57 loc) · 1.6 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"""
Configuration settings for ModelSync
"""
import os
from pathlib import Path
from typing import Dict, Any
# Base directories
MODELSYNC_DIR = ".modelsync"
OBJECTS_DIR = ".modelsync/objects"
REFS_DIR = ".modelsync/refs"
HEADS_DIR = ".modelsync/refs/heads"
METADATA_DIR = ".modelsync/metadata"
LOGS_DIR = ".modelsync/logs"
# File paths
CONFIG_FILE = ".modelsync/config"
HEAD_FILE = ".modelsync/HEAD"
INDEX_FILE = ".modelsync/index"
HISTORY_FILE = ".modelsync/logs/history.log"
# Supported file types for AI projects
SUPPORTED_EXTENSIONS = {
'.py', '.ipynb', '.json', '.yaml', '.yml', '.txt', '.md',
'.pkl', '.joblib', '.h5', '.hdf5', '.pb', '.onnx', '.pt', '.pth',
'.csv', '.tsv', '.parquet', '.feather', '.npy', '.npz'
}
# Maximum file size (100MB)
MAX_FILE_SIZE = 100 * 1024 * 1024
# Default configuration
DEFAULT_CONFIG = {
"core": {
"repository_format_version": "1",
"file_mode": "false",
"bare": "false"
},
"user": {
"name": "",
"email": ""
},
"remote": {
"origin": {
"url": "",
"fetch": "+refs/heads/*:refs/remotes/origin/*"
}
}
}
def get_config() -> Dict[str, Any]:
"""Load configuration from file or return defaults"""
config_path = Path(CONFIG_FILE)
if config_path.exists():
# TODO: Implement config file parsing
pass
return DEFAULT_CONFIG.copy()
def save_config(config: Dict[str, Any]) -> None:
"""Save configuration to file"""
config_path = Path(CONFIG_FILE)
config_path.parent.mkdir(parents=True, exist_ok=True)
# TODO: Implement config file writing
pass