Spaces:
Runtime error
Runtime error
better check
Browse files
app.py
CHANGED
|
@@ -53,6 +53,7 @@ import spaces # for Hugging Face ZeroGPU deployment
|
|
| 53 |
import re
|
| 54 |
import plotly.graph_objects as go
|
| 55 |
from numpy.lib.user_array import container
|
|
|
|
| 56 |
|
| 57 |
# Only for Hugging Face hosting - Add the Hugging Face cache to persistent storage to avoid downloading safetensors every time the demo sleeps and wakes up
|
| 58 |
os.environ['HF_HOME'] = '/data/.huggingface'
|
|
@@ -113,7 +114,8 @@ class ShapeWordsDemo:
|
|
| 113 |
print(f"Using device: {device} in initialize_models")
|
| 114 |
|
| 115 |
# Download Shape2CLIP code if it doesn't exist
|
| 116 |
-
if not os.path.exists("shapewords_paper_code"):
|
|
|
|
| 117 |
print("Loading models file")
|
| 118 |
os.system("git clone https://github.com/lodurality/shapewords_paper_code.git")
|
| 119 |
|
|
|
|
| 53 |
import re
|
| 54 |
import plotly.graph_objects as go
|
| 55 |
from numpy.lib.user_array import container
|
| 56 |
+
import shutil
|
| 57 |
|
| 58 |
# Only for Hugging Face hosting - Add the Hugging Face cache to persistent storage to avoid downloading safetensors every time the demo sleeps and wakes up
|
| 59 |
os.environ['HF_HOME'] = '/data/.huggingface'
|
|
|
|
| 114 |
print(f"Using device: {device} in initialize_models")
|
| 115 |
|
| 116 |
# Download Shape2CLIP code if it doesn't exist
|
| 117 |
+
if not os.path.exists("shapewords_paper_code/geometry_guidance_models.py"):
|
| 118 |
+
shutil.rmtree("shapewords_paper_code/", ignore_errors=True)
|
| 119 |
print("Loading models file")
|
| 120 |
os.system("git clone https://github.com/lodurality/shapewords_paper_code.git")
|
| 121 |
|