Spaces:
Runtime error
Runtime error
fix: use model_manager.get_buffer_status() for config endpoint instead of model attrs
Browse files
app.py
CHANGED
|
@@ -126,23 +126,13 @@ def get_config():
|
|
| 126 |
"""Get current config"""
|
| 127 |
try:
|
| 128 |
if model_manager:
|
| 129 |
-
|
| 130 |
-
base_sched_keys = set(model_manager._base_schedule_config.keys())
|
| 131 |
-
base_cfg_keys = set(model_manager._base_cfg_config.keys())
|
| 132 |
return jsonify(
|
| 133 |
{
|
| 134 |
-
"schedule_config":
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
},
|
| 139 |
-
"cfg_config": {
|
| 140 |
-
k: v
|
| 141 |
-
for k, v in model.cfg_config.items()
|
| 142 |
-
if k in base_cfg_keys
|
| 143 |
-
},
|
| 144 |
-
"history_length": model_manager.history_length,
|
| 145 |
-
"smoothing_alpha": float(model_manager.smoothing_alpha),
|
| 146 |
}
|
| 147 |
)
|
| 148 |
else:
|
|
|
|
| 126 |
"""Get current config"""
|
| 127 |
try:
|
| 128 |
if model_manager:
|
| 129 |
+
status = model_manager.get_buffer_status()
|
|
|
|
|
|
|
| 130 |
return jsonify(
|
| 131 |
{
|
| 132 |
+
"schedule_config": status["schedule_config"],
|
| 133 |
+
"cfg_config": status["cfg_config"],
|
| 134 |
+
"history_length": status["history_length"],
|
| 135 |
+
"smoothing_alpha": float(status["smoothing_alpha"]),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
}
|
| 137 |
)
|
| 138 |
else:
|