Spaces:
Runtime error
Runtime error
Download customer_env.py from pawan2007/email_support: direct link, hf CLI and curl.
- Browser
- Download file 540 Bytes
-
https://huggingface.co/spaces/pawan2007/email_support/resolve/main/customer_env.py
- Command line
-
hf download hf://spaces/pawan2007/email_support/customer_env.py
-
curl -L -o customer_env.py https://huggingface.co/spaces/pawan2007/email_support/resolve/main/customer_env.py
540 Bytes
| class CustomerEnv: | |
| def __init__(self): | |
| self.state = None | |
| self.max_steps = 5 | |
| self.current_step = 0 | |
| def reset(self): | |
| self.state = [1, 2, 3, 4] # simple fixed state | |
| self.current_step = 0 | |
| return self.state | |
| def step(self, action): | |
| reward = 1.0 if action == 1 else -0.5 | |
| self.current_step += 1 | |
| done = self.current_step >= self.max_steps | |
| # safe update | |
| self.state = [x + action for x in self.state] | |
| return self.state, reward, done, {} |