Skip to content

Commit d4851fe

Browse files
Refactor Optuna storage implementation
Fix obsolete code on journal storage.
1 parent f1edbe6 commit d4851fe

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

generative-proof-of-concept-CPU-preprocessing-in-memory.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import optuna
2-
from optuna.storages import JournalStorage, JournalFileBackend
3-
from optuna.storages.journal import JournalFileOpenLock
42
import os
53
import mlflow
64
from datetime import datetime
@@ -31,10 +29,8 @@
3129
# Use JournalFileStorage to ensure concurrency safety
3230

3331
storage_file = f"./optuna_{EXPERIMENT_NAME}.log"
34-
lock_obj = JournalFileOpenLock(storage_file)
35-
36-
# Create the JournalStorage instance
37-
optuna_storage = JournalStorage(JournalFileBackend(storage_file, lock_obj=lock_obj))
32+
journal_backend = optuna.storages.journal.JournalFileBackend(storage_file)
33+
optuna_storage = optuna.storages.JournalStorage(journal_backend)
3834

3935

4036
def objective(trial: optuna.Trial) -> float:

0 commit comments

Comments
 (0)