Spaces:
Sleeping
Sleeping
Update simulation_scripts_orbmol.py
Browse files
simulation_scripts_orbmol.py
CHANGED
|
@@ -31,11 +31,20 @@ def load_orbmol_model(device: str = "cpu", precision: str = "float32-high") -> O
|
|
| 31 |
"""Load OrbMol once and reuse the same calculator."""
|
| 32 |
global _model_calc
|
| 33 |
if _model_calc is None:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
orbff = pretrained.orb_v3_conservative_inf_omat(
|
| 35 |
device=device,
|
| 36 |
precision=precision,
|
| 37 |
)
|
| 38 |
_model_calc = ORBCalculator(orbff, device=device)
|
|
|
|
| 39 |
return _model_calc
|
| 40 |
|
| 41 |
# -----------------------------
|
|
|
|
| 31 |
"""Load OrbMol once and reuse the same calculator."""
|
| 32 |
global _model_calc
|
| 33 |
if _model_calc is None:
|
| 34 |
+
# Deshabilitar optimizaciones problemáticas de PyTorch
|
| 35 |
+
import os
|
| 36 |
+
import torch
|
| 37 |
+
os.environ["TORCH_DYNAMO_DISABLE"] = "1"
|
| 38 |
+
os.environ["TORCHDYNAMO_DISABLE"] = "1"
|
| 39 |
+
torch._dynamo.config.disable = True
|
| 40 |
+
|
| 41 |
+
print("Loading OrbMol with optimizations disabled...")
|
| 42 |
orbff = pretrained.orb_v3_conservative_inf_omat(
|
| 43 |
device=device,
|
| 44 |
precision=precision,
|
| 45 |
)
|
| 46 |
_model_calc = ORBCalculator(orbff, device=device)
|
| 47 |
+
print("OrbMol loaded successfully")
|
| 48 |
return _model_calc
|
| 49 |
|
| 50 |
# -----------------------------
|