Spaces:
Sleeping
Sleeping
Download fast.py from ShahirDevs/rl-agent: direct link, hf CLI and curl.
- Browser
- Download file 396 Bytes
-
https://huggingface.co/spaces/ShahirDevs/rl-agent/resolve/main/fast.py
- Command line
-
hf download hf://spaces/ShahirDevs/rl-agent/fast.py
-
curl -L -o fast.py https://huggingface.co/spaces/ShahirDevs/rl-agent/resolve/main/fast.py
396 Bytes
| from fastapi import FastAPI | |
| from model import AMLauditor | |
| app = FastAPI() | |
| env = AMLauditor() | |
| def reset(): | |
| state, _ = env.reset() | |
| return {"state": state.tolist()} | |
| def step(action: int): | |
| state, reward, terminated, _ = env.step(action) | |
| return { | |
| "state": state.tolist(), | |
| "reward": reward, | |
| "terminated": terminated | |
| } |