burtenshaw HF staff commited on
Commit
8c543d4
β€’
1 Parent(s): a7d5cc0

Upload 3 files

Browse files
Files changed (2) hide show
  1. app.py +11 -1
  2. hub.py +14 -1
app.py CHANGED
@@ -8,12 +8,22 @@ from hub import (
8
 
9
  import streamlit as st
10
 
 
 
 
11
  DEFAULT_DOMAIN = "farming"
12
 
13
- st.set_page_config("Domain Data Grower", page_icon="πŸ§‘β€πŸŒΎ")
 
 
 
14
  st.header("πŸ§‘β€πŸŒΎ Domain Data Grower")
15
  st.divider()
16
 
 
 
 
 
17
  ################################################################################
18
  # APP MARKDOWN
19
  ################################################################################
 
8
 
9
  import streamlit as st
10
 
11
+
12
+ # Constants
13
+ # Written here to avoid defaults.py
14
  DEFAULT_DOMAIN = "farming"
15
 
16
+ st.set_page_config(
17
+ "Domain Data Grower", page_icon="πŸ§‘β€πŸŒΎ", initial_sidebar_state="collapsed"
18
+ )
19
+
20
  st.header("πŸ§‘β€πŸŒΎ Domain Data Grower")
21
  st.divider()
22
 
23
+ st.sidebar.link_button(
24
+ "πŸ€— Get your Hub Token", "https://huggingface.co/settings/tokens"
25
+ )
26
+
27
  ################################################################################
28
  # APP MARKDOWN
29
  ################################################################################
hub.py CHANGED
@@ -14,10 +14,23 @@ def setup_dataset_on_hub(repo_id, hub_token):
14
  repo_type="dataset",
15
  )
16
 
 
 
 
 
 
 
 
 
 
17
 
18
  def duplicate_space_on_hub(source_repo, target_repo, hub_token, private=False):
19
  duplicate_space(
20
- from_id=source_repo, to_id=target_repo, token=hub_token, private=private
 
 
 
 
21
  )
22
 
23
 
 
14
  repo_type="dataset",
15
  )
16
 
17
+ # upload the seed data
18
+ hf_api.upload_file(
19
+ path_or_fileobj="seed_data.json",
20
+ path_in_repo="seed_data.json",
21
+ repo_id=repo_id,
22
+ repo_type="dataset",
23
+ token=hub_token,
24
+ )
25
+
26
 
27
  def duplicate_space_on_hub(source_repo, target_repo, hub_token, private=False):
28
  duplicate_space(
29
+ from_id=source_repo,
30
+ to_id=target_repo,
31
+ token=hub_token,
32
+ private=private,
33
+ exist_ok=True,
34
  )
35
 
36