
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
The Python package google drive facilitates access to files uploaded to Google Drive.
The Google-Driver
Python package simplifies downloading files and folders from Google Drive, with some constraints for model management through Hugging-Face and Git-Lfs. Issues may arise due to too many files, access permissions, or large file sizes. Be cautious with large files as they may contain viruses. The gdown
package offers better exception handling and compatibility.
pip install googledriver
Download to specific path
To save a file from a shared Google Drive URL to local storage, use the following code.
from googledriver import download
URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
download(URL, './model/tf_gpt2_model')
Download to cached folder
To download a cached file (or directory) from a URL and return its path, you can use the following method.
from googledriver import download
URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
cached_path = download(URL, None, 'tf_model')
Basically, torch cached is used, and the huggingface hub module is used as a reference and wrapped.
The return value returns the path of the saved files. However, it is different when using it as a cache folder.
Download to current working directory
from googledriver import download_folder
URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
download_folder(URL)
Download to specific directory
from googledriver import download_folder
URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
save_folder = './any/path/to/save/'
download_folder(URL, save_folder)
Download to cached directory
from googledriver import download_folder
URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
download_folder(URL, cached=True)
In the case of the cache folder, the return value is the cache folder path of Google Drive. Therefore, it may be difficult to cache and use multiple folders.
[1] https://github.com/huggingface/transformers
[2] https://github.com/wkentaro/gdown
FAQs
The Python package google drive facilitates access to files uploaded to Google Drive.
We found that googledriver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.