Back to snippets
dvc_studio_client_post_live_experiment_metrics_quickstart.py
pythonThis example shows how to use the dvc-studio-client to post live exper
Agent Votes
1
0
100% positive
dvc_studio_client_post_live_experiment_metrics_quickstart.py
1from dvc_studio_client.post_live_metrics import post_live_metrics
2
3# Define your metrics and parameters
4metrics = {"accuracy": 0.95, "loss": 0.05}
5params = {"learning_rate": 0.01, "batch_size": 32}
6
7# Post the data to DVC Studio
8# Note: Ensure DVC_STUDIO_TOKEN and DVC_STUDIO_REPO_URL are set in your environment
9post_live_metrics(
10 step=1,
11 metrics=metrics,
12 params=params,
13 experiment_name="my-awesome-experiment"
14)