Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
db5eef3
1
Parent(s):
9dda91a
make /data right away, and pass if not present
Browse files- app.py +2 -2
- hf_calculator.py +4 -1
app.py
CHANGED
@@ -853,6 +853,8 @@ def main():
|
|
853 |
|
854 |
|
855 |
if __name__ == "__main__":
|
|
|
|
|
856 |
# On load, build and install the gradio_molecul3d fork
|
857 |
subprocess.call(
|
858 |
["gradio", "cc", "install"], cwd=Path(__file__).parent / "gradio_molecule3d/"
|
@@ -873,8 +875,6 @@ if __name__ == "__main__":
|
|
873 |
cwd=Path(__file__).parent.parent,
|
874 |
)
|
875 |
|
876 |
-
os.makedirs("/data/custom_inputs", exist_ok=True)
|
877 |
-
|
878 |
# Load gradio_molecule3d only once it's built and installed
|
879 |
from gradio_molecule3d import Molecule3D
|
880 |
|
|
|
853 |
|
854 |
|
855 |
if __name__ == "__main__":
|
856 |
+
os.makedirs("/data/custom_inputs", exist_ok=True)
|
857 |
+
|
858 |
# On load, build and install the gradio_molecul3d fork
|
859 |
subprocess.call(
|
860 |
["gradio", "cc", "install"], cwd=Path(__file__).parent / "gradio_molecule3d/"
|
|
|
875 |
cwd=Path(__file__).parent.parent,
|
876 |
)
|
877 |
|
|
|
|
|
878 |
# Load gradio_molecule3d only once it's built and installed
|
879 |
from gradio_molecule3d import Molecule3D
|
880 |
|
hf_calculator.py
CHANGED
@@ -51,7 +51,10 @@ class HFEndpointCalculator(Calculator):
|
|
51 |
hf_hub.HfApi().auth_check(
|
52 |
repo_id="facebook/UMA", token=oauth_token.token
|
53 |
)
|
54 |
-
|
|
|
|
|
|
|
55 |
except (hf_hub.errors.HfHubHTTPError, AttributeError):
|
56 |
raise gr.Error(
|
57 |
"You need to log in to HF and have gated model access to UMA before running your own simulations!"
|
|
|
51 |
hf_hub.HfApi().auth_check(
|
52 |
repo_id="facebook/UMA", token=oauth_token.token
|
53 |
)
|
54 |
+
try:
|
55 |
+
hash_save_file(atoms, task_name, "/data/custom_inputs/")
|
56 |
+
except FileNotFoundError:
|
57 |
+
pass
|
58 |
except (hf_hub.errors.HfHubHTTPError, AttributeError):
|
59 |
raise gr.Error(
|
60 |
"You need to log in to HF and have gated model access to UMA before running your own simulations!"
|