Upload folder using huggingface_hub
Browse files
demo.py
CHANGED
@@ -26,6 +26,7 @@ parser.add_argument("--local", action='store_true')
|
|
26 |
args = parser.parse_args()
|
27 |
|
28 |
if not args.local:
|
|
|
29 |
from huggingface_hub import login
|
30 |
login(token=os.environ["HF_TOKEN"])
|
31 |
|
@@ -45,7 +46,8 @@ model = create_model(f"tpmlp_{size}").to(device)
|
|
45 |
try:
|
46 |
load_checkpoint(model, f"../tpmlp_{size}.pth.tar", True)
|
47 |
except FileNotFoundError:
|
48 |
-
|
|
|
49 |
load_checkpoint(model, f"tpmlp_{size}.pth.tar", True)
|
50 |
model.eval()
|
51 |
|
|
|
26 |
args = parser.parse_args()
|
27 |
|
28 |
if not args.local:
|
29 |
+
print("=> Logging into huggingface...")
|
30 |
from huggingface_hub import login
|
31 |
login(token=os.environ["HF_TOKEN"])
|
32 |
|
|
|
46 |
try:
|
47 |
load_checkpoint(model, f"../tpmlp_{size}.pth.tar", True)
|
48 |
except FileNotFoundError:
|
49 |
+
print(f"Downloading checkpoint tpmlp_{size}.")
|
50 |
+
os.system(f"wget https://f005.backblazeb2.com/file/cs-mixer/tpmlp_{size}.pth.tar &> /dev/null")
|
51 |
load_checkpoint(model, f"tpmlp_{size}.pth.tar", True)
|
52 |
model.eval()
|
53 |
|