mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-23 16:54:56 +00:00
error handling
This commit is contained in:
parent
9e53076a82
commit
80f67f979a
4 changed files with 38 additions and 1 deletions
|
|
@ -344,6 +344,14 @@ async def info():
|
|||
|
||||
@app.get("/batch")
|
||||
async def get_batch():
|
||||
# Check if trainer has registered first
|
||||
if not hasattr(app.state, "started"):
|
||||
return {
|
||||
"status": "error",
|
||||
"message": "Trainer not registered. Call /register first.",
|
||||
"batch": [],
|
||||
}
|
||||
|
||||
if not app.state.started:
|
||||
app.state.started = True
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue