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

streamlit_demo.py 644 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
28
  1. import git
  2. import streamlit as st
  3. import dvc.api
  4. import pandas as pd
  5. REPO = git.Repo(".")
  6. MODELS_COMMITS = list(REPO.iter_commits(paths="dvc.lock"))
  7. selected_commit = st.selectbox(
  8. "Choose your commit",
  9. [commit for commit in MODELS_COMMITS],
  10. format_func=lambda commit: f"{commit.hexsha[:6]} - {commit.message} - {commit.committed_datetime}",
  11. )
  12. st.write("Selected Commit", selected_commit)
  13. @st.cache
  14. def load_predictions(rev: str) -> pd.DataFrame:
  15. with dvc.api.open("data/prediction.csv", rev=rev) as f:
  16. return pd.read_csv(f)
  17. predictions = load_predictions(rev=selected_commit.hexsha)
  18. st.dataframe(predictions)
Tip!

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

Comments

Loading...