Spaces:
Paused
Paused
Fix startup hang: 使用 local_files_only=True
Browse files- code/clip_retrieval.py +3 -1
code/clip_retrieval.py
CHANGED
|
@@ -143,12 +143,14 @@ class CLIPRetriever:
|
|
| 143 |
cache_dir=HF_CACHE_DIR,
|
| 144 |
use_safetensors=True, # Force safetensors to bypass CVE-2025-32434
|
| 145 |
torch_dtype=torch_dtype,
|
|
|
|
| 146 |
).to(target_device)
|
| 147 |
|
| 148 |
processor = CLIPProcessor.from_pretrained(
|
| 149 |
self.model_name,
|
| 150 |
cache_dir=HF_CACHE_DIR,
|
| 151 |
-
use_safetensors=True # Force safetensors to bypass CVE-2025-32434
|
|
|
|
| 152 |
)
|
| 153 |
|
| 154 |
self.model = model
|
|
|
|
| 143 |
cache_dir=HF_CACHE_DIR,
|
| 144 |
use_safetensors=True, # Force safetensors to bypass CVE-2025-32434
|
| 145 |
torch_dtype=torch_dtype,
|
| 146 |
+
local_files_only=True # Use pre-downloaded model from build
|
| 147 |
).to(target_device)
|
| 148 |
|
| 149 |
processor = CLIPProcessor.from_pretrained(
|
| 150 |
self.model_name,
|
| 151 |
cache_dir=HF_CACHE_DIR,
|
| 152 |
+
use_safetensors=True, # Force safetensors to bypass CVE-2025-32434
|
| 153 |
+
local_files_only=True # Use pre-downloaded model from build
|
| 154 |
)
|
| 155 |
|
| 156 |
self.model = model
|