diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..876b7e34 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: Unit Tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test: + name: Test + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install Dependencies + run: pip install ipython numpy tqdm requests + - name: Run Tests + run: ipython3 test/mnist.py diff --git a/tinygrad/utils.py b/tinygrad/utils.py index bbef87f6..61f57224 100644 --- a/tinygrad/utils.py +++ b/tinygrad/utils.py @@ -2,7 +2,7 @@ def fetch_mnist(): def fetch(url): import requests, gzip, os, hashlib, numpy fp = os.path.join("/tmp", hashlib.md5(url.encode('utf-8')).hexdigest()) - if not os.path.isfile(fp): + if os.path.isfile(fp): with open(fp, "rb") as f: dat = f.read() else: