Spaces:
Runtime error
Runtime error
Commit ·
95f6934
1
Parent(s): f2e9a48
what is gym version
Browse files
app.py
CHANGED
|
@@ -4,26 +4,4 @@ import time
|
|
| 4 |
import streamlit as st
|
| 5 |
from stable_baselines3 import PPO
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
video_every = 1
|
| 10 |
-
env = gym.wrappers.Monitor(env, "./video", video_callable=lambda episode_id: (episode_id%video_every)==0, force=True)
|
| 11 |
-
|
| 12 |
-
print("Observation Space :",env.observation_space)
|
| 13 |
-
print("Action Space :",env.action_space)
|
| 14 |
-
env.reset()
|
| 15 |
-
for i in range(1000):
|
| 16 |
-
action =env.action_space.sample()
|
| 17 |
-
obs,reward,done,info =env.step(action)
|
| 18 |
-
time.sleep(0.01)
|
| 19 |
-
if done :
|
| 20 |
-
env.reset()
|
| 21 |
-
env.close()
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
mp4_files = glob.glob("./video" + "/*.mp4")
|
| 26 |
-
|
| 27 |
-
video_file = open(mp4_files[-1], 'rb')
|
| 28 |
-
video_bytes = video_file.read()
|
| 29 |
-
st.video(video_bytes, format='mp4')
|
|
|
|
| 4 |
import streamlit as st
|
| 5 |
from stable_baselines3 import PPO
|
| 6 |
|
| 7 |
+
st.write(gym.__version__)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|