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_metadata.py 765 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
26
27
  1. from yaml import safe_load
  2. import os
  3. # Get The Credentials
  4. credentials = safe_load(open("config.yaml"))["credentials"]
  5. # DVC Credentials
  6. dvc_config = credentials["dvc_config"]
  7. DVC_REMOTE_URL = dvc_config["DAGSHUB_REMOTE_URL"]
  8. USERNAME = dvc_config["USERNAME"]
  9. PASSWORD = dvc_config["PASSWORD"]
  10. # Metadata values
  11. meta_data = credentials["metadata_path"]
  12. METRICS = meta_data["METRICS_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 Metadata to DVC
  20. os.system("dvc add {METRICS} {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...