Skip to content

Commit

Permalink
gdrive bugfixing (AliciaCurth#25)
Browse files Browse the repository at this point in the history
* bump version

* Bump version: 0.1.6

* Workflows update: Scheduled runs, updated python versions (#2)

* update Py versions

* py3.10 fix

* update deps

* drop 3.10

* updare reqs

* debug jaxlib

* debug jaxlib

* windows debug

* debug windows

* debug windows

* optional JAX, Torch

* debug windows

* debug windows

* bump version

* Update .pre-commit-config.yaml

* Update .pre-commit-config.yaml

* update workflows (#3)

* update workflows

* debug release

* cleanup

* Bugfixing (#4)

* fix PyTorch API

* GPU fixes
enable more tests

* bugfixing

* train/eval review

* fix gdrive downloader
  • Loading branch information
bcebere authored Oct 15, 2022
1 parent 21782d9 commit 8242358
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions catenets/datasets/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pathlib import Path
from typing import Optional

from google_drive_downloader import GoogleDriveDownloader as gdd
import gdown


def download_gdrive_if_needed(path: Path, file_id: str) -> None:
Expand All @@ -26,7 +26,7 @@ def download_gdrive_if_needed(path: Path, file_id: str) -> None:
if path.exists():
return

gdd.download_file_from_google_drive(file_id=file_id, dest_path=path)
gdown.download(id=file_id, output=str(path), quiet=False)


def download_http_if_needed(path: Path, url: str) -> None:
Expand Down Expand Up @@ -98,6 +98,7 @@ def download_if_needed(
unarchive_folder: str
Mandatory if you set unarchive to True.
"""
download_path = Path(download_path)
if file_id is not None:
download_gdrive_if_needed(download_path, file_id)
elif http_url is not None:
Expand All @@ -108,4 +109,8 @@ def download_if_needed(
if unarchive and unarchive_folder is None:
raise ValueError("Please provide a folder for the archive")
if unarchive and unarchive_folder is not None:
unarchive_if_needed(download_path, unarchive_folder)
try:
unarchive_if_needed(download_path, unarchive_folder)
except BaseException as e:
print(f"Failed to unpack {download_path}. Error {e}")
download_path.unlink()
2 changes: 1 addition & 1 deletion catenets/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.1"
__version__ = "0.2.2"
Empty file added experiments/__init__.py
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
googledrivedownloader
gdown
jax>=0.3.16
jaxlib>=0.3.14; sys_platform != 'win32'
loguru>=0.5.3
Expand Down

0 comments on commit 8242358

Please sign in to comment.