Spaces:
Paused
Paused
Commit
·
28fe5c6
1
Parent(s):
9110c1d
🔍 Add debugging for Firebase custom models storage
Browse files- Add detailed logging to see what's being saved to Firebase
- Debug custom models loading structure
- Identify why only model IDs are appearing in Firebase
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
src/services/model_families.py
CHANGED
|
@@ -705,7 +705,8 @@ class ModelFamilyManager:
|
|
| 705 |
try:
|
| 706 |
custom_models_ref = self.firebase_db.child('custom_models')
|
| 707 |
custom_models_ref.set(config)
|
| 708 |
-
print("Saved custom models to Firebase")
|
|
|
|
| 709 |
except Exception as e:
|
| 710 |
print(f"Failed to save custom models in thread: {e}")
|
| 711 |
|
|
@@ -792,13 +793,18 @@ class ModelFamilyManager:
|
|
| 792 |
custom_models_ref = self.firebase_db.child('custom_models')
|
| 793 |
config = custom_models_ref.get()
|
| 794 |
|
|
|
|
|
|
|
| 795 |
if config and 'custom_models' in config:
|
| 796 |
for model_data in config['custom_models']:
|
| 797 |
# Convert provider string back to enum
|
| 798 |
model_data['provider'] = AIProvider(model_data['provider'])
|
| 799 |
model_info = ModelInfo(**model_data)
|
| 800 |
loaded_models.append(model_info)
|
| 801 |
-
|
|
|
|
|
|
|
|
|
|
| 802 |
except Exception as e:
|
| 803 |
print(f"Failed to load custom models in thread: {e}")
|
| 804 |
|
|
|
|
| 705 |
try:
|
| 706 |
custom_models_ref = self.firebase_db.child('custom_models')
|
| 707 |
custom_models_ref.set(config)
|
| 708 |
+
print(f"Saved custom models to Firebase: {len(config['custom_models'])} models")
|
| 709 |
+
print(f"Config structure: {config}")
|
| 710 |
except Exception as e:
|
| 711 |
print(f"Failed to save custom models in thread: {e}")
|
| 712 |
|
|
|
|
| 793 |
custom_models_ref = self.firebase_db.child('custom_models')
|
| 794 |
config = custom_models_ref.get()
|
| 795 |
|
| 796 |
+
print(f"Firebase custom models config: {config}")
|
| 797 |
+
|
| 798 |
if config and 'custom_models' in config:
|
| 799 |
for model_data in config['custom_models']:
|
| 800 |
# Convert provider string back to enum
|
| 801 |
model_data['provider'] = AIProvider(model_data['provider'])
|
| 802 |
model_info = ModelInfo(**model_data)
|
| 803 |
loaded_models.append(model_info)
|
| 804 |
+
print(f"Loaded custom model: {model_info.model_id}")
|
| 805 |
+
else:
|
| 806 |
+
print("No custom_models found in Firebase config")
|
| 807 |
+
print(f"Loaded {len(loaded_models)} custom models from Firebase")
|
| 808 |
except Exception as e:
|
| 809 |
print(f"Failed to load custom models in thread: {e}")
|
| 810 |
|