akazemian commited on
Commit
e119d3b
·
verified ·
1 Parent(s): 6a2ca60

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -13
app.py CHANGED
@@ -29,17 +29,7 @@ INDEX_FILENAME = "index.csv"
29
 
30
  from huggingface_hub import hf_hub_download
31
 
32
- def _load_hf_index() -> pd.DataFrame:
33
- local = hf_hub_download(
34
- repo_id=HF_INDEX_REPO_ID,
35
- repo_type=HF_INDEX_REPO_TYPE,
36
- filename=INDEX_FILENAME,
37
- )
38
- df = pd.read_csv(local)
39
- for c in ["id","filename","relpath","category","dataset","tags","keywords","notes","uploaded_at"]:
40
- if c not in df.columns:
41
- df[c] = ""
42
- return df.fillna("")
43
 
44
  # ---------- DB helpers ----------
45
  def _load_db() -> pd.DataFrame:
@@ -86,10 +76,11 @@ def _load_hf_index() -> pd.DataFrame:
86
  Required columns: id, filename, relpath, category, dataset, tags, keywords, notes, uploaded_at
87
  """
88
  local = hf_hub_download(
89
- repo_id=HF_DATASET_REPO,
90
- repo_type="dataset",
91
  filename=INDEX_FILENAME,
92
  )
 
93
  df = pd.read_csv(local)
94
  for c in ["id","filename","relpath","category","dataset","tags","keywords","notes","uploaded_at"]:
95
  if c not in df.columns:
 
29
 
30
  from huggingface_hub import hf_hub_download
31
 
32
+
 
 
 
 
 
 
 
 
 
 
33
 
34
  # ---------- DB helpers ----------
35
  def _load_db() -> pd.DataFrame:
 
76
  Required columns: id, filename, relpath, category, dataset, tags, keywords, notes, uploaded_at
77
  """
78
  local = hf_hub_download(
79
+ repo_id=HF_INDEX_REPO_ID,
80
+ repo_type=HF_INDEX_REPO_TYPE,
81
  filename=INDEX_FILENAME,
82
  )
83
+
84
  df = pd.read_csv(local)
85
  for c in ["id","filename","relpath","category","dataset","tags","keywords","notes","uploaded_at"]:
86
  if c not in df.columns: