question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ability to upload folder with upload_file

See original GitHub issue

Is your feature request related to a problem? Please describe. In the spirit of moving away from forcing users to deal with git, it would be nice to allow folks to upload entire folders using upload_file, instead of having them glob/walk through all the files and call upload_file each time.

Describe the solution you’d like

from huggingface_hub import upload_file

# Uploads contents of `images/` to `nateraw/some-repo`
upload_file('nateraw/some-repo', './images/')

Describe alternatives you’ve considered

Bonus points if we have “compression” options as well (zip, tar, gz, etc). If we do that though, we should be mindful of potentially including decompression options in the proposed download_file function #460

Additional context Wanted to upload a few small folders and found myself having to write more code than I wanted to in order to loop over all my local files and call upload_file.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
osansevierocommented, Nov 25, 2021

IMO instead of supporting uploading folders with upload_file, I would rather have a separate method upload_folder or upload_files which allows receiving a directory (or file pattern even!) to upload multiple files.

WDYT @LysandreJik?

0reactions
naterawcommented, Jun 21, 2022

Closed with #888

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upload files and folders to a library - Microsoft Support
Open the OneDrive or SharePoint site library. · Select Upload at the top of the Documents library. · In the Add a document...
Read more >
Power Apps Upload Multiple Files AND Drag and Drop Files
If you want to upload files, then you need this. You will learn how to multi-select files + drag and drop files into...
Read more >
Power Automate Desktop : 113 || Upload File(s) to FTP and ...
INDIA. Power Automate Desktop : 113 || Upload File (s) to FTP and Upload Folder (s) to FTP || FTP Automation. 6.9K views...
Read more >
PowerApps upload file to SharePoint document library
In this video, you will learn how to upload a file directly to a SharePoint Document Library. No crazy complex code, finally a...
Read more >
Uploading Files — Flask Documentation (2.2.x)
We want to be able to serve the uploaded files so they can be downloaded by users. We'll define a download_file view to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found