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

prepare_ec2.py 797 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
21
22
23
24
25
  1. from yaml import safe_load
  2. from os.path import join
  3. import os
  4. ##### Source Code Access
  5. ec2_prepare_params = safe_load(open("streamlit_params.yaml"))["ec2_prepare"]
  6. DAGSHUB_REMOTE_URL = ec2_prepare_params["DAGSHUB_REMOTE_URL"]
  7. DEPENDENCIES = ec2_prepare_params["REQUIREMENTS"]
  8. # 1. Clone the source code
  9. # install git library
  10. os.system("sudo yum install git")
  11. os.system("git clone {}".format(DAGSHUB_REMOTE_URL))
  12. #### Model and Data Parameters
  13. model_data_params = safe_load(open("streamlit_params.yaml"))["model_data_config"]
  14. MODEL_PATH = model_data_params["MODEL_PATH"]
  15. DATA_PATH = model_data_params["METRICS_PATH"]
  16. # 2. Pull data and model
  17. os.system("dvc pull {} {}".format(MODEL_PATH, DATA_PATH))
  18. # 3. Install the requirements
  19. os.system("sudo pip3 install -r {}".format(DEPENDENCIES))
Tip!

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

Comments

Loading...