Skip to content

Commit

Permalink
Merge pull request #29 from NicholasSynovic/main
Browse files Browse the repository at this point in the history
Bump version
  • Loading branch information
NicholasSynovic committed Jan 27, 2023
2 parents b9361d4 + 2c9b495 commit da5da6d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,5 @@ ptm_torrent/huggingface/v2/data
ptm_torrent/huggingface/v3/data
ptm_torrent/pytorchhub/data
example/onnx
example/PTMTorrent
example/onnxmodelzoo.tar.gz
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Python dependencies are managed with `pip` and
> Instructions were written for Linux operating systems
1. Change directories into the ONNX Model Zoo PTMTorrent directory:
`cd data/onnxmodelzoo`
`cd ptm_torrent/onnxmodelzoo`
1. Create a `Python 3.10` virtual environment: `python3.10 -m venv env`
1. Activate virtual environment: `source env/bin/activate`
1. Upgrade `pip`: `python -m pip install --upgrade pip`
Expand Down
2 changes: 1 addition & 1 deletion example/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def extractAuthorRepo(url: str) -> PurePath:
def main():
paths: List[PurePath] = []

jsonFile: PurePath = PurePath("onnxmodelzoo.json")
jsonFile: PurePath = PurePath("json/onnxmodelzoo.json")
json: List[dict] = readJSON(filepath=jsonFile)

data: dict
Expand Down
2 changes: 1 addition & 1 deletion example/run.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

python3.10 example.py | xargs -I % clime-git-commits-extract -d % &&
clime-git-commits-graph
clime-git-commits-graph --x-label Days --y-label "Lines of Code" --title "ONNX Model Zoo Lines of Code per Day"
8 changes: 4 additions & 4 deletions ptm_torrent/huggingface/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
import ptm_torrent.huggingface.createSchema as createSchema
import ptm_torrent.huggingface.downloadJSON as downloadJSON
import ptm_torrent.huggingface.downloadRepos as downloadRepos
import ptm_torrent.huggingface.splitRepos as splitRepos
import ptm_torrent.huggingface.setupFileSystem as setupFS
import ptm_torrent.huggingface.splitRepos as splitRepos

if __name__ == "__main__":
shrinkage: float | str | None

shrinkageEnvironmentVariable: str = "HF_TORRENT_SHRINKAGE"
shrinkageEnvironmentValue: str = environ.get(shrinkageEnvironmentVariable)

if shrinkageEnvironmentValue is None:
shrinkage = 0.1

try:
shrinkage = float(shrinkageEnvironmentValue)
except ValueError:
print(f"Invalid value for {shrinkageEnvironmentVariable}. Defaulting to 0.1")
shrinkage = 0.1
except TypeError:
print(f"Invalid value for {shrinkageEnvironmentVariable}. Defaulting to 0.1")
shrinkage = 0.1

if shrinkage > 1 or shrinkage <= 0:
print(f"Invalid value for {shrinkageEnvironmentVariable}. Defaulting to 0.1")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ptm-torrent"
version = "0.1.5"
version = "0.1.6"
description = ""
authors = ["Nicholas M. Synovic <nicholas.synovic@gmail.com>"]
readme = "README.md"
Expand Down

0 comments on commit da5da6d

Please sign in to comment.