broadfield-dev commited on
Commit
58fa1a2
·
verified ·
1 Parent(s): cfc3154

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +2 -3
server.py CHANGED
@@ -17,7 +17,7 @@ except ImportError:
17
  HF_DATASETS_AVAILABLE = False
18
  Features, Value = None, None
19
 
20
- STORAGE_BACKEND_CONFIG = os.getenv("STORAGE_BACKEND", "HF_DATASET").upper()
21
  HF_DATASET_REPO = os.getenv("HF_DATASET_REPO")
22
  HF_TOKEN = os.getenv("HF_TOKEN")
23
  DB_FILE_JSON = "social_data.json"
@@ -75,9 +75,8 @@ def load_data():
75
  global STORAGE_BACKEND_CONFIG
76
  storage_backend = STORAGE_BACKEND_CONFIG
77
 
78
- # Define explicit dtypes for empty dataframes to ensure schema consistency
79
  posts_schema = {"post_id": "int64", "username": "object", "content": "object", "timestamp": "object"}
80
- comments_schema = {"comment_id": "int64", "post_id": "int64", "username": "object", "content": "object", "timestamp": "object", "reply_to_comment_id": "float64"} # Use float for optional int
81
 
82
  with db_lock:
83
  users = {"admin": "password"}
 
17
  HF_DATASETS_AVAILABLE = False
18
  Features, Value = None, None
19
 
20
+ STORAGE_BACKEND_CONFIG = os.getenv("STORAGE_BACKEND", "JSON").upper()
21
  HF_DATASET_REPO = os.getenv("HF_DATASET_REPO")
22
  HF_TOKEN = os.getenv("HF_TOKEN")
23
  DB_FILE_JSON = "social_data.json"
 
75
  global STORAGE_BACKEND_CONFIG
76
  storage_backend = STORAGE_BACKEND_CONFIG
77
 
 
78
  posts_schema = {"post_id": "int64", "username": "object", "content": "object", "timestamp": "object"}
79
+ comments_schema = {"comment_id": "int64", "post_id": "int64", "username": "object", "content": "object", "timestamp": "object", "reply_to_comment_id": "float64"}
80
 
81
  with db_lock:
82
  users = {"admin": "password"}