Skip to content

Commit

Permalink
dev(narugo): add auto run
Browse files Browse the repository at this point in the history
  • Loading branch information
narugo1992 committed Dec 28, 2023
1 parent c4c7034 commit 6fdf170
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ numpy
pillow
pandas
natsort
di-toolkit
di-toolkit
tabulate
9 changes: 8 additions & 1 deletion skpick/online.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import copy
import json
import os.path

Expand All @@ -6,6 +7,7 @@
from hfutils.operate import get_hf_fs, download_file_to_file, get_hf_client, \
upload_directory_as_archive, upload_directory_as_directory
from hfutils.utils import tqdm, TemporaryDirectory
from huggingface_hub import hf_hub_url
from natsort import natsorted

from .pick import pick_from_package
Expand Down Expand Up @@ -67,7 +69,12 @@ def online_pick(src_repo: str, dst_repo: str):
for name in names:
if name not in item:
item[name] = 0
df_rows.append(item)

for item in dst_index[::-1]:
row = copy.deepcopy(item)
download_url = hf_hub_url(repo_id=dst_repo, repo_type='dataset', filename=item['filename'])
row['download'] = f'![download]({download_url})'
df_rows.append(row)

df = pd.DataFrame(df_rows)
with open(os.path.join(td_doc, 'README.md'), 'w') as f:
Expand Down

0 comments on commit 6fdf170

Please sign in to comment.