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

save_to_dvc.py 787 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. # Get DVC Credentials
  5. dvc_config = safe_load(open("params.yaml"))["dvc_config"]
  6. DVC_REMOTE_URL = dvc_config["DAGSHUB_REMOTE_URL"]
  7. USERNAME = dvc_config["USERNAME"]
  8. PASSWORD = dvc_config["PASSWORD"]
  9. # Data Path
  10. meta_data = safe_load(open("params.yaml"))["model_data_config"]
  11. DATA = meta_data["DATA_PATH"]
  12. VECTOR = meta_data["VECTOR_PATH"]
  13. MODEL = meta_data["MODEL_PATH"]
  14. # Configure DVC
  15. os.system("dvc remote add origin {DVC_REMOTE_URL}")
  16. os.system("dvc remote modify origin --local auth basic")
  17. os.system("dvc remote modify origin --local user {USERNAME}}")
  18. os.system("dvc remote modify origin --local password {PASSWORD}")
  19. # Add Model Metadata to DVC
  20. os.system("dvc add {DATA} {VECTOR} {MODEL}")
  21. os.system("dvc push")
Tip!

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

Comments

Loading...