Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
y0z committed Nov 14, 2024
1 parent d4997d9 commit dbd500f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions template/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ def objective(trial: optuna.Trial) -> float:

# TODO: Change the variables here to test your package.
package_name = "samplers/your_sampler"
repo_owner = "Your GitHub Account Name"
ref = "Your Git Branch Name"
test_local = True

if test_local:
# This is an example of how to load a sampler from your local optunahub-registry.
sampler = optunahub.load_local_module(
package=package_name, registry_root="./package/"
package=package_name,
registry_root="./", # Path to the root of the optunahub-registry.
).YourSampler()
else:
# This is an example of how to load a sampler from your fork of the optunahub-registry.
# Please remove repo_owner and ref arguments before submitting a pull request.
sampler = optunahub.load_module(
package=package_name, repo_owner=repo_owner, ref=ref
package=package_name, repo_owner="Your GitHub Account ID", ref="Your Git Branch Name"
).YourSampler()

study = optuna.create_study(sampler=sampler)
Expand Down

0 comments on commit dbd500f

Please sign in to comment.