Skip to content

Commit f2e886c

Browse files
author
kevtan
committed
Fixed code formatting errors
1 parent 421215a commit f2e886c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ml-agents/mlagents/trainers/demo_loader.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ def load_demonstration(
115115
:return: BrainParameter and list of AgentInfoActionPairProto containing demonstration data.
116116
"""
117117

118-
# First 32 bytes of file dedicated to meta-data.
119-
INITIAL_POS = 33
120118
file_paths = get_demo_files(file_path)
121119

122120
brain_params = None
@@ -134,12 +132,13 @@ def load_demonstration(
134132
meta_data_proto = DemonstrationMetaProto()
135133
meta_data_proto.ParseFromString(data[pos : pos + next_pos])
136134
total_expected += meta_data_proto.number_steps
137-
pos = INITIAL_POS
138-
if obs_decoded == 1:
135+
# first 32 bytes of file dedicated to meta-data.
136+
pos = 33
137+
elif obs_decoded == 1:
139138
brain_param_proto = BrainParametersProto()
140139
brain_param_proto.ParseFromString(data[pos : pos + next_pos])
141140
pos += next_pos
142-
if obs_decoded > 1:
141+
else:
143142
agent_info_action = AgentInfoActionPairProto()
144143
agent_info_action.ParseFromString(data[pos : pos + next_pos])
145144
if brain_params is None:
@@ -148,6 +147,7 @@ def load_demonstration(
148147
)
149148
info_action_pairs.append(agent_info_action)
150149
if len(info_action_pairs) == total_expected:
150+
breakpoint()
151151
break
152152
pos += next_pos
153153
obs_decoded += 1

0 commit comments

Comments
 (0)