Ben Burtenshaw
commited on
Commit
·
0b94483
1
Parent(s):
a9d8cf4
make creation configurable
Browse files
app.py
CHANGED
|
@@ -58,43 +58,51 @@ hub_username = st.text_input("Hub Username", "argilla")
|
|
| 58 |
hub_token = st.text_input("Hub Token", type="password")
|
| 59 |
private_selector = st.checkbox("Private Space", value=False)
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
if st.button("🤗 Setup Project Resources"):
|
| 62 |
repo_id = f"{hub_username}/{project_name}"
|
|
|
|
|
|
|
| 63 |
|
| 64 |
-
setup_dataset_on_hub(
|
| 65 |
-
repo_id=repo_id,
|
| 66 |
-
hub_token=hub_token,
|
| 67 |
-
)
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
| 72 |
|
| 73 |
-
|
|
|
|
|
|
|
| 74 |
|
| 75 |
-
|
| 76 |
-
source_repo="argilla/domain-specific-datasets-template",
|
| 77 |
-
target_repo=space_name,
|
| 78 |
-
hub_token=hub_token,
|
| 79 |
-
private=private_selector,
|
| 80 |
-
)
|
| 81 |
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
-
|
|
|
|
|
|
|
| 87 |
|
| 88 |
-
|
| 89 |
-
source_repo="argilla/argilla-template-space",
|
| 90 |
-
target_repo=argilla_name,
|
| 91 |
-
hub_token=hub_token,
|
| 92 |
-
private=private_selector,
|
| 93 |
-
)
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
seconds = 5
|
| 100 |
|
|
|
|
| 58 |
hub_token = st.text_input("Hub Token", type="password")
|
| 59 |
private_selector = st.checkbox("Private Space", value=False)
|
| 60 |
|
| 61 |
+
do_create_config_space = st.checkbox("Create Configuration Space", value=True)
|
| 62 |
+
do_create_argilla_space = st.checkbox("Create Argilla Space", value=True)
|
| 63 |
+
do_create_dataset = st.checkbox("Create Dataset", value=True)
|
| 64 |
+
|
| 65 |
if st.button("🤗 Setup Project Resources"):
|
| 66 |
repo_id = f"{hub_username}/{project_name}"
|
| 67 |
+
argilla_name = f"{project_name}_argilla_space"
|
| 68 |
+
space_name = f"{project_name}_config_space"
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
if do_create_dataset:
|
| 72 |
+
setup_dataset_on_hub(
|
| 73 |
+
repo_id=repo_id,
|
| 74 |
+
hub_token=hub_token,
|
| 75 |
+
)
|
| 76 |
|
| 77 |
+
st.success(
|
| 78 |
+
f"Dataset seed created and pushed to the Hub. Check it out [here](https://huggingface.co/datasets/{hub_username}/{project_name}). Hold on the repo_id: {repo_id}, we will need it in the next steps."
|
| 79 |
+
)
|
| 80 |
|
| 81 |
+
if do_create_config_space:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
+
duplicate_space_on_hub(
|
| 84 |
+
source_repo="argilla/domain-specific-datasets-template",
|
| 85 |
+
target_repo=space_name,
|
| 86 |
+
hub_token=hub_token,
|
| 87 |
+
private=private_selector,
|
| 88 |
+
)
|
| 89 |
|
| 90 |
+
st.success(
|
| 91 |
+
f"Configuration Space created. Check it out [here](https://huggingface.co/spaces/{hub_username}/{space_name})."
|
| 92 |
+
)
|
| 93 |
|
| 94 |
+
if do_create_argilla_space:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
|
| 96 |
+
duplicate_space_on_hub(
|
| 97 |
+
source_repo="argilla/argilla-template-space",
|
| 98 |
+
target_repo=argilla_name,
|
| 99 |
+
hub_token=hub_token,
|
| 100 |
+
private=private_selector,
|
| 101 |
+
)
|
| 102 |
+
|
| 103 |
+
st.success(
|
| 104 |
+
f"Argilla Space created. Check it out [here](https://huggingface.co/spaces/{hub_username}/{argilla_name})."
|
| 105 |
+
)
|
| 106 |
|
| 107 |
seconds = 5
|
| 108 |
|