Spaces:
Running
Running
CalebCometML
commited on
Commit
•
9f98180
1
Parent(s):
77ed58c
Update streamlitapp.py
Browse files- streamlitapp.py +0 -15
streamlitapp.py
CHANGED
@@ -14,19 +14,4 @@ src = f"https://{servername}/kangas/?datagrid=.%2Fdatagrids%2Fcoco-500.datagrid"
|
|
14 |
|
15 |
st.set_page_config(layout="wide")
|
16 |
|
17 |
-
st.markdown("1. Select dataset of your choice")
|
18 |
-
|
19 |
-
def kangas_fn(dataset_repo):
|
20 |
-
repo_wo_slash = dataset_repo.replace('/', '__') + '.datagrid'
|
21 |
-
dg_file_name = repo_wo_slash + '.datagrid'
|
22 |
-
with st.spinner("Loading Dataset..."):
|
23 |
-
dataset = load_dataset(dataset_repo, split="train")
|
24 |
-
with st.spinner("Creating Kangas..."):
|
25 |
-
dg = kg.DataGrid(dataset)
|
26 |
-
with st.spinner("Saving Kangas..."):
|
27 |
-
dg.save(str(proj_dir / 'datagrids' / dg_file_name))
|
28 |
-
|
29 |
-
hf_dataset = st.text_input("HuggingFace Dataset", value='beans')
|
30 |
-
st.button("Download and Run", on_click=partial(kangas_fn, hf_dataset))
|
31 |
-
st.markdown("""Click the dropdown in Kangas to see pre-loaded datasets""")
|
32 |
st.components.v1.iframe(src, None, 1000, scrolling=True)
|
|
|
14 |
|
15 |
st.set_page_config(layout="wide")
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
st.components.v1.iframe(src, None, 1000, scrolling=True)
|