Spaces:
Paused
Paused
Upload app.py
Browse files
app.py
CHANGED
|
@@ -234,16 +234,14 @@ def chat_completions():
|
|
| 234 |
|
| 235 |
except Exception as e:
|
| 236 |
logger.error(f"Error in chat completions: {str(e)}")
|
| 237 |
-
|
|
|
|
| 238 |
return jsonify({
|
| 239 |
'error': {
|
| 240 |
'message': str(e),
|
| 241 |
'type': 'invalid_request_error'
|
| 242 |
}
|
| 243 |
}), 500
|
| 244 |
-
finally:
|
| 245 |
-
current_api_key = key_manager.get_available_key()
|
| 246 |
-
logger.info(f"API KEY Switched -> {current_api_key[:11]}...")
|
| 247 |
|
| 248 |
@app.route('/hf/v1/models', methods=['GET'])
|
| 249 |
def list_models():
|
|
|
|
| 234 |
|
| 235 |
except Exception as e:
|
| 236 |
logger.error(f"Error in chat completions: {str(e)}")
|
| 237 |
+
current_api_key = key_manager.get_available_key()
|
| 238 |
+
logger.info(f"API KEY Switched -> {current_api_key[:11]}...")
|
| 239 |
return jsonify({
|
| 240 |
'error': {
|
| 241 |
'message': str(e),
|
| 242 |
'type': 'invalid_request_error'
|
| 243 |
}
|
| 244 |
}), 500
|
|
|
|
|
|
|
|
|
|
| 245 |
|
| 246 |
@app.route('/hf/v1/models', methods=['GET'])
|
| 247 |
def list_models():
|