Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,9 +37,12 @@ print("="*60)
|
|
| 37 |
|
| 38 |
try:
|
| 39 |
# Check if trained model files exist in root
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
| 43 |
if has_model:
|
| 44 |
print("✓ Trained model files found in root directory")
|
| 45 |
print("Loading trained model...")
|
|
|
|
| 37 |
|
| 38 |
try:
|
| 39 |
# Check if trained model files exist in root
|
| 40 |
+
# Check if trained model files exist in root
|
| 41 |
+
model_files = ['config.json', 'sentence_bert_config.json']
|
| 42 |
+
# Check for either pytorch_model.bin or model.safetensors
|
| 43 |
+
has_weights = os.path.exists('pytorch_model.bin') or os.path.exists('model.safetensors')
|
| 44 |
+
has_model = all(os.path.exists(f) for f in model_files) and has_weights
|
| 45 |
+
|
| 46 |
if has_model:
|
| 47 |
print("✓ Trained model files found in root directory")
|
| 48 |
print("Loading trained model...")
|