Spaces:
Running
on
L4
Running
on
L4
simonduerr
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,30 @@ from gradio_molecule3d import Molecule3D
|
|
6 |
from gradio_cofoldinginput import CofoldingInput
|
7 |
|
8 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
@spaces.GPU(duration=120)
|
11 |
def predict(jobname, inputs, recycling_steps, sampling_steps, diffusion_samples):
|
|
|
6 |
from gradio_cofoldinginput import CofoldingInput
|
7 |
|
8 |
import os
|
9 |
+
import urllib.request
|
10 |
+
|
11 |
+
CCD_URL = "https://huggingface.co/boltz-community/boltz-1/resolve/main/ccd.pkl"
|
12 |
+
MODEL_URL = "https://huggingface.co/boltz-community/boltz-1/resolve/main/boltz1.ckpt"
|
13 |
+
|
14 |
+
cache = "~/.boltz"
|
15 |
+
ccd = cache / "ccd.pkl"
|
16 |
+
if not ccd.exists():
|
17 |
+
click.echo(
|
18 |
+
f"Downloading the CCD dictionary to {ccd}. You may "
|
19 |
+
"change the cache directory with the --cache flag."
|
20 |
+
)
|
21 |
+
urllib.request.urlretrieve(CCD_URL, str(ccd)) # noqa: S310
|
22 |
+
|
23 |
+
# Download model
|
24 |
+
model = cache / "boltz1.ckpt"
|
25 |
+
if not model.exists():
|
26 |
+
click.echo(
|
27 |
+
f"Downloading the model weights to {model}. You may "
|
28 |
+
"change the cache directory with the --cache flag."
|
29 |
+
)
|
30 |
+
urllib.request.urlretrieve(MODEL_URL, str(model)) # noqa: S310
|
31 |
+
|
32 |
+
|
33 |
|
34 |
@spaces.GPU(duration=120)
|
35 |
def predict(jobname, inputs, recycling_steps, sampling_steps, diffusion_samples):
|