Spaces:
Sleeping
Sleeping
Download dist/models/task.model.js from sardarbipul/test: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/spaces/sardarbipul/test/resolve/main/dist/models/task.model.js
- Command line
-
hf download hf://spaces/sardarbipul/test/dist/models/task.model.js
-
curl -L -o task.model.js https://huggingface.co/spaces/sardarbipul/test/resolve/main/dist/models/task.model.js
1.2 kB
| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.TaskModel = void 0; | |
| class TaskModel { | |
| taskId; | |
| startRow; | |
| endRow; | |
| startOffset; | |
| endOffset; | |
| workerId; | |
| status; | |
| retries; | |
| progress; | |
| rowsProcessed; | |
| leaseUntil; | |
| createdAt; | |
| updatedAt; | |
| completedAt; | |
| errorMessage; | |
| constructor(data) { | |
| const now = new Date().toISOString(); | |
| this.taskId = data.taskId; | |
| this.startRow = data.startRow; | |
| this.endRow = data.endRow; | |
| this.startOffset = data.startOffset; | |
| this.endOffset = data.endOffset; | |
| this.workerId = data.workerId || null; | |
| this.status = data.status || 'pending'; | |
| this.retries = data.retries || 0; | |
| this.progress = data.progress || 0; | |
| this.rowsProcessed = data.rowsProcessed || 0; | |
| this.leaseUntil = data.leaseUntil || null; | |
| this.createdAt = data.createdAt || now; | |
| this.updatedAt = data.updatedAt || now; | |
| this.completedAt = data.completedAt || null; | |
| this.errorMessage = data.errorMessage || null; | |
| } | |
| static toJSON(task) { | |
| return { ...task }; | |
| } | |
| } | |
| exports.TaskModel = TaskModel; | |