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

environment_check.py 617 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
  1. import os
  2. from src.utils.file import read_dvc_params
  3. dvc_params = read_dvc_params(__file__)
  4. pipeline_params = dvc_params['environment-check']
  5. env_name = pipeline_params['environment-name']
  6. if env_name != os.environ.get('CONDA_DEFAULT_ENV'):
  7. raise RuntimeError(f'Environment not activated! (use `conda activate {env_name}`)')
  8. from src.scripts import verify_gpu
  9. from src.utils.output import write_file
  10. verify_dict = verify_gpu.run()
  11. write_file(pipeline_params['output'], verify_dict, 'json')
  12. if not verify_dict['has_gpu']:
  13. raise RuntimeError("No GPU Available! Please recheck environment configuration/setup.")
Tip!

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

Comments

Loading...