Function
enable_training
(session: SessionDep, id: int, enabled: bool, trans: Trans)
Source from the content-addressed store, hash-verified
| 405 | |
| 406 | |
| 407 | def enable_training(session: SessionDep, id: int, enabled: bool, trans: Trans): |
| 408 | count = session.query(DataTraining).filter( |
| 409 | DataTraining.id == id |
| 410 | ).count() |
| 411 | if count == 0: |
| 412 | raise Exception(trans('i18n_data_training.data_training_not_exists')) |
| 413 | |
| 414 | stmt = update(DataTraining).where(and_(DataTraining.id == id)).values( |
| 415 | enabled=enabled, |
| 416 | ) |
| 417 | session.execute(stmt) |
| 418 | session.commit() |
| 419 | |
| 420 | |
| 421 | # def run_save_embeddings(ids: List[int]): |
Tested by
no test coverage detected