Spaces:
Sleeping
Sleeping
Commit
·
b9c2d22
1
Parent(s):
a3b4c21
Migrate model debug on app
Browse files
app.py
CHANGED
@@ -67,12 +67,18 @@ for root, dirs, files in os.walk(MODEL_CACHE_DIR):
|
|
67 |
for file in files:
|
68 |
print(f" 📄 {file}")
|
69 |
# Check if the required model files exist
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
else:
|
74 |
-
print(
|
75 |
-
exit(1)
|
76 |
# 3. Load the model to application
|
77 |
from sentence_transformers import SentenceTransformer
|
78 |
print("📥 **Loading Embedding Model...**")
|
|
|
67 |
for file in files:
|
68 |
print(f" 📄 {file}")
|
69 |
# Check if the required model files exist
|
70 |
+
snapshots_path = os.path.join(MODEL_CACHE_DIR, "models--sentence-transformers--all-MiniLM-L6-v2/snapshots")
|
71 |
+
if os.path.exists(snapshots_path):
|
72 |
+
snapshot_folders = os.listdir(snapshots_path)
|
73 |
+
if snapshot_folders:
|
74 |
+
model_loc = os.path.join(snapshots_path, snapshot_folders[0])
|
75 |
+
print(f"✅ Found model snapshot at {model_loc}")
|
76 |
+
else:
|
77 |
+
print("❌ No snapshot folder found!")
|
78 |
+
exit(1)
|
79 |
else:
|
80 |
+
print("❌ No snapshots directory found!")
|
81 |
+
exit(1)
|
82 |
# 3. Load the model to application
|
83 |
from sentence_transformers import SentenceTransformer
|
84 |
print("📥 **Loading Embedding Model...**")
|