Skip to content

Commit

Permalink
Merge branch 'main' into eqv2_Egrad_detachfix
Browse files Browse the repository at this point in the history
  • Loading branch information
kyonofx authored Jul 21, 2024
2 parents a36bb2b + 0a6f62f commit 812440a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/fairchem-core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies = [
"wandb",
"numba",
"e3nn>=0.5",
"urllib3",
"requests",
"orjson",
"tqdm",
"submitit"
Expand Down
8 changes: 4 additions & 4 deletions src/fairchem/core/models/model_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from importlib import resources
from typing import TYPE_CHECKING

import urllib3
import requests
import yaml

from fairchem.core import models
Expand Down Expand Up @@ -56,9 +56,9 @@ def model_name_to_local_file(model_name: str, local_cache: str | Path) -> str:
# download the file
if not os.path.isfile(local_path):
local_path_tmp = local_path + ".tmp" # download to a tmp file in case we fail
http = urllib3.PoolManager()
with open(local_path_tmp, "wb") as out:
r = http.request("GET", model_url, preload_content=False)
shutil.copyfileobj(r, out)
response = requests.get(model_url, stream=True)
response.raw.decode_content = True
shutil.copyfileobj(response.raw, out)
shutil.move(local_path_tmp, local_path)
return local_path

0 comments on commit 812440a

Please sign in to comment.