Spaces:
Sleeping
Sleeping
Publish CardioSafe Gradio demo
Browse files- app.py +0 -22
- requirements.txt +4 -2
app.py
CHANGED
|
@@ -48,28 +48,6 @@ import gradio as gr
|
|
| 48 |
import pandas as pd
|
| 49 |
import torch
|
| 50 |
|
| 51 |
-
|
| 52 |
-
def _ensure_torch_scatter() -> None:
|
| 53 |
-
"""MolGpKa loads `torch_scatter` at module import. The matching wheel
|
| 54 |
-
URL is torch-version-specific (PyG hosts them at data.pyg.org), so we
|
| 55 |
-
install it at boot rather than in requirements.txt."""
|
| 56 |
-
try:
|
| 57 |
-
import torch_scatter # noqa: F401
|
| 58 |
-
return
|
| 59 |
-
except ImportError:
|
| 60 |
-
pass
|
| 61 |
-
torch_ver = torch.__version__.split("+")[0]
|
| 62 |
-
wheel_index = f"https://data.pyg.org/whl/torch-{torch_ver}+cpu.html"
|
| 63 |
-
print(f" installing torch_scatter for torch=={torch_ver} from {wheel_index}")
|
| 64 |
-
subprocess.run(
|
| 65 |
-
[sys.executable, "-m", "pip", "install", "--quiet",
|
| 66 |
-
"torch_scatter", "-f", wheel_index],
|
| 67 |
-
check=True,
|
| 68 |
-
)
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
_ensure_torch_scatter()
|
| 72 |
-
|
| 73 |
from inference.ensemble import load_ensemble, load_l1000_encoder, predict # noqa: E402
|
| 74 |
from inference.featurize import featurize_batch # noqa: E402
|
| 75 |
from model.chemberta_encoder import ChemBERTaEncoder # noqa: E402
|
|
|
|
| 48 |
import pandas as pd
|
| 49 |
import torch
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
from inference.ensemble import load_ensemble, load_l1000_encoder, predict # noqa: E402
|
| 52 |
from inference.featurize import featurize_batch # noqa: E402
|
| 53 |
from model.chemberta_encoder import ChemBERTaEncoder # noqa: E402
|
requirements.txt
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
gradio>=5.0
|
| 2 |
-
torch
|
| 3 |
-
torch-
|
|
|
|
|
|
|
| 4 |
transformers>=4.51
|
| 5 |
rdkit>=2025.9.6
|
| 6 |
numpy>=2.0
|
|
|
|
| 1 |
gradio>=5.0
|
| 2 |
+
torch==2.6.0
|
| 3 |
+
--find-links https://data.pyg.org/whl/torch-2.6.0+cpu.html
|
| 4 |
+
torch-scatter
|
| 5 |
+
torch-geometric>=2.5
|
| 6 |
transformers>=4.51
|
| 7 |
rdkit>=2025.9.6
|
| 8 |
numpy>=2.0
|