Upload folder using huggingface_hub
Browse files- webserver/app.py +8 -2
webserver/app.py
CHANGED
|
@@ -316,13 +316,19 @@ def start_job(
|
|
| 316 |
spectral_path = os.path.join(job_upload_dir, "spectral.npy")
|
| 317 |
labels_path = os.path.join(job_upload_dir, "labels.npy")
|
| 318 |
wavenumbers_path = os.path.join(job_upload_dir, "wavenumbers.npy")
|
| 319 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 320 |
label_mapping_path = os.path.join(job_upload_dir, _safe_uploaded_name(label_mapping_file.filename)) if label_mapping_file is not None else None
|
| 321 |
|
| 322 |
_save_upload(spectral_file, spectral_path)
|
| 323 |
_save_upload(labels_file, labels_path)
|
| 324 |
_save_upload(wavenumbers_file, wavenumbers_path)
|
| 325 |
-
|
|
|
|
|
|
|
| 326 |
if label_mapping_file is not None:
|
| 327 |
_save_upload(label_mapping_file, label_mapping_path)
|
| 328 |
|
|
|
|
| 316 |
spectral_path = os.path.join(job_upload_dir, "spectral.npy")
|
| 317 |
labels_path = os.path.join(job_upload_dir, "labels.npy")
|
| 318 |
wavenumbers_path = os.path.join(job_upload_dir, "wavenumbers.npy")
|
| 319 |
+
if not _is_blank_upload(model_file):
|
| 320 |
+
model_path = os.path.join(job_upload_dir, "model.pth")
|
| 321 |
+
else:
|
| 322 |
+
model_path = None
|
| 323 |
+
|
| 324 |
label_mapping_path = os.path.join(job_upload_dir, _safe_uploaded_name(label_mapping_file.filename)) if label_mapping_file is not None else None
|
| 325 |
|
| 326 |
_save_upload(spectral_file, spectral_path)
|
| 327 |
_save_upload(labels_file, labels_path)
|
| 328 |
_save_upload(wavenumbers_file, wavenumbers_path)
|
| 329 |
+
|
| 330 |
+
if model_path is not None:
|
| 331 |
+
_save_upload(model_file, model_path)
|
| 332 |
if label_mapping_file is not None:
|
| 333 |
_save_upload(label_mapping_file, label_mapping_path)
|
| 334 |
|