Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

conftest.py 542 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  1. import pytest
  2. from ray.train.torch.torch_predictor import TorchPredictor
  3. from madewithml import predict
  4. def pytest_addoption(parser):
  5. parser.addoption("--run-id", action="store", default=None, help="Run ID of model to use.")
  6. @pytest.fixture(scope="module")
  7. def run_id(request):
  8. return request.config.getoption("--run-id")
  9. @pytest.fixture(scope="module")
  10. def predictor(run_id):
  11. best_checkpoint = predict.get_best_checkpoint(run_id=run_id)
  12. predictor = TorchPredictor.from_checkpoint(best_checkpoint)
  13. return predictor
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...