Spaces:
Running on Zero
Running on Zero
revert to non-persistence of weights, describe persistence issue in issues_doc
Browse files- app.py +0 -2
- issues_doc.md +6 -0
app.py
CHANGED
|
@@ -16,8 +16,6 @@ from rfd3.engine import RFD3InferenceConfig, RFD3InferenceEngine
|
|
| 16 |
|
| 17 |
cmd = f"foundry install rfd3 ligandmpnn rf3 --checkpoint-dir /data/checkpoints"
|
| 18 |
print("Global PATH:", os.environ.get("PATH"))
|
| 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:
|
|
|
|
| 16 |
|
| 17 |
cmd = f"foundry install rfd3 ligandmpnn rf3 --checkpoint-dir /data/checkpoints"
|
| 18 |
print("Global PATH:", os.environ.get("PATH"))
|
|
|
|
|
|
|
| 19 |
|
| 20 |
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
|
| 21 |
if result.returncode == 0:
|
issues_doc.md
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
- I'm trying to make it so that pushing new code (editing app.py) and building again does not need to redownload the weights
|
| 2 |
+
- In a space like BoltzGen, all the installation happens in requirements.txt. downloading Boltzgen downloads the weights. This means that when I push app.py code, HF detects that requirements.txt did not change, it pulls the built image from cache and there is no need for redownload
|
| 3 |
+
- In my space, this is not the case, pip install rc-foundry is cached (from requirements.txt) but I need to run the command "foundry install rfd3 ligandmpnn rf3" to download the weights. I do the installation in the header of app.py. This means that the installation reruns every code push to app.py
|
| 4 |
+
- I considered fixing this using Docker instead of Gradio as I could create a Docker image with the weights downloaded but Docker is not compatible with ZeroGPU, needed for the hackathon
|
| 5 |
+
- I tried to use persistent storage using ./data to store the weights but persistent storage is only available at runtime not during build so I get a "Permission Denied" error.
|
| 6 |
+
- This problem is annoying for development but not really once the space is done and is being used as there will be no more code pushes.
|