Spaces:
Running on Zero
Running on Zero
make downloaded weights persistent, remove erronous len for rf3d output
Browse files
app.py
CHANGED
|
@@ -15,9 +15,14 @@ from rfd3.engine import RFD3InferenceConfig, RFD3InferenceEngine
|
|
| 15 |
|
| 16 |
cmd = "foundry install rfd3 ligandmpnn rf3"
|
| 17 |
print("Global PATH:", os.environ.get("PATH"))
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
|
| 19 |
if result.returncode == 0:
|
| 20 |
print("Models installed successfully.")
|
|
|
|
| 21 |
else:
|
| 22 |
print(f"Error installing models: {result.stderr}")
|
| 23 |
|
|
@@ -89,7 +94,7 @@ def test_rfd3_from_notebook():
|
|
| 89 |
for idx, data in outputs.items():
|
| 90 |
return_str += f"Batch {idx}: {len(data)} structure(s)\n"
|
| 91 |
for i, struct in enumerate(data):
|
| 92 |
-
return_str += f"Structure {i+1}:
|
| 93 |
return_str += struct.atom_array
|
| 94 |
return return_str
|
| 95 |
except Exception as e:
|
|
|
|
| 15 |
|
| 16 |
cmd = "foundry install rfd3 ligandmpnn rf3"
|
| 17 |
print("Global PATH:", os.environ.get("PATH"))
|
| 18 |
+
|
| 19 |
+
os.environ["HF_HOME"] = "/data" # HF Spaces persistent dir
|
| 20 |
+
os.environ["FOUNDRY_CHECKPOINT_DIRS"] = "/data/checkpoints"
|
| 21 |
+
|
| 22 |
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
|
| 23 |
if result.returncode == 0:
|
| 24 |
print("Models installed successfully.")
|
| 25 |
+
print(result.stdout)
|
| 26 |
else:
|
| 27 |
print(f"Error installing models: {result.stderr}")
|
| 28 |
|
|
|
|
| 94 |
for idx, data in outputs.items():
|
| 95 |
return_str += f"Batch {idx}: {len(data)} structure(s)\n"
|
| 96 |
for i, struct in enumerate(data):
|
| 97 |
+
return_str += f"Structure {i+1}:\n"
|
| 98 |
return_str += struct.atom_array
|
| 99 |
return return_str
|
| 100 |
except Exception as e:
|