cpiuk commited on
Commit
202aaad
·
verified ·
1 Parent(s): ceb0f4e

Upload runpod/control_server.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. runpod/control_server.py +10 -0
runpod/control_server.py CHANGED
@@ -143,6 +143,16 @@ def create_app(control_state, api_key: str):
143
  )
144
 
145
  uploaded = control_state.get_uploaded_files()
 
 
 
 
 
 
 
 
 
 
146
  if body.train_file not in uploaded:
147
  raise HTTPException(
148
  status_code=400,
 
143
  )
144
 
145
  uploaded = control_state.get_uploaded_files()
146
+
147
+ # Auto-register data files that exist on disk (e.g., pre-downloaded at boot)
148
+ data_dir = Path(control_state.data_dir)
149
+ for fname in [body.train_file, body.val_file]:
150
+ if fname and fname not in uploaded and (data_dir / fname).exists():
151
+ local_path = str(data_dir / fname)
152
+ control_state.register_upload(fname, local_path)
153
+ uploaded[fname] = local_path
154
+ logger.info(f"Auto-registered pre-existing data file: {fname} → {local_path}")
155
+
156
  if body.train_file not in uploaded:
157
  raise HTTPException(
158
  status_code=400,