Spaces:
Sleeping

rl-agent / fast.py
ShahirDevs's picture
Update fast.py
bf4856d verified
Raw History Blame Contribute Delete
396 Bytes
from fastapi import FastAPI
from model import AMLauditor
app = FastAPI()
env = AMLauditor()
@app.post("/reset")
def reset():
state, _ = env.reset()
return {"state": state.tolist()}
@app.post("/step")
def step(action: int):
state, reward, terminated, _ = env.step(action)
return {
"state": state.tolist(),
"reward": reward,
"terminated": terminated
}