Spaces:
Running
Running
Update utils/rmbg_model.py
Browse files- utils/rmbg_model.py +10 -0
utils/rmbg_model.py
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import torch
|
| 2 |
import numpy as np
|
| 3 |
import torch.nn.functional as F
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
# ✅ Set Hugging Face cache path inside /app (writeable)
|
| 4 |
+
os.environ["HF_HOME"] = "/app/hf_cache"
|
| 5 |
+
os.environ["TRANSFORMERS_CACHE"] = "/app/hf_cache"
|
| 6 |
+
os.makedirs("/app/hf_cache", exist_ok=True)
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
|
| 11 |
import torch
|
| 12 |
import numpy as np
|
| 13 |
import torch.nn.functional as F
|