Upload app.py
Browse files
app.py
CHANGED
|
@@ -1147,6 +1147,21 @@ def chat():
|
|
| 1147 |
logger.error(f"Error in chat endpoint: {str(e)}")
|
| 1148 |
return jsonify({'error': 'Internal server error'}), 500
|
| 1149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1150 |
@app.route('/health')
|
| 1151 |
def health():
|
| 1152 |
"""Health check endpoint"""
|
|
|
|
| 1147 |
logger.error(f"Error in chat endpoint: {str(e)}")
|
| 1148 |
return jsonify({'error': 'Internal server error'}), 500
|
| 1149 |
|
| 1150 |
+
@app.route('/load_model_manual', methods=['POST'])
|
| 1151 |
+
def load_model_manual():
|
| 1152 |
+
"""Manually trigger model loading"""
|
| 1153 |
+
try:
|
| 1154 |
+
logger.info("🔄 Manual model loading triggered...")
|
| 1155 |
+
success = load_model()
|
| 1156 |
+
|
| 1157 |
+
return jsonify({
|
| 1158 |
+
'success': success,
|
| 1159 |
+
'model_loaded': model is not None,
|
| 1160 |
+
'tokenizer_loaded': tokenizer is not None,
|
| 1161 |
+
'message': 'Model loaded successfully' if success else 'Model loading failed'
|
| 1162 |
+
})
|
| 1163 |
+
except Exception as e:
|
| 1164 |
+
logger.error(f"Manual model loading error: {str(e)}")
|
| 1165 |
@app.route('/health')
|
| 1166 |
def health():
|
| 1167 |
"""Health check endpoint"""
|