wikimedia wasn't returning 200

This commit is contained in:
George Hotz
2022-01-15 19:09:29 -08:00
parent 52918fbf78
commit d8d19ed468
2 changed files with 4 additions and 2 deletions

View File

@@ -129,7 +129,7 @@ While more ops may be added, I think this base is stable.
Despite being tiny, tinygrad supports the full EfficientNet. Pass in a picture to discover what it is.
```bash
ipython3 examples/efficientnet.py https://upload.wikimedia.org/wikipedia/commons/4/41/Chicken.jpg
ipython3 examples/efficientnet.py https://media.istockphoto.com/photos/hen-picture-id831791190
```
Or, if you have a webcam and cv2 installed

View File

@@ -11,7 +11,9 @@ def fetch(url):
dat = f.read()
else:
print("fetching %s" % url)
dat = requests.get(url).content
r = requests.get(url)
assert r.status_code == 200
dat = r.content
with open(fp+".tmp", "wb") as f:
f.write(dat)
os.rename(fp+".tmp", fp)